continue working on supporting multiple branches
This commit is contained in:
@@ -1,7 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# - Fix branch to check out
|
||||
# - Process command line
|
||||
GIT_REPO_BRANCH="production"
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
echo "Usage: $0 [--branch <branch name>]"
|
||||
exit 0
|
||||
;;
|
||||
--branch)
|
||||
shift 1
|
||||
if [ $# -eq 0 ] ; then echo "$0: ERROR - Branch not specified." ; exit 1 ; fi
|
||||
GIT_REPO_BRANCH="$1"
|
||||
shift 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# - Include ansible virtual environment
|
||||
. "${HOME}/.ansible-venv/bin/activate"
|
||||
|
||||
SCRIPT_NAME="$(basename "${0}")"
|
||||
@@ -23,5 +39,5 @@ if ! flock -n 9 ; then echo " - ERROR - Another copy of ${SCRIPT_NAME} is alread
|
||||
|
||||
# - Do our work
|
||||
echo
|
||||
ansible-pull --only-if-changed --url "${GIT_REPO}" --checkout "${@}"
|
||||
ansible-pull --only-if-changed --url "${GIT_REPO}" --checkout "${GIT_REPO_BRANCH}" "${@}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user