build: Jenkinsfile 通知使用 post

This commit is contained in:
BugKing 2020-12-21 14:06:32 +08:00
parent 3802dfc7fe
commit 1665e3a97d
1 changed files with 6 additions and 5 deletions

11
Jenkinsfile vendored
View File

@ -24,11 +24,12 @@ pipeline {
sh "docker push ${IMAGE_FREFIX}/${IMAGE_NAME}:\${TAG_NAME:-\$BRANCH_NAME}"
}
}
stage('Notification') {
steps {
withCredentials([string(credentialsId: 'wechat-bot-webhook', variable: 'WEBHOOK')]) {
qyWechatNotification failSend: true, mentionedId: '', mentionedMobile: '', webhookUrl: '${WEBHOOK}'
}
}
post('Notification') {
always {
sh "echo \$WEBHOOK\n"
withCredentials([string(credentialsId: 'wechat-bot-webhook', variable: 'WEBHOOK')]) {
qyWechatNotification failSend: true, mentionedId: '', mentionedMobile: '', webhookUrl: "$WEBHOOK"
}
}
}