Merge pull request #3090 from dokku/ensure-events

Ensure all plugin triggers have docs and events integration
This commit is contained in:
Jose Diaz-Gonzalez
2018-03-03 17:59:11 -05:00
committed by GitHub
8 changed files with 132 additions and 123 deletions

View File

@@ -36,10 +36,8 @@ Jul 3 16:10:02 dokku.me dokku[128114]: INVOKED: docker-args-run( nhl )
Jul 3 16:10:03 dokku.me dokku[128136]: INVOKED: post-release-buildpack( pythonapp )
Jul 3 16:10:03 dokku.me dokku[128195]: INVOKED: pre-deploy( pythonapp )
Jul 3 16:10:23 dokku.me dokku[129253]: INVOKED: docker-args-deploy( pythonapp )
Jul 3 16:10:24 dokku.me dokku[129337]: INVOKED: bind-external-ip( pythonapp )
Jul 3 16:10:24 dokku.me dokku[129451]: INVOKED: check-deploy( pythonapp 6274ced0d4be11af4490cd18abaf77cdd593f025133f403d984e80d86a39acec web 5000 10.0.16.80 )
Jul 3 16:10:35 dokku.me dokku[129561]: INVOKED: docker-args-deploy( pythonapp )
Jul 3 16:10:35 dokku.me dokku[129649]: INVOKED: bind-external-ip( pythonapp )
Jul 3 16:10:36 dokku.me dokku[129760]: INVOKED: check-deploy( pythonapp ac88a56ee4161ff37e4b92d1498c3eadc91f0aa7c8b81b44fc077e2a51d54cc0 worker )
Jul 3 16:10:46 dokku.me dokku[129851]: INVOKED: post-deploy( pythonapp )
Jul 3 16:10:46 dokku.me dokku[129945]: INVOKED: nginx-pre-reload( pythonapp )
@@ -56,29 +54,28 @@ dokku events:list
```
=====> Events currently logged
docker-args-build
pre-delete
post-deploy
receive-app
pre-release-buildpack
nginx-pre-reload
docker-args-deploy
post-build-buildpack
post-domains-update
post-release-dockerfile
check-deploy
git-pre-pull
git-post-pull
nginx-hostname
bind-external-ip
pre-deploy
post-delete
dependencies
pre-build-buildpack
docker-args-build
docker-args-deploy
docker-args-run
pre-build-dockerfile
post-release-buildpack
git-post-pull
git-pre-pull
nginx-hostname
nginx-pre-reload
post-build-buildpack
post-build-dockerfile
post-delete
post-deploy
post-domains-update
post-release-buildpack
post-release-dockerfile
pre-build-buildpack
pre-build-dockerfile
pre-delete
pre-deploy
pre-release-buildpack
pre-release-dockerfile
receive-app
update
```
```

View File

@@ -29,38 +29,6 @@ The following plugin triggers describe those available to a Dokku installation.
> The example plugin trigger code is not guaranteed to be implemented as in within dokku, and are merely simplified examples. Please look at the Dokku source for larger, more in-depth examples.
### `post-config-update`
- Description: Allows you to get notified when one or more configs is added or removed. Action can be *set* or *unset*
- Invoked by: `dokku config:set`, `dokku config:unset`
- Arguments: `$APP` `set|unset` `key1=VALUE1 key2=VALUE2`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `bind-external-ip`
- Description: Allows you to disable binding to the external box ip
- Invoked by: `dokku deploy`
- Arguments: `$APP`
- Example:
```shell
#!/usr/bin/env bash
# Force always binding to the docker ip, no matter
# what the settings are for a given app.
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
echo false
```
### `check-deploy`
- Description: Allows you to run checks on a deploy before Dokku allows the container to handle requests.
@@ -179,22 +147,6 @@ case "$DOKKU_DISTRO" in
esac
```
### `deployed-app-image-tag`
- Description: Used to manage the tag of the image being deployed. Useful for deploying a specific version of an image, or when deploying from an external registry
- Invoked by: `internal function dokku_deploy_cmd() (deploy phase)`
- Arguments: `$APP`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# customize the tag version
echo 'not-latest'
```
### `deployed-app-image-repo`
- Description: Used to manage the full repo of the image being deployed. Useful for deploying from an external registry where the repository name is not `dokku/$APP`
@@ -212,6 +164,22 @@ APP="$1"
echo "dokkupaas/$APP"
```
### `deployed-app-image-tag`
- Description: Used to manage the tag of the image being deployed. Useful for deploying a specific version of an image, or when deploying from an external registry
- Invoked by: `internal function dokku_deploy_cmd() (deploy phase)`
- Arguments: `$APP`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# customize the tag version
echo 'not-latest'
```
### `deployed-app-repository`
- Description: Used to manage the remote repository of the image being deployed.
@@ -240,19 +208,14 @@ echo 'derp.dkr.ecr.us-east-1.amazonaws.com'
# to bust cache at any arbitrary point in a Dockerfile build
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
cache-bust-build-arg() {
declare desc="dockerfile cache busting plugin trigger"
local STDIN=$(cat)
local APP="$1" IMAGE_SOURCE_TYPE="$2"
local output=""
STDIN=$(cat)
APP="$1"; IMAGE_SOURCE_TYPE="$2"
output=""
if [[ "$IMAGE_SOURCE_TYPE" == "dockerfile" ]]; then
output=" --build-arg CACHEBUST=$(date +%s)"
fi
echo -n "$STDIN$output"
}
cache-bust-build-arg "$@"
if [[ "$IMAGE_SOURCE_TYPE" == "dockerfile" ]]; then
output=" --build-arg CACHEBUST=$(date +%s)"
fi
echo -n "$STDIN$output"
```
### `docker-args-deploy`
@@ -419,11 +382,11 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `network-get-property`
### `network-get-port`
- Description: Return the network value for an application's property
- Description: Return the port for a given app container
- Invoked by: `internally triggered by a deploy`
- Arguments: `$APP $KEY`
- Arguments: `$APP $PROC_TYPE $CONTAINER_ID $IS_HEROKUISH_CONTAINER`
- Example:
```shell
@@ -434,11 +397,11 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `network-get-port`
### `network-get-property`
- Description: Return the port for a given app container
- Description: Return the network value for an application's property
- Invoked by: `internally triggered by a deploy`
- Arguments: `$APP $PROC_TYPE $CONTAINER_ID $IS_HEROKUISH_CONTAINER`
- Arguments: `$APP $KEY`
- Example:
```shell
@@ -515,6 +478,36 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
nginx -t
```
### `post-app-clone`
- Description: Allows you to run commands after an application was cloned.
- Invoked by: `dokku apps:clone`
- Arguments: `$OLD_APP_NAME $NEW_APP_NAME`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `post-app-rename`
- Description: Allows you to run commands after an application was renamed.
- Invoked by: `dokku apps:rename`
- Arguments: `$OLD_APP_NAME $NEW_APP_NAME`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `post-build-buildpack`
- Description: Allows you to run commands after the build image is create for a given app. Only applies to applications using buildpacks.
@@ -579,6 +572,21 @@ APP="$1"; verify_app_name "$APP"
# TODO
```
### `post-config-update`
- Description: Allows you to get notified when one or more configs is added or removed. Action can be *set* or *unset*
- Invoked by: `dokku config:set`, `dokku config:unset`
- Arguments: `$APP` `set|unset` `key1=VALUE1 key2=VALUE2`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `post-create`
- Description: Can be used to run commands after an application is created.
@@ -834,6 +842,40 @@ docker commit $id $IMAGE > /dev/null
dokku_log_info1 "Building UI Complete"
```
### `pre-disable-vhost`
- Description: Allows you to run commands before the VHOST feature is disabled
- Invoked by: `dokku domains:disable`
- Arguments: `$APP`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
APP="$1"; verify_app_name "$APP"
# TODO
```
### `pre-enable-vhost`
- Description: Allows you to run commands before the VHOST feature is enabled
- Invoked by: `dokku domains:enable`
- Arguments: `$APP`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
APP="$1"; verify_app_name "$APP"
# TODO
```
### `pre-receive-app`
- Description: Allows you to customize the contents of an application directory before they are processed for deployment. The `IMAGE_SOURCE_TYPE` can be any of `[herokuish, dockerfile]`
@@ -898,40 +940,6 @@ verify_app_name "$APP"
# TODO
```
### `pre-disable-vhost`
- Description: Allows you to run commands before the VHOST feature is disabled
- Invoked by: `dokku domains:disable`
- Arguments: `$APP`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
APP="$1"; verify_app_name "$APP"
# TODO
```
### `pre-enable-vhost`
- Description: Allows you to run commands before the VHOST feature is enabled
- Invoked by: `dokku domains:enable`
- Arguments: `$APP`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
APP="$1"; verify_app_name "$APP"
# TODO
```
### `pre-start`
- Description: Can be used to run commands before an application is started

View File

@@ -0,0 +1 @@
hook

View File

@@ -0,0 +1 @@
hook

1
plugins/20_events/pre-start Symbolic link
View File

@@ -0,0 +1 @@
hook

View File

@@ -8,7 +8,7 @@ events_list_cmd() {
local PLUGIN_DIR="$(dirname "$0")/.."
if [[ "$DOKKU_EVENTS" ]]; then
local logged="$(find "$PLUGIN_DIR" -type l -printf '%f ' 2>/dev/null | sort)"
local logged="$(find "$PLUGIN_DIR" -type l -printf '%f\n' 2>/dev/null | sort -n)"
dokku_col_log_info2_quiet "Events currently logged"
local hook

1
plugins/20_events/uninstall Symbolic link
View File

@@ -0,0 +1 @@
hook