Compare commits

...

No commits in common. "24940669f12f573386a9961f74819cadb4090663" and "5d66058f138ccb22398803e861f00426cc0f9b8e" have entirely different histories.

2 changed files with 24 additions and 20 deletions

View File

@ -1,18 +0,0 @@
pipeline:
production:
image: localhost:5000/alpine:3.7
secrets: [ ssh_private_key, ssh_host_key ]
commands:
- apk add --update openssh-client
- mkdir "$${HOME}/.ssh"
- echo -n "$${SSH_PRIVATE_KEY}" > "$${HOME}/.ssh/id_rsa"
- chmod 700 "$${HOME}/.ssh/id_rsa"
- echo "$${SSH_HOST_KEY}" > "$${HOME}/.ssh/known_hosts"
- echo "$${HOME}"
- ls -laR "$${HOME}"
- cat "$${HOME}/.ssh/known_hosts"
- cat "$${HOME}/.ssh/known_hosts"
- ssh deploy@web04.sixohthree.com ls
- echo "$${HOME}/.ssh/known_hosts"
branches: master

View File

@ -1,3 +1,25 @@
# drone-rsync-test
# drone-rsync-ssh
A Dockerfile for rsync+ssh deploys using [Drone](https://drone.io/).
* In Drone, add repository secrets for `ssh_private_key` and `ssh_host_key`
* In your `.drone.yml`, run `drone-ssh-keys` to inject SSH secrets into `~/.ssh`
## Sample .drone.yml
Here's a sample `.drone.yml` that injects the SSH keys, rsyncs files to a host,
then triggers a command on the host.
pipeline:
deploy:
image: images.abackstrom.com/rsync-ssh
secrets: [ ssh_private_key, ssh_host_key ]
commands:
- drone-ssh-keys
- rsync -Chrz -e ssh ./public user@host:/var/www/html
- ssh user@host 'sudo systemctl reload nginx'
## Building the image
make image IMAGE_NAME=your_name_here
Thu Jun 7 13:56:57 UTC 2018