Allow skip with [ci skip] marker in tag message

This commit is contained in:
wpetit 2020-03-19 17:01:08 +01:00
parent 297ead2d7e
commit 0bef6cf450
1 changed files with 20 additions and 0 deletions

View File

@ -46,6 +46,26 @@ pipeline {
}
}
stage("Check [ci skip] in tag message") {
steps {
script {
dir(env.projectDir) {
sh 'git checkout "${packageBranch}"'
def commitTags = sh(script: 'git describe --exact-match --abbrev=0', returnStdout: true).split(' ')
for (tag in commitTags) {
tag = tag.trim()
def tagMessage = sh(script: "git tag --format='%(subject)' -l '${tag}'", returnStdout: true).trim()
println("Tag '${tag}' message is: '${tagMessage}'")
if (tagMessage.contains('[ci skip]')) {
currentBuild.result = 'ABORTED'
error("Le message du tag '${tag}' contient le marqueur '[ci-skip]' !")
}
}
}
}
}
}
stage("Checkout ref") {
steps {
dir(env.projectDir) {