This is an automated email from the ASF dual-hosted git repository. mattsicker pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit d9ba0597c9ce8caeecfca2359e893260bd30c72b Author: Matt Sicker <[email protected]> AuthorDate: Sun Apr 5 12:53:08 2020 -0500 Rearrange pipeline and improve emails --- Jenkinsfile | 117 +++++++++++++++++++++++++++++++----------------------------- 1 file changed, 61 insertions(+), 56 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 55968d3..1865de9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,79 +24,84 @@ pipeline { parallelsAlwaysFailFast() durabilityHint 'PERFORMANCE_OPTIMIZED' } - agent any + agent none stages { - stage('Build') { - parallel { - stage('Ubuntu') { - agent { label 'ubuntu' } - tools { - jdk 'JDK 1.8 (latest)' - maven 'Maven 3 (latest)' - } - environment { - LANG = 'en_US.UTF-8' - } - steps { - sh 'mvn -B -fae -t toolchains-jenkins-ubuntu.xml -Djenkins -V clean install deploy' - } - post { - success { - archiveArtifacts artifacts: '**/*.jar', fingerprint: true - } - always { - recordIssues enabledForFailure: true, sourceCodeEncoding: 'UTF-8', referenceJobName: 'log4j/master', - tool: taskScanner(highTags: 'FIXME', normalTags: 'TODO', includePattern: '**/*.java', excludePattern: '*/target/**') - junit '**/*-reports/*.xml' - } - } + parallel { + stage('Ubuntu') { + agent { label 'ubuntu' } + tools { + jdk 'JDK 1.8 (latest)' + maven 'Maven 3 (latest)' } - stage('Windows') { - agent { label 'Windows' } - tools { - jdk 'JDK 1.8 (latest)' - maven 'Maven 3 (latest)' - } - environment { - LANG = 'en_US.UTF-8' + environment { + LANG = 'en_US.UTF-8' + } + steps { + sh 'mvn -B -fae -t toolchains-jenkins-ubuntu.xml -Djenkins -V clean install deploy' + } + post { + success { + archiveArtifacts artifacts: '**/*.jar', fingerprint: true } - steps { - bat ''' - if exist %userprofile%\\.embedmongo\\ rd /s /q %userprofile%\\.embedmongo - mvn -B -fae -t toolchains-jenkins-win.xml -Dfile.encoding=UTF-8 -V clean install - ''' + always { + junit '**/*-reports/*.xml' + recordIssues enabledForFailure: true, + sourceCodeEncoding: 'UTF-8', + referenceJobName: 'log4j/master', + tools: [mavenConsole(), errorProne(), java(), + taskScanner(highTags: 'FIXME', normalTags: 'TODO', includePattern: '**/*.java', excludePattern: '*/target/**')] } - post { - always { - junit '**/*-reports/*.xml' - } + } + } + stage('Windows') { + agent { label 'Windows' } + tools { + jdk 'JDK 1.8 (latest)' + maven 'Maven 3 (latest)' + } + environment { + LANG = 'en_US.UTF-8' + } + steps { + bat ''' + if exist %userprofile%\\.embedmongo\\ rd /s /q %userprofile%\\.embedmongo + mvn -B -fae -t toolchains-jenkins-win.xml -Dfile.encoding=UTF-8 -V clean install + ''' + } + post { + always { + junit '**/*-reports/*.xml' } } } } } post { - success { - recordIssues sourceCodeEncoding: 'UTF-8', - referenceJobName: 'log4j/master', - tools: [mavenConsole(), errorProne(), java()] - } fixed { slackSend channel: 'logging', color: 'good', - iconEmoji: 'male_mage', - message: "Build back to normal: <${env.BUILD_URL}|${env.BUILD_DISPLAY_NAME}>." + message: ":excellent: <${env.JOB_URL|${env.JOB_NAME}> was fixed in <${env.BUILD_URL}|build #${env.BUILD_NUMBER}>." mail to: '[email protected]', - subject: "Jenkins build of ${env.JOB_NAME} (${env.BUILD_NUMBER}) back to normal", - body: "See ${env.BUILD_URL} for more details." + from: 'Mr. Jenkins <[email protected]>', + subject: "Jenkins job ${env.JOB_NAME}#${env.BUILD_NUMBER} back to normal", + body: """ +The build for ${env.JOB_NAME} completed successfully and is back to normal. + +Build: ${env.BUILD_URL} +Logs: ${env.BUILD_URL}console +Changes: ${env.BUILD_URL}changes +-- +Mr. Jenkins +Director of Continuous Integration +""" } failure { slackSend channel: 'logging', color: 'danger', - iconEmoji: 'face_palm', - message: "Build failed: <${env.BUILD_URL}|${env.BUILD_DISPLAY_NAME}>." + message: ":doh: <${env.JOB_URL}|${env.JOB_NAME}> failed in <${env.BUILD_URL}|build #${env.BUILD_NUMBER}>." mail to: '[email protected]', - subject: "Build failure in Jenkins build of ${env.JOB_NAME} (${env.BUILD_NUMBER})", + from: 'Mr. Jenkins <[email protected]>', + subject: "Jenkins job ${env.JOB_NAME}#${env.BUILD_NUMBER} failed", body: """ There is a build failure in ${env.JOB_NAME}. @@ -106,13 +111,13 @@ Changes: ${env.BUILD_URL}changes -- Mr. Jenkins +Director of Continuous Integration """ } unstable { slackSend channel: 'logging', color: 'warning', - iconEmoji: 'juggling', - message: "Build unstable: ${env.BUILD_URL}" + message: ":disappear: <${env.JOB_URL}|${env.JOB_NAME}> is unstable in <${env.BUILD_URL}|build #${env.BUILD_NUMBER}>." } } }
