ci: 清理build_parent和build_sdk

This commit is contained in:
CaptainB 2022-10-26 15:09:19 +08:00 committed by 刘瑞斌
parent a3bc132838
commit a5d934949c
1 changed files with 15 additions and 0 deletions

15
Jenkinsfile vendored
View File

@ -139,6 +139,21 @@ pipeline {
post('Notification') { post('Notification') {
always { always {
sh "echo \$WEBHOOK\n" 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')]) { withCredentials([string(credentialsId: 'wechat-bot-webhook', variable: 'WEBHOOK')]) {
qyWechatNotification failNotify: true, mentionedId: '', mentionedMobile: '', webhookUrl: "$WEBHOOK" qyWechatNotification failNotify: true, mentionedId: '', mentionedMobile: '', webhookUrl: "$WEBHOOK"
} }