mirror of
https://github.com/dokku/dokku.git
synced 2026-02-23 19:50:34 +01:00
log when killing old app container(s) fails
This commit is contained in:
@@ -664,3 +664,19 @@ APP="$1"; IMAGE_TAG="$2"
|
||||
|
||||
some code to remove a docker hub tag because it's not implemented in the CLI....
|
||||
```
|
||||
|
||||
### `retire-container-failed`
|
||||
|
||||
- Description: Allows you to run commands if/when retiring old containers has failed
|
||||
- Invoked by: `dokku deploy`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
APP="$1"; HOSTNAME=$(hostname -s)
|
||||
|
||||
mail -s "$APP containers on $HOSTNAME failed to retire" ops@co.com
|
||||
```
|
||||
|
||||
2
dokku
2
dokku
@@ -186,7 +186,7 @@ case "$1" in
|
||||
# on to the next.
|
||||
docker stop $oldid \
|
||||
|| docker kill $oldid \
|
||||
|| : # Always continue in case we have multiple to kill
|
||||
|| pluginhook retire-container-failed $APP # Trigger pluginhook for event logging
|
||||
done
|
||||
) & disown -a
|
||||
# Use trap since disown/nohup don't seem to keep child alive
|
||||
|
||||
1
plugins/20_events/retire-container-failed
Symbolic link
1
plugins/20_events/retire-container-failed
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
Reference in New Issue
Block a user