|
|
@ -18,6 +18,7 @@ if (env.BRANCH_NAME == "master") { |
|
|
|
]) |
|
|
|
]) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
stage('Pantheon tests') { |
|
|
|
stage('Pantheon tests') { |
|
|
|
parallel javaTests: { |
|
|
|
parallel javaTests: { |
|
|
|
node { |
|
|
|
node { |
|
|
@ -86,21 +87,32 @@ stage('Pantheon tests') { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
currentBuild.result = 'FAILURE' |
|
|
|
|
|
|
|
} finally { |
|
|
|
// If we're on master and it failed, notify slack |
|
|
|
// If we're on master and it failed, notify slack |
|
|
|
if (env.BRANCH_NAME == "master") { |
|
|
|
if (env.BRANCH_NAME == "master") { |
|
|
|
if (currentBuild.result != 'SUCCESSFUL') { |
|
|
|
def currentResult = currentBuild.result ?: 'SUCCESS' |
|
|
|
def channel = '#priv-pegasys-prod-dev' |
|
|
|
def channel = '#priv-pegasys-prod-dev' |
|
|
|
if (currentBuild.result == 'FAILURE') { |
|
|
|
if (currentResult == 'SUCCESS') { |
|
|
|
|
|
|
|
def previousResult = currentBuild.previousBuild?.result |
|
|
|
|
|
|
|
if (previousResult != null && (previousResult == 'FAILURE' || previousResult == 'UNSTABLE')) { |
|
|
|
|
|
|
|
slackSend( |
|
|
|
|
|
|
|
color: 'good', |
|
|
|
|
|
|
|
message: "Pantheon branch ${env.BRANCH_NAME} build is back to HEALTHY.\nBuild Number: #${env.BUILD_NUMBER}\n${env.BUILD_URL}", |
|
|
|
|
|
|
|
channel: channel |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else if (currentBuild.result == 'FAILURE') { |
|
|
|
slackSend( |
|
|
|
slackSend( |
|
|
|
color: 'danger', |
|
|
|
color: 'danger', |
|
|
|
msg: "Pantheon master branch build is FAILING.\nBuild Number: #${env.BUILD_NUMBER}\n${env.BUILD_URL}", |
|
|
|
message: "Pantheon branch ${env.BRANCH_NAME} build is FAILING.\nBuild Number: #${env.BUILD_NUMBER}\n${env.BUILD_URL}", |
|
|
|
channel: channel |
|
|
|
channel: channel |
|
|
|
) |
|
|
|
) |
|
|
|
} else if (currentBuild.result == 'UNSTABLE') { |
|
|
|
} else if (currentBuild.result == 'UNSTABLE') { |
|
|
|
slackSend( |
|
|
|
slackSend( |
|
|
|
color: 'warning', |
|
|
|
color: 'warning', |
|
|
|
msg: "Pantheon master branch build is UNSTABLE.\nBuild Number: #${env.BUILD_NUMBER}\n${env.BUILD_URL}", |
|
|
|
message: "Pantheon branch ${env.BRANCH_NAME} build is UNSTABLE.\nBuild Number: #${env.BUILD_NUMBER}\n${env.BUILD_URL}", |
|
|
|
channel: channel |
|
|
|
channel: channel |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|