diff --git a/docs/development/plugin-triggers.md b/docs/development/plugin-triggers.md index 1f75aef43..004bdbf4f 100644 --- a/docs/development/plugin-triggers.md +++ b/docs/development/plugin-triggers.md @@ -252,6 +252,21 @@ APP="$1"; PROPERTY="$2" # TODO ``` +### `builder-herokuish-allowed` + +- Description: Checks if herokuish is allowed to run on non-amd64 hosts +- Invoked by: unit tests +- Arguments: `$APP` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + ### `builder-image-is-cnb` - Description: Checks if an image is cnb-based @@ -297,6 +312,36 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x # TODO ``` +### `buildpack-stack-name` + +- Description: Retrieves the configured buildpack stack for the pack and herokuish builders +- Invoked by: builder-herokuish and builder-pack +- Arguments: `$APP` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + +### `caddy-template-source` + +- Description: Retrieves an alternative template for the caddy compose config +- Invoked by: caddy-vhosts +- Arguments: `$APP` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + ### `certs-exists` - Description: Echos `true` if certs exists for the app, `false` otherwise @@ -1005,6 +1050,21 @@ if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then fi ``` +### `haproxy-template-source` + +- Description: Retrieves an alternative template for the haproxy compose config +- Invoked by: haproxy-vhosts +- Arguments: `$APP` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + ### `logs-get-property` - Description: Return the value for an app's log property @@ -1241,6 +1301,21 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x nginx -t ``` +### `openresty-template-source` + +- Description: Retrieves an alternative template for the openresty compose config +- Invoked by: openresty-vhosts +- Arguments: `$APP` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + ### `ports-clear` - Description: Clears the ports for a given app without triggering further restarts or rebuilds @@ -1441,6 +1516,21 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x # TODO ``` +### `post-build-lambda` + +- Description: Allows you to run commands after the build image is create for a given app. Only applies to apps using lambda. +- Invoked by: `internal function dokku_build() (build phase)` +- Arguments: `$APP` `$SOURCECODE_WORK_DIR` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + ### `post-certs-remove` - Description: Allows you to run commands after a cert is removed @@ -1641,6 +1731,21 @@ BUILDER_TYPE="$1"; APP="$2"; IMAGE=$3 # TODO ``` +### `post-stack-set` TODO + +- Description: Allows you to run commands after changing the stack +- Invoked by: buildpacks plugin +- Arguments: `$APP` `$VALUE` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + ### `post-stop` - Description: Can be used to run commands after an app is manually stopped @@ -1674,6 +1779,21 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x # TODO ``` +### `pre-build-lambda` + +- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to apps using lambda. +- Invoked by: `internal function dokku_build() (build phase)` +- Arguments: `$APP` `$SOURCECODE_WORK_DIR` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + ### `pre-build-pack` > Warning: The pack plugin trigger apis are under development and may change @@ -1830,6 +1950,23 @@ DOCKER_COMMIT_LABEL_ARGS=("--change" "LABEL org.label-schema.schema-version=1.0" docker commit "${DOCKER_COMMIT_LABEL_ARGS[@]}" $CID $IMAGE >/dev/null ``` +### `pre-release-lambda` + +- Description: Allows you to run commands before environment variables are set for the release step of the deploy. Only applies to apps using lambda. +- Invoked by: `internal function dokku_release() (release phase)` +- Arguments: `$APP $IMAGE_TAG` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +APP="$1"; IMAGE_TAG="$2"; + +# TODO +``` + ### `pre-release-pack` > Warning: The pack plugin trigger apis are under development and may change @@ -2052,6 +2189,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x # TODO ``` + ### `ps-current-scale` - Description: Prints out the current scale contents (process-type=quantity) delimited by newlines. @@ -2284,6 +2422,25 @@ DOKKU_SCHEDULER="$1"; APP="$2"; # TODO ``` +### `scheduler-is-deployed` + +> Warning: The scheduler plugin trigger apis are under development and may change +> between minor releases until the 1.0 release. + +- Description: Allows you to check if the scheduler has deployed the app +- Invoked by: Various plugins +- Arguments: `$DOKKU_SCHEDULER $APP` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +DOKKU_SCHEDULER="$1"; APP="$2"; + +# TODO +``` + ### `scheduler-logs` > Warning: The scheduler plugin trigger apis are under development and may change @@ -2360,6 +2517,25 @@ DOKKU_SCHEDULER="$1"; APP="$2"; IMAGE_TAG="$3"; # TODO ``` +### `scheduler-post-deploy-process` + +> Warning: The scheduler plugin trigger apis are under development and may change +> between minor releases until the 1.0 release. + +- Description: Allows you to run a command after a process has been started +- Invoked by: scheduler-docker-local +- Arguments: `$APP $PROCESS_TYPE` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +APP="$1"; PROCESS_TYPE="$2"; + +# TODO +``` + ### `scheduler-post-run` > Warning: The scheduler plugin trigger apis are under development and may change @@ -2475,6 +2651,25 @@ DOKKU_SCHEDULER="$1"; APP="$2"; CONTAINER="$3"; TAIL="$4"; PRETTY_PRINT="$5"; NU # TODO ``` +### `scheduler-run-stop` + +> Warning: The scheduler plugin trigger apis are under development and may change +> between minor releases until the 1.0 release. + +- Description: Allows a scheduler to stop all "run" containers or a specified container +- Invoked by: `dokku run:stop` +- Arguments: `$DOKKU_SCHEDULER $APP $CONTAINER_NAME` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +DOKKU_SCHEDULER="$1"; APP="$2"; CONTAINER_NAME="$3"; + +# TODO +``` + ### `scheduler-stop` > Warning: The scheduler plugin trigger apis are under development and may change @@ -2510,6 +2705,21 @@ APP="$1" # TODO ``` +### `traefik-template-source` + +- Description: Retrieves an alternative template for the traefik compose config +- Invoked by: traefik-vhosts +- Arguments: `$APP` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +# TODO +``` + ### `uninstall` - Description: Used to cleanup after itself. diff --git a/plugins/20_events/app-list b/plugins/20_events/app-list deleted file mode 100755 index acd6c1afd..000000000 --- a/plugins/20_events/app-list +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -set -eo pipefail -[[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" - -[[ ! "$DOKKU_EVENTS" ]] || dokku_log_plugn_trigger_call "$(basename "$0")" "$@" diff --git a/plugins/20_events/app-list b/plugins/20_events/app-list new file mode 120000 index 000000000..5178a749f --- /dev/null +++ b/plugins/20_events/app-list @@ -0,0 +1 @@ +hook \ No newline at end of file diff --git a/plugins/20_events/network-compute-ports b/plugins/20_events/builder-get-property similarity index 100% rename from plugins/20_events/network-compute-ports rename to plugins/20_events/builder-get-property diff --git a/plugins/20_events/network-get-port b/plugins/20_events/builder-herokuish-allowed similarity index 100% rename from plugins/20_events/network-get-port rename to plugins/20_events/builder-herokuish-allowed diff --git a/plugins/20_events/post-build-cnb b/plugins/20_events/buildpack-stack-name similarity index 100% rename from plugins/20_events/post-build-cnb rename to plugins/20_events/buildpack-stack-name diff --git a/plugins/20_events/post-release-buildpack b/plugins/20_events/caddy-template-source similarity index 100% rename from plugins/20_events/post-release-buildpack rename to plugins/20_events/caddy-template-source diff --git a/plugins/20_events/post-release-cnb b/plugins/20_events/haproxy-template-source similarity index 100% rename from plugins/20_events/post-release-cnb rename to plugins/20_events/haproxy-template-source diff --git a/plugins/20_events/post-release-dockerfile b/plugins/20_events/openresty-template-source similarity index 100% rename from plugins/20_events/post-release-dockerfile rename to plugins/20_events/openresty-template-source diff --git a/plugins/20_events/post-release-pack b/plugins/20_events/ports-get-property similarity index 100% rename from plugins/20_events/post-release-pack rename to plugins/20_events/ports-get-property diff --git a/plugins/20_events/pre-build-cnb b/plugins/20_events/post-build-lambda similarity index 100% rename from plugins/20_events/pre-build-cnb rename to plugins/20_events/post-build-lambda diff --git a/plugins/20_events/pre-release-cnb b/plugins/20_events/post-release-lambda similarity index 100% rename from plugins/20_events/pre-release-cnb rename to plugins/20_events/post-release-lambda diff --git a/plugins/20_events/procfile-extract b/plugins/20_events/post-stack-set similarity index 100% rename from plugins/20_events/procfile-extract rename to plugins/20_events/post-stack-set diff --git a/plugins/20_events/procfile-remove b/plugins/20_events/pre-build-lambda similarity index 100% rename from plugins/20_events/procfile-remove rename to plugins/20_events/pre-build-lambda diff --git a/plugins/20_events/profile-get-command b/plugins/20_events/pre-release-lambda similarity index 100% rename from plugins/20_events/profile-get-command rename to plugins/20_events/pre-release-lambda diff --git a/plugins/20_events/scheduler-docker-cleanup b/plugins/20_events/scheduler-post-deploy-process similarity index 100% rename from plugins/20_events/scheduler-docker-cleanup rename to plugins/20_events/scheduler-post-deploy-process diff --git a/plugins/20_events/scheduler-run-stop b/plugins/20_events/scheduler-run-stop new file mode 120000 index 000000000..5178a749f --- /dev/null +++ b/plugins/20_events/scheduler-run-stop @@ -0,0 +1 @@ +hook \ No newline at end of file diff --git a/plugins/20_events/traefik-template-source b/plugins/20_events/traefik-template-source new file mode 120000 index 000000000..5178a749f --- /dev/null +++ b/plugins/20_events/traefik-template-source @@ -0,0 +1 @@ +hook \ No newline at end of file diff --git a/plugins/builder-lambda/builder-release b/plugins/builder-lambda/builder-release index 087cb8007..90153c6f0 100755 --- a/plugins/builder-lambda/builder-release +++ b/plugins/builder-lambda/builder-release @@ -25,7 +25,6 @@ trigger-builder-lambda-builder-release() { return 1 fi - plugn trigger post-release-lambda "$APP" "$IMAGE_TAG" plugn trigger post-release-builder "$BUILDER_TYPE" "$APP" "$IMAGE" } diff --git a/plugins/haproxy-vhosts/docker-args-process-deploy b/plugins/haproxy-vhosts/docker-args-process-deploy index 321b403fe..60577f9cf 100755 --- a/plugins/haproxy-vhosts/docker-args-process-deploy +++ b/plugins/haproxy-vhosts/docker-args-process-deploy @@ -29,9 +29,6 @@ trigger-haproxy-vhosts-docker-args-process-deploy() { return fi - # run this silently or the output will be set as a label - plugn trigger domains-setup "$APP" >/dev/null - # ensure we have a port mapping plugn trigger ports-configure "$APP"