Merge pull request #3017 from dokku/2713-pre-start-trigger
feat: add pre-start trigger for notifying on application start
This commit is contained in:
@@ -932,6 +932,24 @@ APP="$1"; verify_app_name "$APP"
|
|||||||
# TODO
|
# TODO
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `pre-start`
|
||||||
|
|
||||||
|
- Description: Can be used to run commands before an application is started
|
||||||
|
- Invoked by: `dokku ps:start`
|
||||||
|
- Arguments: `$APP`
|
||||||
|
- Example:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# Notifies an example url that an application is starting
|
||||||
|
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
|
APP="$1";
|
||||||
|
|
||||||
|
curl "https://example.com/starting/${APP}" || true
|
||||||
|
```
|
||||||
|
|
||||||
### `proxy-build-config`
|
### `proxy-build-config`
|
||||||
|
|
||||||
- Description: Builds the proxy implementation configuration for a given app
|
- Description: Builds the proxy implementation configuration for a given app
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ ps_start() {
|
|||||||
local IMAGE_TAG=$(get_running_image_tag "$APP");
|
local IMAGE_TAG=$(get_running_image_tag "$APP");
|
||||||
|
|
||||||
if (is_deployed "$APP"); then
|
if (is_deployed "$APP"); then
|
||||||
|
plugn trigger pre-start "$APP"
|
||||||
if ! (is_app_running "$APP"); then
|
if ! (is_app_running "$APP"); then
|
||||||
release_and_deploy "$APP" "$IMAGE_TAG"
|
release_and_deploy "$APP" "$IMAGE_TAG"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user