diff --git a/utils/provision b/utils/provision index 29293f938f1305764a8c06124f87203198292a7b..af27200eee78e4c108c95a1addd7b5c78b734a49 100755 --- a/utils/provision +++ b/utils/provision @@ -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