project-everest / everest-ci

CI scripts for project everest
3 stars 8 forks source link

Trap on error #1

Closed msprotz closed 7 years ago

msprotz commented 7 years ago

Description: when the script exits prematurely, one last attempt to notify slack should be made.

darrenge commented 7 years ago

Is there anything specific that you would want or not want in the slack notification when an error / exit occurs?

msprotz commented 7 years ago

I think just sending something like "The ci script exited abnormally; error codes: ${PIPESTATUS[@]}" would be totally sufficient. This an exceptional condition, which means that one of us would have to look at the VSTS logs anyhow.

darrenge commented 7 years ago

How about who slack message goes to? Do the same logic as logging that checks channel if c or a direct message is slackid?

The problem with that logic is that we might not have that info when the script crashes.

msprotz commented 7 years ago

No logic in a trap handler -- just a simple one-liner should suffice. We just need a infaillible notification to go out. The notification should go somewhere, I suggest #everest-build

darrenge commented 7 years ago

Oh good ... this got easier. :)

msprotz commented 7 years ago

Fixed by @darrenge in fab785a