Notification For Job Failure including runner failure
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Hi Team !
I have a pipeline running in many projects, which has a crucial job say job B, i want a notification to be send to a team channel ( which I implemented using webhook), if that job fails, please note only if that job fails not the pipeline.
Scenario ->
take a pipeline with job A, B, C ...now if and only if B fails I want to send a notification via webhook, also job B is "allowed_failure" so failing of B wont fail my pipeline.
I can create a job D which depend on failure of B, but since i have kept allowed_failure this wont work, so instead creating a new job D , in Job B itself i created a after_script, which check job_status and if it fails, my webhook is triggered...till now I m happy
THE PROBLEM comes when there is scenario of runner failure..in that case my job B will fail, but after_script wont run, as it need runner...or a matter of fact whatever job i create to trigger webhook, it will need runner and in runner failure..i wont be able to hit/run the job.....then how can i send notification to team...in case of Job B failing when I job fails due to anything related to runner( again not pipeline failure but job failure)
Please guide/help.