diff --git a/Jenkinsfile b/Jenkinsfile index 2654006eaa..1d65c2eee9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -139,6 +139,21 @@ pipeline { post('Notification') { always { sh "echo \$WEBHOOK\n" + script { + try { + if ($BUILD_PARENT || $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")) { + println 'Deleting build number ' + it.number + it.delete() + break; + } + } + } + } catch (NoSuchElementException) { + } + } withCredentials([string(credentialsId: 'wechat-bot-webhook', variable: 'WEBHOOK')]) { qyWechatNotification failNotify: true, mentionedId: '', mentionedMobile: '', webhookUrl: "$WEBHOOK" }