mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
[Jenkinsfile] Post comment on Differential revision when build finishes.
This commit is contained in:
12
Jenkinsfile
vendored
12
Jenkinsfile
vendored
@@ -334,6 +334,18 @@ def notifyHarbormaster() {
|
||||
def type = currentBuild.resultIsBetterOrEqualTo('SUCCESS') ? 'pass' : 'fail'
|
||||
def json = """{ "buildTargetPHID": "${params.PHID}", "type": "${type}" }"""
|
||||
sh "echo '${json}' | ${arcCmd} harbormaster.sendmessage"
|
||||
|
||||
def icon = '{icon question-circle color=orange}'
|
||||
if (currentBuild.result == 'SUCCESS') {
|
||||
icon = '{icon check color=green}'
|
||||
} else if (currentBuild.result == 'FAILURE') {
|
||||
icon = '{icon times color=red}'
|
||||
} else if (currentBuild.result == 'UNSTABLE') {
|
||||
icon = '{icon exclamation-triangle color=orange}'
|
||||
}
|
||||
def comment = "${icon} {${params.PHID}} ${currentBuild.currentResult}: ${env.BUILD_URL}"
|
||||
json = """{ "objectIdentifier": "D${params.REVISION_ID}", "transactions": [{ "type": "comment", "value": "${comment}" }] }"""
|
||||
sh "echo '${json}' | ${arcCmd} differential.revision.edit"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user