Merge pull request #1610 from kdomanski/post-stop
Add post-stop plugn trigger
This commit is contained in:
commit
b3f44e3f96
2 files changed
+19
No files matched your search
@@ -437,6 +437,24 @@ APP="$1";
|
|||||||
dokku postgres:destroy $APP
|
dokku postgres:destroy $APP
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `post-stop`
|
||||||
|
|
||||||
|
- Description: Can be used to run commands after an application is manually stopped
|
||||||
|
- Invoked by: `dokku ps:stop`
|
||||||
|
- Arguments: `$APP`
|
||||||
|
- Example:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# Marks an application as manually stopped
|
||||||
|
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
|
APP="$1";
|
||||||
|
|
||||||
|
dokku config:set --no-restart $APP MANUALLY_STOPPED=1
|
||||||
|
```
|
||||||
|
|
||||||
### `docker-args-build`
|
### `docker-args-build`
|
||||||
|
|
||||||
- Description:
|
- Description:
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ case "$1" in
|
|||||||
if [[ -n "$DOKKU_APP_RUNNING_CONTAINER_IDS" ]]; then
|
if [[ -n "$DOKKU_APP_RUNNING_CONTAINER_IDS" ]]; then
|
||||||
echo "Stopping $APP ..."
|
echo "Stopping $APP ..."
|
||||||
docker stop $DOKKU_APP_RUNNING_CONTAINER_IDS > /dev/null || true
|
docker stop $DOKKU_APP_RUNNING_CONTAINER_IDS > /dev/null || true
|
||||||
|
plugn trigger post-stop $APP
|
||||||
else
|
else
|
||||||
echo "App $APP already stopped"
|
echo "App $APP already stopped"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in new issue
Block a user