Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -eo pipefail
- run_on_server() {
- local app="$1"
- shift
- /usr/bin/ssh -i /home/jenkins/.ssh/sshkey -o StrictHostKeyChecking=no "${app}.dev.contaazul.local" $@
- }
- deploy() {
- local app="$1"
- echo "Deploying on $app"
- run_on_server "$app" "sudo service wildfly stop"
- run_on_server "$app" "sudo rm -rf /storage/wildfly/standalone/{deployments,data,tmp,log}/*"
- run_on_server "$app" "sudo s3cmd get s3://contaazul.ci/custom/invoice-issuer-war.war /storage/wildfly/standalone/deployments"
- run_on_server "$app" "sudo service wildfly start"
- }
- s3cmd put /storage/workspace/invoice-issuer-deploy/invoice-issuer-war/target/invoice-issuer-war.war s3://contaazul.ci/custom/
- for i in 0{1..3}; do
- server="fiscal$i"
- [ "${!server}" = "true" ] && deploy "$server"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement