diff --git a/Jenkinsfile b/Jenkinsfile index 037236d302..f30a41b182 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -139,9 +139,12 @@ pipeline { post('Notification') { always { sh "echo \$WEBHOOK\n" + withCredentials([string(credentialsId: 'wechat-bot-webhook', variable: 'WEBHOOK')]) { + qyWechatNotification failNotify: true, mentionedId: '', mentionedMobile: '', webhookUrl: "$WEBHOOK" + } script { try { - if ("$BUILD_PARENT".equals("true") || "$BUILD_SDK".equals("true")) { + if (env.BUILD_PARENT || env.BUILD_SDK) { println "JOB_NAME=$JOB_NAME, BUILD_NUMBER=$BUILD_NUMBER, BUILD_URL=$BUILD_URL" Hudson.instance.getItemByFullName("$JOB_NAME").builds.each { if(it.number == Integer.parseInt("$BUILD_NUMBER")) { @@ -154,9 +157,6 @@ pipeline { } catch (NoSuchElementException) { } } - withCredentials([string(credentialsId: 'wechat-bot-webhook', variable: 'WEBHOOK')]) { - qyWechatNotification failNotify: true, mentionedId: '', mentionedMobile: '', webhookUrl: "$WEBHOOK" - } } } }