【问题标题】:Jenkins Git Changelog on First Build首次构建时的 Jenkins Git 变更日志
【发布时间】: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
            }
        }
    }
} ```

【问题讨论】:

标签: git jenkins jenkins-pipeline jenkins-plugins


【解决方案1】:

不确定您使用的是哪个 git 插件,但我在使用 bitbucket 插件时遇到了同样的问题。将公关发现策略从Merging the pull request with the current target branch revision 更改为the current pull request revision 为我解决了这个问题。

【讨论】:

  • 我相信这是特定于 bitbucket 插件的。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多