The rsync plugin can be used to transfer files to remote machines, and run a user-defined script afterwards.

Example

kind: pipeline
name: default

steps:
- name: deploy
  image: drillster/drone-rsync
  settings:
    hosts: [ "server-prod1", "server-prod2" ]
    source: ./target
    target: ~/packages
    include: [ "app.jar", "app.jar.md5" ]
    script:
      - cd ~/packages
      - md5sum -c app.jar.md5

Properties

  • hosts

    arrayrequired

    list of hosts (remote machines)

    Default: none

  • port

    numberoptional

    port to connect to on the remote machines

    Default: 22

  • user

    stringoptional

    user to connect as on the remote machines

    Default: root

  • key

    stringoptional

    private SSH key for the remote machines

    Secret recommended

    Default: none

  • source

    stringoptional

    source folder to copy from

    Default: ./

  • target

    stringoptional

    target folder on remote machines to copy to

    Default: none

  • include

    arrayoptional

    rsync include filter

    Default: none

  • exclude

    arrayoptional

    rsync exclude filter

    Default: none

  • recursive

    booleanoptional

    instruct plugin to recursively copy

    Default: false

  • delete

    booleanoptional

    instruct plugin to delete the target folder before copying

    Default: false

  • args

    stringoptional

    instruct plugin to use these additional rsync CLI arguments, e.g. "--blocking-io"

    Default: none

  • script

    arrayoptional

    list of commands to execute on remote machines over SSH after rsync occurs

    Default: none

  • prescript

    arrayoptional

    list of commands to execute on remote machines before rsync occurs

    Default: none