Mirror of community Drone plugin for syncing files and directories to remote servers
305
This fork is a mirror of Rsync Plugin for Drone that simply uses rsync to deploy a set of files to a remote directory on a server. This fork exists as a level of indirection in case the original plugin disappears (since it is a comminity Drone plugin).
Use the plugin to synchronize files to remote hosts, and execute arbitrary commands on those hosts.
The following parameters are used to configure the plugin:
root22./falsefalseThe following secrets can be used to secure the sensitive parts of your configuration:
It is highly recommended to put your private key into a secret (rsync_key) so it is not exposed to users. This can be done using the drone-cli:
drone secret add \
--repository your/repo \
--name rsync_key \
--value @./id_rsa \
Add the secret to your .drone.yml:
kind: pipeline
steps:
- name: rsync
image: drillster/drone-rsync
environment:
RSYNC_KEY:
from_secret: rsync_key
settings:
user: some-user
hosts:
- remote1
source: ./dist
target: ~/packages
secrets: [ rsync_key ]
See the secret guides for additional information on secrets.
kind: pipeline
name: default
steps:
- name: rsync
image: drillster/drone-rsync
environment:
RSYNC_KEY:
from_secret: rsync_key
RSYNC_USER:
from_secret: rsync_user
settings:
hosts:
- remote1
- remote2
source: ./dist
target: ~/packages
include:
- "app.tar.gz"
- "app.tar.gz.md5"
exclude:
- "**.*"
prescript:
- cd ~/packages
- md5sum -c app.tar.gz.md5
- tar -xf app.tar.gz -C ~/app
script:
- cd ~/packages
- md5sum -c app.tar.gz.md5
- tar -xf app.tar.gz -C ~/app
The example above illustrates a situation where an app package (app.tar.gz) will be deployed to 2 remote hosts (remote1 and remote2). An md5 checksum will be deployed as well. After deploying, the md5 checksum is used to check the deployed package. If successful the package is extracted.
The script passed to script will be executed on remote machines directly after rsync completes to deploy the files. It will be executed step by step until a command returns a non-zero exit-code. If this happens, the entire plugin will exit and fail the build.
This image will be automatically built and deployed to DockerHub when a Semver tag is pushed to the repo.
Content type
Image
Digest
Size
4.8 MB
Last updated
over 6 years ago
docker pull gendall/drone-rsync