Add post-create hook

Note that this is invoked *before* the application is deployed, so it's usage is quite different than a potential post-successful-create hook.
This commit is contained in:
Jose Diaz-Gonzalez
2015-11-25 19:11:32 -05:00
parent e0143ed226
commit 8e9d04ae36
4 changed files with 38 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
git_build_app_repo() {
verify_app_name "$1"
@@ -14,6 +15,7 @@ git_build_app_repo() {
chmod 755 $TMP_WORK_DIR
unset GIT_DIR GIT_WORK_TREE
pushd $TMP_WORK_DIR > /dev/null
[[ ! -d "$DOKKU_ROOT/$APP" ]] && apps_create $APP
git clone -q "$DOKKU_ROOT/$APP" "$TMP_WORK_DIR" &> /dev/null
git config advice.detachedHead false
git checkout "$REV" &> /dev/null