mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-13 13:46:38 +01:00
Pre-update lifecycle hook (#793)
* Make watchtower skip update if pre-update lifecycle hook exits with a non-zero exit code #649 * Make watchtower skip update if pre-update lifecycle hook exits with a non-zero exit code #649 * Make watchtower skip update if pre-update lifecycle hook exits with a non-zero exit code #649 * Make watchtower skip update if pre-update lifecycle hook exits with a non-zero exit code #649 * Make watchtower skip update if pre-update lifecycle hook exits with a non-zero exit code #649 * Make watchtower skip update if pre-update lifecycle hook exits with a non-zero exit code #649 * Make watchtower skip update if pre-update lifecycle hook exits with a non-zero exit code #649 * Prevent starting new container if old one is not stopped because of lifecycle hook. * Add null check for c.containerInfo.State in IsRunning * Fixed that the container would not start * Added test for preupdate * EX_TEMPFAIL -> ExTempFail * Added missing fuction ouput names * Skip preupdate when container is restarting.
This commit is contained in:
parent
dc12a1ac7f
commit
145fe6dbcb
8 changed files with 281 additions and 39 deletions
|
|
@ -4,6 +4,9 @@
|
|||
These are shell commands executed with `sh`, and therefore require the container to provide the `sh`
|
||||
executable.
|
||||
|
||||
> **DO NOTE**: If the container is not running then lifecycle hooks can not run and therefore
|
||||
> the update is executed without running any lifecycle hooks.
|
||||
|
||||
It is possible to execute _pre/post\-check_ and _pre/post\-update_ commands
|
||||
**inside** every container updated by watchtower.
|
||||
|
||||
|
|
@ -63,5 +66,5 @@ If the label value is explicitly set to `0`, the timeout will be disabled.
|
|||
### Execution failure
|
||||
|
||||
The failure of a command to execute, identified by an exit code different than
|
||||
0, will not prevent watchtower from updating the container. Only an error
|
||||
0 or 75 (EX_TEMPFAIL), will not prevent watchtower from updating the container. Only an error
|
||||
log statement containing the exit code will be reported.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue