mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 04:25:42 +08:00
[Jenkinsfile] Added an emoji in slack notification message.
This commit is contained in:
7
Jenkinsfile
vendored
7
Jenkinsfile
vendored
@@ -360,6 +360,7 @@ def notifySlack(nodeName, buildStatus = 'STARTED') {
|
|||||||
|
|
||||||
// Default values
|
// Default values
|
||||||
def colorCode = '#FF0000'
|
def colorCode = '#FF0000'
|
||||||
|
def emoji = ':question:'
|
||||||
def duration = currentBuild.durationString.replace(' and counting', '')
|
def duration = currentBuild.durationString.replace(' and counting', '')
|
||||||
def title = "${java.net.URLDecoder.decode(JOB_NAME)} (`${BRANCH_NAME}`)"
|
def title = "${java.net.URLDecoder.decode(JOB_NAME)} (`${BRANCH_NAME}`)"
|
||||||
if (params.REVISION_ID != null) {
|
if (params.REVISION_ID != null) {
|
||||||
@@ -372,19 +373,23 @@ def notifySlack(nodeName, buildStatus = 'STARTED') {
|
|||||||
if (buildStatus == 'STARTED') {
|
if (buildStatus == 'STARTED') {
|
||||||
// yellow
|
// yellow
|
||||||
colorCode = '#FFFF00'
|
colorCode = '#FFFF00'
|
||||||
|
emoji = ':heavy_plus_sign:'
|
||||||
} else if (buildStatus == 'SUCCESS') {
|
} else if (buildStatus == 'SUCCESS') {
|
||||||
// green
|
// green
|
||||||
colorCode = '#008000'
|
colorCode = '#008000'
|
||||||
|
emoji = ':heavy_check_mark:'
|
||||||
} else if (buildStatus == 'ABORTED') {
|
} else if (buildStatus == 'ABORTED') {
|
||||||
// grey
|
// grey
|
||||||
colorCode = '#808080'
|
colorCode = '#808080'
|
||||||
|
emoji = ':grey_question:'
|
||||||
} else {
|
} else {
|
||||||
// darkred
|
// darkred
|
||||||
colorCode = '#8B0000'
|
colorCode = '#8B0000'
|
||||||
|
emoji = ':x:'
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send notifications - disable during testing
|
// Send notifications - disable during testing
|
||||||
slackSend (color: colorCode, message: summary)
|
slackSend (color: colorCode, message: "${emoji} ${summary}")
|
||||||
}
|
}
|
||||||
|
|
||||||
def getEolInMonth() {
|
def getEolInMonth() {
|
||||||
|
|||||||
Reference in New Issue
Block a user