Skip to content

Commit 18f0346

Browse files
authored
Teams instead of Slack
1 parent 5614eb6 commit 18f0346

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Jenkinsfile.examples

+6-5
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,18 @@ node {
2222
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -e VERSION=${PUBLISHED_VERSION} -v ${SOURCEDIR}:/source ${TEST_CONTAINER}"
2323
}
2424
}
25-
slack(true)
25+
postToTeams(true)
2626
} catch (e) {
2727
currentBuild.result = "FAILED"
28-
slack(false)
28+
postToTeams(false)
2929
throw e
3030
}
3131
}
3232

33-
def slack(boolean success) {
33+
def postToTeams(boolean success) {
34+
def webhookUrl = "${env.TEAMS_PNC_JENKINS_WEBHOOK_URL}"
3435
def color = success ? "#00FF00" : "#FF0000"
3536
def status = success ? "SUCCESSFUL" : "FAILED"
36-
def message = status + ": Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})"
37-
slackSend(color: color, channel: "#p-n-c_jenkins", message: message)
37+
def message = "*" + status + ":* '${env.JOB_NAME}' - [${env.BUILD_NUMBER}] - ${env.BUILD_URL}"
38+
office365ConnectorSend(webhookUrl: webhookUrl, color: color, message: message, status: status)
3839
}

0 commit comments

Comments
 (0)