Interview Prep/Jenkins/Integrations: SonarQube, Nexus, Artifactory, Docker, Trivy

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.

All Jenkins questions Roadmap: Jenkins

More on Integrations: SonarQube, Nexus, Artifactory, Docker, Trivy