【发布时间】:2020-02-05 22:20:05
【问题描述】:
我有一个 jenkins 管道,可以根据对特定文件夹的更改触发下游作业。首次构建不会触发下游作业。 Jenkins 日志显示:Warning, empty changelog. Probably because this is the first build.。如何使管道在首次构建时触发下游作业?这是詹金斯文件
agent { label 'slave-02'}
options {
skipDefaultCheckout true }
stages {
stage('checkoutscm') {
steps {
checkout([$class: 'GitSCM', branches: [[name: "${BRANCH_NAME}"]], doGenerateSubmoduleConfigurations: false, submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'xxxxx', url: 'https://git.xxxx.com/xxx/xxx.git']]])
}
}
stage('DeployRelease') {
when {
anyOf {
changeset "scripts/**"
changeset "config/**"
}
}
steps {
build job: "/DEVOPS_DUMMY/${BRANCH_NAME}", wait: false
}
}
stage('DDLDelivery') {
when {
changeset "DDL/**"
}
steps {
build job: "/PROD/${BRANCH_NAME}", wait: false
}
}
}
} ```
【问题讨论】:
-
第一次构建有哪些变化?
-
相关stackoverflow.com/questions/54151175 - @YuriG。没关系。 Jenkins 在第一次构建管道时有一个空的变更日志。 Jenkins 2.204.3 打印出
Warning, empty changelog. Probably because this is the first build.issues.jenkins-ci.org/browse/JENKINS-4162
标签: git jenkins jenkins-pipeline jenkins-plugins