How do you notify Slack or email from Jenkins?
BeginnerConceptIntegrations: SonarQube, Nexus, Artifactory, Docker, Trivy
Answer
post {
failure { slackSend channel: '#ci-alerts', color: 'danger', message: "FAILED ${env.JOB_NAME} #${env.BUILD_NUMBER} ${env.BUILD_URL}" }
fixed { slackSend channel: '#ci-alerts', color: 'good', message: "FIXED ${env.JOB_NAME}" }
unsuccessful { emailext to: '$DEFAULT_RECIPIENTS', subject: '$PROJECT_NAME - $BUILD_STATUS', body: '${BUILD_URL}', recipientProviders: [culprits(), requestor()] }
}
Notify on failure and fixed, not on every success, or people mute the channel.
More on Integrations: SonarQube, Nexus, Artifactory, Docker, Trivy
How do you integrate SonarQube with a Jenkins pipeline?IntermediateHow does `waitForQualityGate` work?IntermediateHow do you deploy Maven artifacts to Nexus from Jenkins?IntermediateHow do you publish npm packages or pull dependencies through Nexus or Artifactory?BeginnerHow do you use JFrog Artifactory from Jenkins?IntermediateHow do you build and push a Docker image from Jenkins on a VM agent?Beginner