]> git.aero2k.de Git - urlbot-v3.git/commitdiff
improve deploy.sh
authorThorsten <mail@aero2k.de>
Sat, 25 Jan 2020 20:38:51 +0000 (21:38 +0100)
committerThorsten <mail@aero2k.de>
Sat, 25 Jan 2020 20:38:51 +0000 (21:38 +0100)
deploy/deploy.sh

index d13c9987ecfce1a1b76f6243d1f00284307573f1..c0e7f23f28a118c8b5c6fe144c4d567bcf74015b 100755 (executable)
@@ -1,7 +1,12 @@
 #!/bin/bash
 
-source ~/.virtualenvs/ansible/bin/activate
+[ "$(pwd | rev | cut -d/ -f1 | rev)" == "deploy" ] || pushd deploy || exit
+
+# shellcheck disable=SC1090
+source "${HOME}/.virtualenvs/ansible/bin/activate"
 
 export ANSIBLE_VAULT_PASSWORD_FILE=vault.sh
 
 ansible-playbook -i hosts deploy.yml -D
+
+popd || exit