Skip to content

Commit

Permalink
Gitlab CI compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
noirbizarre committed Jan 10, 2019
1 parent 43f4703 commit a6484f4
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,26 @@ if [[ ! -z "${ANSIBLE_VAULT_PASSWORD}" ]]; then
echo "$ANSIBLE_VAULT_PASSWORD" > $ANSIBLE_VAULT_PASSWORD_FILE
fi

case $1 in
playbook)
shift
ansible-playbook "$@"
;;
shell)
/bin/ash
;;
sh)
shift
/bin/ash -c "$@"
;;
*)
ansible "$@"
;;
esac
if [[ ! -z "${CI_JOB_ID}" ]]; then
case $1 in
playbook)
shift
ansible-playbook "$@"
;;
shell)
/bin/ash
;;
sh)
shift
/bin/ash -c "$@"
;;
*)
ansible "$@"
;;
esac
else
# We are in a CI pipeline
# Just spawn a shell for compatibility
/bin/ash
fi

0 comments on commit a6484f4

Please sign in to comment.