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:
@@ -2,6 +2,7 @@
|
||||
[[ " apps apps:create apps:destroy help apps:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
|
||||
|
||||
case "$1" in
|
||||
apps)
|
||||
@@ -10,12 +11,7 @@ case "$1" in
|
||||
;;
|
||||
|
||||
apps:create)
|
||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
[[ -d "$DOKKU_ROOT/$2" ]] && dokku_log_fail "Name is already taken"
|
||||
APP="$2"
|
||||
|
||||
mkdir -p "$DOKKU_ROOT/$APP"
|
||||
echo "Creating $APP... done"
|
||||
apps_create $2
|
||||
;;
|
||||
|
||||
apps:destroy)
|
||||
|
||||
13
plugins/apps/functions
Executable file
13
plugins/apps/functions
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
apps_create() {
|
||||
[[ -z $1 ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
[[ -d "$DOKKU_ROOT/$1" ]] && dokku_log_fail "Name is already taken"
|
||||
local APP="$1"
|
||||
|
||||
mkdir -p "$DOKKU_ROOT/$APP"
|
||||
echo "Creating $APP... done"
|
||||
plugn trigger post-create $APP
|
||||
}
|
||||
Reference in New Issue
Block a user