Browse Source

drone: deploy to multiple servers

First, push site to a central deploy host. Then have all web hosts pull
from the deploy host.
restyle-spring-2019
Annika Backstrom 1 year ago
parent
commit
372c743168
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      .drone.yml

+ 4
- 2
.drone.yml View File

@@ -12,7 +12,9 @@ pipeline:
deploy:
image: images.abackstrom.com/rsync-ssh
commands:
- rsync -hrz --delete -C -e ssh ./output ./nginx ./assets web04:/var/sixohthree/sixohthree.com
- ssh web04 'sudo systemctl reload nginx'
- rsync -hrz --delete -C -e ssh ./output ./nginx ./assets deploy.sixohthree.com:/tmp/drone_${DRONE_JOB_NUMBER}_${DRONE_COMMIT_SHA}
- pdsh -w ssh:web[04-05].sixohthree.com "rsync -hrz --delete -C -e ssh deploy.sixohthree.com:/tmp/drone_${DRONE_JOB_NUMBER}_${DRONE_COMMIT_SHA}/ /var/sixohthree/sixohthree.com/"
- pdsh -w ssh:web[04-05].sixohthree.com "sudo systemctl reload nginx"
- ssh deploy.sixohthree.com "rm -rf /tmp/drone_${DRONE_JOB_NUMBER}_${DRONE_COMMIT_SHA}"

branches: master

Loading…
Cancel
Save