如何从GitHub拉取请求触发Jenkins 2.0管道作业 [英] How to trigger a Jenkins 2.0 Pipeline job from a GitHub pull request

查看:245
本文介绍了如何从GitHub拉取请求触发Jenkins 2.0管道作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来GitHubPullRequestBuilder与Jenkins v2.0管道作业不兼容。

如何配置管道作业从GitHub拉取请求事件触发?

关于此主题的文档很少,我无法找到这个的任何例子。或者在GitHub中创建一个Web钩子来触发PR事件中的管道作业更好?

解决方案

使用Pipeline和GitHub pull请求最直接的方法是将脚本放在名为 Jenkinsfile ,然后安装 GitHub Branch Source 插件。 文档


It looks like the GitHubPullRequestBuilder is not compatible with Jenkins v2.0 pipeline jobs.

How do you configure a pipeline job to be triggered from a GitHub pull request event?
The documentation on this topic is sparse and I cannot find any examples of this. Or is it better to create a web-hook in GitHub to trigger the pipeline job on the PR event?

解决方案

The most straightforward way to use Pipeline with GitHub pull requests is to put the script into your repository under the name Jenkinsfile and then install the GitHub Branch Source plugin. Documentation

这篇关于如何从GitHub拉取请求触发Jenkins 2.0管道作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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