drone-rsync icon indicating copy to clipboard operation
drone-rsync copied to clipboard

Add the support of local scripts

Open honglonglong opened this issue 2 years ago • 4 comments

Add the support of local scripts, that could be run on local server before rsync to remote server.

This is required by my project because when target server got lower version of openSSH, and it's impossible to upgrade the target server, so adopt a local script feature to run below before sync files. echo -e "Host xxx.xxx.xxx.xxx\n KexAlgorithms +diffie-hellman-group1-sha1" >> ~/.ssh/config

honglonglong avatar Mar 15 '22 08:03 honglonglong

I'm terribly sorry for the late response... This PR must have slipped my attention.

Wouldn't it be better to allow a custom SSH config to be passed? That seems like a more direct approach to solving your problem.

mjwwit avatar Jul 11 '22 10:07 mjwwit

Hi @mjwwit, Thank you for the reply. Could you explain more on how to pass a custom SSH config?

honglonglong avatar Jul 14 '22 00:07 honglonglong

There currently isn't a way to pass custom config, but the ability to do this would in my opinion be a better solution to your problem than your local script. There are several ways one could implement this. You could allow the user to specify the path to a file which contains the custom SSH config. You could also allow the user to specify the custom config within the pipeline. Of course, having it both ways is also possible.

mjwwit avatar Jul 14 '22 09:07 mjwwit

There currently isn't a way to pass custom config, but the ability to do this would in my opinion be a better solution to your problem than your local script. There are several ways one could implement this. You could allow the user to specify the path to a file which contains the custom SSH config. You could also allow the user to specify the custom config within the pipeline. Of course, having it both ways is also possible.

Thanks for the explanation. The custom config way is to put a file in the target server right? it seems difficult for my case, because I'm using docker for Drone CI, so I cannot put a custom config file into the target server.

honglonglong avatar Jul 18 '22 02:07 honglonglong