Skip to content

Instantly share code, notes, and snippets.

@snewell92
Created September 19, 2017 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snewell92/65ee8d9371fa233210061de4dc62284d to your computer and use it in GitHub Desktop.
Save snewell92/65ee8d9371fa233210061de4dc62284d to your computer and use it in GitHub Desktop.
circle ci ssh
version: 2
jobs:
build:
docker:
- image: kyleondy/alpine-rsync
working_directory: ~/repo
steps:
- run:
name: list
command: ls -la ~/.ssh
- run:
name: placeholder
command: echo 'No work to do or automated tests to run (yet). Build and test pass.'
deployment:
docker:
- image: snew92/dorian-asp-rsync-deploy:0.2
working_directory: ~/repo
steps:
- checkout
- run:
name: deploy
command: sh ~/repo/repo-scripts/deploy.sh
workflows:
version: 2
build-and-deploy:
jobs:
- build
- deployment:
filters:
branches:
only:
- master
requires:
- build
#!/bin/sh
eval $(ssh-agent -s)
# What would I pass to ssh-add??
# ssh-add
rsync -avzqr -e "ssh -p xx -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" \
~/repo/ some-user@host1.com:/path/to/remote/dir/ \
& \
rsync -avzqr -e "ssh -p xx -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" \
~/repo/ some-user@host2.com:/path/to/remote/dir/ \
& \
rsync -avzqr -e "ssh -p xx -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" \
~/repo/ some-user@host3.com:/path/to/remote/dir/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment