【问题标题】:Triggering a multibranch pipeline job from github enterprise webhook从 github 企业 webhook 触发多分支管道作业
【发布时间】:2020-02-29 22:11:13
【问题描述】:

我正在尝试从 GitHub 企业服务器触发多分支管道作业。我已将 webhook 配置为发送有关所有事件的通知。 github 企业的事件日志显示对 Jenkins 的请求是成功的,但是在多分支管道上,事件日志是空的。

我的多分支管道作业正在使用 JobDSL 创建,如下所示:

    multibranchPipelineJob("build_${repo}") {
        branchSources {
            branchSource {
                source {
                    git {
                      id("${org}.${repo}")
                      remote("git@${githubEntrerpise}:${org}/${repo}")
                    }
                }
            }
        }
        configure {
            def traits = it / sources / data / 'jenkins.branch.BranchSource' / source / traits
            traits << 'jenkins.plugins.git.traits.BranchDiscoveryTrait' {}
        }
        triggers {
            periodic(1) // Trigger every min.
        }
        orphanedItemStrategy { discardOldItems { numToKeep(10) } }
    }

这里有什么我遗漏的吗?

【问题讨论】:

    标签: jenkins github jenkins-pipeline jenkins-job-dsl


    【解决方案1】:

    我通过更改我正在使用的 webhook 端点解决了这个问题。 将其更改为以下格式解决了问题http://[JENINS_HOST]/git/notifyCommit?url=git@[GIT_REPO].git

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多