1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00

change slack color to reflect all states (#2320)

I have used the colors from blue ocean.

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
This commit is contained in:
Gordon Franke 2020-11-05 14:16:00 +01:00 committed by GitHub
parent 9812391145
commit a19cbd63ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -493,7 +493,7 @@ steps:
dockerName: 'bundler'
dockerWorkspace: ''
slackSendNotification:
color: "${buildStatus == 'SUCCESS'?'#008000':'#E60000'}"
color: "${['SUCCESS': '#8cc04f', 'FAILURE': '#d54c53', 'ABORTED': '#949393', 'UNSTABLE': '#f6b44b', 'PAUSED': '#24b0d5', 'UNKNOWN': '#d54cc4'].get(buildStatus, '#d54cc4')}"
defaultMessage: "${buildStatus}: Job ${env.JOB_NAME} <${env.BUILD_URL}|#${env.BUILD_NUMBER}>"
snykExecute:
buildDescriptorFile: './package.json'

View File

@ -42,7 +42,7 @@ class SlackSendNotificationTest extends BasePiperTest {
// asserts
assertEquals('Message not set correctly', 'SUCCESS: Job p <http://build.url|#1>', slackCallMap.message.toString())
assertNull('Channel not set correctly', slackCallMap.channel)
assertEquals('Color not set correctly', '#008000', slackCallMap.color)
assertEquals('Color not set correctly', '#8cc04f', slackCallMap.color)
assertJobStatusSuccess()
}
@ -59,7 +59,7 @@ class SlackSendNotificationTest extends BasePiperTest {
stepRule.step.slackSendNotification(script: [currentBuild: [result: 'FAILURE']])
// asserts
assertEquals('Message not set correctly', 'FAILURE: Job p <http://build.url|#1>', slackCallMap.message.toString())
assertEquals('Color not set correctly', '#E60000', slackCallMap.color)
assertEquals('Color not set correctly', '#d54c53', slackCallMap.color)
}
@Test