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 11 months 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:
12 12
   deploy:
13 13
     image: images.abackstrom.com/rsync-ssh
14 14
     commands:
15
-      - rsync -hrz --delete -C -e ssh ./output ./nginx ./assets web04:/var/sixohthree/sixohthree.com
16
-      - ssh web04 'sudo systemctl reload nginx'
15
+      - rsync -hrz --delete -C -e ssh ./output ./nginx ./assets deploy.sixohthree.com:/tmp/drone_${DRONE_JOB_NUMBER}_${DRONE_COMMIT_SHA}
16
+      - 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/"
17
+      - pdsh -w ssh:web[04-05].sixohthree.com "sudo systemctl reload nginx"
18
+      - ssh deploy.sixohthree.com "rm -rf /tmp/drone_${DRONE_JOB_NUMBER}_${DRONE_COMMIT_SHA}"
17 19
 
18 20
 branches: master

Loading…
Cancel
Save