Use the rsync plugin to deploy files to a server using rsync over ssh. The following parameters are used to configure this plugin:
hosts
- connects to this host addressuser
- connects as this userport
- connects to this host portkey
- SSH RSA privete key for remote hostsource
- source path from which files are copied , when you want skip rsync ,set source null or commit itsource:
target
- target path to which files are copiedtarget: /docker/proj/
chmod
- chmod remote target after finish rsyncchmod: 0644
chown
- chown remote target after finish rsyncchown: "33:33"
delete
- delete extraneous files from the target dirdelete: true
include
- include files matching the specified patternexclude
- exclude files matching the specified patternfilter
- include or exclude files according to filtering rulesexport
- export ENV used for script in remote machine by sshscript
- execute commands on the remote host after files are copied
Sample configuration in the .drone.yml
file:
deploy:
rsync:
user: root
host: 127.0.0.1
port: 22
source: copy/files/from
target: send/files/to
delete: false
recursive: true
exclude:
- "exclude/this/pattern/*"
- "or/this/one"
script:
- service nginx restart
The plugin authenticates to your server using a per-repository SSH key generated by Drone. You can find the public key in your repository settings in Drone. You will need to copy / paste this key into your ~/.ssh/authorized_keys
file on your remote machine.