Commit 11185c4a authored by Michel Memeteau's avatar Michel Memeteau

Merge branch '174-handle-git-branches-when-provisioning' into 'develop'

Resolve "Handle git branches when provisioning"

See merge request !185
parents 48c0cbb4 a1587b03
......@@ -26,11 +26,12 @@ LOG_LEVEL="${LOG_LEVEL:-6}" # 7 = debug -> 0 = emergency
# opts & defaults from. The parsing is unforgiving so be precise in your syntax
read -r -d '' usage <<-'EOF'
-u [arg] URL to process. Required.
-a [arg] Application to install. (in the form github.com/indiehosters/wordpress)
-a [arg] Application to install. (in the form github.com/indiehosters/wordpress or wordpress in REPO_MODE)
-t [arg] Checkout a specific tag or branch from the application repo. default to master
-s Start the application right away.
-b Buys the associated domain name.
-i Configure OpenDKIM.
-c Configures DNS on Namecheap.
-c Configures DNS if possible.
-d Enables debug mode
-h This page
EOF
......@@ -113,9 +114,19 @@ function application () {
warning "REPO specified, using argument as app name"
git_url=https://${APP_REPO_URL}/${arg_a}.git
fi
#Define the tag/branch
if [ "${arg_t}" = "1" ]; then
warning "No tag/branch specified, Using master "
git_tag=master
else
git_tag=${arg_t}
fi
git clone ${git_url} -b ${arg_t} /data/domains/${arg_u}
git clone ${git_url} /data/domains/${arg_u}
cd /data/domains/${arg_u}
if [ -f ./scripts/install ]; then
export URL=${arg_u}
if [ -z ${MAIL_DOMAIN:-} ]; then
......@@ -212,6 +223,8 @@ fi
[ -z "${arg_u}" ] && help "URL is required."
[ -z "${LOG_LEVEL}" ] && emergency "Cannot continue without LOG_LEVEL."
# tags/branch for modules
[ -z "${arg_t}" ] && arg_t=master
### Runtime
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment