I would like to setup a conditional deploy on some containers.
Eg. a container is provided with a label pointing to a script:
com.centurylinklabs.watchtower.condition=allow_docker_update.sh
If the script has exist status 0 watchtower will not upgrade it and retry upgrade on the next schedule, if status 1, container will be stopped and upgraded.
Hi there! 馃憢馃徏 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 馃檹
It should be possible to do this using the pre-update lifecycle hook, given that watchtower can read the exit status of the script.
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 log statement containing the exit code will be reported.
I would like to cancel update process if script fails.
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 log statement containing the exit code will be reported.
I would like to cancel update process if script fails.
Also interested in this 馃憜
@agilob
I would like to cancel update process if script fails.
If a pre-update lifecycle hook exits with a code other than 0, that container will be skipped. Give it a try and let us know if it satisfies your use case 馃憤
Apparently this is not in the docs though... I'll check to make sure it's included in the currently released version of watchtower.
Unfortunately, this has not been released yet. It will be included in the next release of watchtower.
Closing this as the pre-update timeout changes are now live:
To avoid important communication to get lost in a closed issues no one monitors, I'll go ahead and lock this issue. If you want to continue the discussion, please open a new issue. Thank you! 馃檹馃徏
Most helpful comment
I would like to cancel update process if script fails.