post-fail hook #3095
Replies: 2 comments
-
|
Hello,
Thank you ❤️ could you explain what is the goal of a post-fail hook? I mean what to do want to automate in case of error only? From me, the main usage of hooks is something like that:
Note that lego is not reacting to exit codes (this is not a shell script). |
Beta Was this translation helpful? Give feedback.
-
|
I guess I was looking to be notified if something had gone wrong in the program itself (and sending the exit code to me automatically.) I know this can be accomplished using cron anyhow and simple bash. That and monitoring the cert expiration should notify me. I think my mind immediately went to something like restic where I can get a notification on fail with an included exit code so I can go fix it up before it becomes a problem. Perhaps I thought too much (or not enough) and didn't think to just use the simpler tools I've already got. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Looking at the new hooks (and v5 is great, thank you guys), why is there no post-fail hook?
Seems:
To me it makes more sense to split post into post-success and post-fail. Post-success triggers on exit 0 and post-fail triggers on anything other than exit 0 with some preconfigured (and passed) env var to the post-fail hook.
I understand you could do something akin to using pre and post together (a pre without a post notifies you something is wrong) but still seems a bit hacky instead of two clearly defined post hooks. You could argue post-success might be unnecessary with the deploy hook but I guess it would notify in case of successful run even if a cert is not renewed.
Beta Was this translation helpful? Give feedback.
All reactions