whats-up-docker icon indicating copy to clipboard operation
whats-up-docker copied to clipboard

Possibility to use Lifecycle Hooks

Open t-pohl opened this issue 2 years ago • 5 comments

Hey there,

I'm wondering if it would be possible to have something like a lifecycle hook to call a script after a container was successfully updated (similar to watchtowers post-update hook). Background of this question is that I want to call a microservice with the new version such that I can built up for each container a version history which can be used for rollbacks later on.

t-pohl avatar Oct 07 '22 14:10 t-pohl

Hi @t-pohl

That's a great idea 👍 .

I don't know if it's better to add a hook system like Watchtower (running shell scripts) or if I enrich the wud trigger system by making possible to trigger on multiple events:

  • update-available (the only event currently triggered by wud)
  • update-pre
  • update-post 🤔

The advantage to integrate with the trigger system would be that you can leverage all the implemented triggers (http, mqtt...) (but I will also have to implement a command trigger to give the possibility to run arbitrary commands or scripts)

fmartinou avatar Oct 15 '22 17:10 fmartinou

Hi @fmartinou , it sounds to me more natural (and if done right more powerful) to extend the existing trigger system like you described :+1: So yeah feel free to treat this as a kind feature request :smile:

t-pohl avatar Oct 16 '22 07:10 t-pohl

Can you @fmartinou apply the "enhancement" label or should I be able to do that? Sorry for the basic question, I'm not using Github that much.

t-pohl avatar Oct 18 '22 07:10 t-pohl

Can you @fmartinou apply the "enhancement" label

Done :)

fmartinou avatar Oct 18 '22 10:10 fmartinou

I would also find this useful. I have a locally hosted image that is dependent on another image hosted on Docker Hub. My CI/CD pipeline does not have a way to monitor Docker Hub and build if the image on Docker Hub is updated. update-pre could allow me to execute a shell script to use my CI/CD pipeline cli to kick off a new build when the Docker Hub image is updated and then update the running container on completion.

samcro1967 avatar Jun 15 '23 13:06 samcro1967