From fbd20f1bac00f00b2fd164ab0d4cb7afab811ff9 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Sat, 25 Jan 2020 21:38:51 +0100 Subject: [PATCH] improve deploy.sh --- deploy/deploy.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deploy/deploy.sh b/deploy/deploy.sh index d13c998..c0e7f23 100755 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -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 -- 2.39.2