Ben aynı sorunu vardı ile kaydedilmesini görmezden böyle yapar. Boru hatları kullanıyorum. Bu sorunu bir shared library uygulayarak çözdüm. Benim Jenkinsfile içinde, Sonra
// vars/ciSkip.groovy
def call(Map args) {
if (args.action == 'check') {
return check()
}
if (args.action == 'postProcess') {
return postProcess()
}
error 'ciSkip has been called without valid arguments'
}
def check() {
env.CI_SKIP = "false"
result = sh (script: "git log -1 | grep '.*\\[ci skip\\].*'", returnStatus: true)
if (result == 0) {
env.CI_SKIP = "true"
error "'[ci skip]' found in git commit message. Aborting."
}
}
def postProcess() {
if (env.CI_SKIP == "true") {
currentBuild.result = 'NOT_BUILT'
}
}
:
kütüphanenin kod şudur
pipeline {
stages {
stage('prepare') { steps { ciSkip action: 'check' } }
// other stages here ...
}
post { always { ciSkip action: 'postProcess' } }
}
Gördüğünüz gibi, inşa NOT_BUILT
olarak işaretlenir. İsterseniz, ABORTED
olarak değiştirebilir, ancak a build result can only get worse
"git log -1" ayarını yapıp ilgili metni grep olarak ayarlayamazsınız,
SUCCESS
olarak ayarlanamaz. – Amityo@Amityo: Gerçekten çok yardımcı oldu. İleti [ci skip] içerik içeriyorsa jenkinsfile'da jenkins oluşturulmasını nasıl önleyebilirim? –