Advertisement
Guest User

Untitled

a guest
Jan 27th, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #!/bin/bash
  2. set -eo pipefail
  3.  
  4. run_on_server() {
  5. local app="$1"
  6. shift
  7. /usr/bin/ssh -i /home/jenkins/.ssh/sshkey -o StrictHostKeyChecking=no "${app}.dev.contaazul.local" $@
  8. }
  9.  
  10. deploy() {
  11. local app="$1"
  12. echo "Deploying on $app"
  13. run_on_server "$app" "sudo service wildfly stop"
  14. run_on_server "$app" "sudo rm -rf /storage/wildfly/standalone/{deployments,data,tmp,log}/*"
  15. run_on_server "$app" "sudo s3cmd get s3://contaazul.ci/custom/invoice-issuer-war.war /storage/wildfly/standalone/deployments"
  16. run_on_server "$app" "sudo service wildfly start"
  17. }
  18.  
  19. s3cmd put /storage/workspace/invoice-issuer-deploy/invoice-issuer-war/target/invoice-issuer-war.war s3://contaazul.ci/custom/
  20. for i in 0{1..3}; do
  21. server="fiscal$i"
  22. [ "${!server}" = "true" ] && deploy "$server"
  23. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement