diff --git a/Jenkinsfile b/Jenkinsfile index 38814362a8001c46cf54342b932346dadf8a486b..c3e99d842eeb80a19a538f57cbfc1f72a4d7391a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,6 +7,10 @@ pipeline { } } + environment { + BLUE_OCEAN_URL = "https://jenkins.ozg-sh.de/blue/organizations/jenkins/goofy/detail/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/pipeline" + } + options { timeout(time: 1, unit: 'HOURS') disableConcurrentBuilds() @@ -34,16 +38,16 @@ pipeline { sh 'npm run ci-build' } -// sh 'npm run ci-test' + // sh 'npm run ci-test' } } } } - // post { - // always{ - // junit testResults: 'goofy-client/test-report.xml', skipPublishingChecks: true - // } - // } + // post { + // always{ + // junit testResults: 'goofy-client/test-report.xml', skipPublishingChecks: true + // } + // } } stage('Server') { @@ -155,6 +159,9 @@ pipeline { } steps { + script { + FAILED_STAGE = env.STAGE_NAME + } container("docker") { script { withCredentials([usernamePassword(credentialsId: 'jenkins-docker-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) { @@ -189,4 +196,13 @@ pipeline { } } } + post { + failure { + script { + if (env.BRANCH_NAME == 'master') { + slackSend(color: "danger", message: "Goofy: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <${BLUE_OCEAN_URL}|${env.BUILD_NUMBER}>") + } + } + } + } } \ No newline at end of file