Modern systems and jobs are complex, and jobs can fail due to various system reasons. However, it's a bit noisy to get a failure notification every time a job can be retried. This tool ignores the job being retried and only notifies you when certain conditions are met.
The conditions for notification are
- More than n consecutive errors occur in a specific job.
- There is no job running even if n hours have passed since the failed build of the specific job.
go get github.com/bootjp/jenkins_consecutive_fail_detector
curl -LO https://github.com/bootjp/jenkins_consecutive_fail_detector/releases/latest/download/jenkins_consecutive_fail_detector-linux-amd64
chmod +x jenkins_consecutive_fail_detector-linux-amd64
JENKINS_USER="login_user" JENKINS_TOKEN="secret_token" jenkins_consecutive_fail_detector -url https://example.com:8080/jenkins
# or
JENKINS_USER="login_user" JENKINS_PASSWORD="login_password" jenkins_consecutive_fail_detector -url https://example.com:8080/jenkins
- Add environment value
SLACK_WEBHOOK
are enable slack webhook. - Add environment value
SLACK_USERNAME
modify notify slack username. - Add environment value
SLACK_CHANNNEL
modify notify slack channel.