mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 16:28:56 +00:00
Merge pull request #1207 from eclipse/np_issue1515
[eclipse/xtext#1515] fine-tune when slack gets notified
This commit is contained in:
commit
8af91f4319
1 changed files with 18 additions and 8 deletions
|
@ -114,7 +114,7 @@ spec:
|
|||
}
|
||||
}
|
||||
}
|
||||
changed {
|
||||
cleanup {
|
||||
script {
|
||||
def envName = ''
|
||||
if (env.JENKINS_URL.contains('ci.eclipse.org/xtext')) {
|
||||
|
@ -123,19 +123,29 @@ spec:
|
|||
envName = ' (JIRO)'
|
||||
}
|
||||
|
||||
def curResult = currentBuild.currentResult
|
||||
def sendNotification = true
|
||||
def color = '#00FF00'
|
||||
if (curResult == 'SUCCESS') {
|
||||
if (currentBuild.previousBuild != null && currentBuild.previousBuild.result != 'SUCCESS') {
|
||||
curResult = 'FIXED'
|
||||
}
|
||||
def curResult = currentBuild.currentResult
|
||||
def lastResult = 'NONE'
|
||||
if (currentBuild.previousBuild != null) {
|
||||
lastResult = currentBuild.previousBuild.result
|
||||
}
|
||||
if (lastResult == 'NONE') {
|
||||
curResult = "NEW: ${curResult}"
|
||||
} else if (curResult == 'SUCCESS' && lastResult == 'SUCCESS') {
|
||||
sendNotification = false
|
||||
} else if (curResult == 'SUCCESS' && lastResult != 'SUCCESS') {
|
||||
curResult = 'FIXED'
|
||||
} else if (curResult == 'UNSTABLE') {
|
||||
curResult = 'STILL FAILING (UNSTABLE)'
|
||||
color = '#FFFF00'
|
||||
} else { // FAILURE, ABORTED, NOT_BUILD
|
||||
curResult = 'STILL FAILING'
|
||||
color = '#FF0000'
|
||||
}
|
||||
|
||||
slackSend message: "${curResult}: <${env.BUILD_URL}|${env.JOB_NAME}#${env.BUILD_NUMBER}${envName}>", botUser: true, channel: 'xtext-builds', color: "${color}"
|
||||
if (sendNotification) {
|
||||
slackSend message: "${curResult}: <${env.BUILD_URL}|${env.JOB_NAME}#${env.BUILD_NUMBER}${envName}>", botUser: true, channel: 'xtext-builds', color: "${color}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue