在 Github 推送上触发工作流 - 管道插件 - 多分支配置 [英] Trigger workflow on Github push - Pipeline plugin - Multibranch configuration

查看:16
本文介绍了在 Github 推送上触发工作流 - 管道插件 - 多分支配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在为我们的 CD 使用具有多分支配置的管道插件.我们已经签入了可以在 git 上运行的 Jenkinsfile.

We are using the pipeline plugin with multibranch configuration for our CD. We have checked in the Jenkinsfile which works off git.

git url: "$url",credentialsId:'$credentials'

该作业运行良好,但在将更改推送到 github 时不会自动触发.我已经正确设置了 GIT 网络挂钩.

The job works fine, but does not auto trigger when a change is pushed to github. I have set up the GIT web hooks correctly.

有趣的是,当我进入多分支作业的一个分支并单击查看配置"时,我看到将更改推送到 Github 时构建"未选中.无法检查它,因为我无法修改作业的配置(因为它从父级获取)并且父级中没有相同的选项.

Interestingly, when I go into a branch of the multibranch job and I click "View Configuration", I see that the "Build when a change is pushed to Github" is unchecked. There is no way to check it since I can not modify the configuration of the job (since it takes from parent) and the same option is not there in parent.

任何想法如何解决这个问题?

Any ideas how to fix this?

推荐答案

对于声明式管道试试:

pipeline {
    ...
    triggers {
        githubPush()
    }
    ...
}

对我来说,这启用了GitHub hook trigger for GITScm polling"复选框,但实际上并不需要轮询.这需要 GitHub 插件.

For me this enables the checkbox "GitHub hook trigger for GITScm polling", but polling is not actually required. This requires the GitHub plugin.

这篇关于在 Github 推送上触发工作流 - 管道插件 - 多分支配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆