简体   繁体   English

使用GitHub Pull Request Builder触发多个Jenkins构建

[英]Trigger multiple Jenkins builds with GitHub Pull Request Builder

Currently, I have a Jenkins job setup so that when a pull request is opened for my repository, a Jenkins job is automatically created via the GitHub Pull Request Builder Plugin . 当前,我有一个Jenkins作业设置,以便在为我的存储库打开一个拉取请求时,可以通过GitHub Pull Request Builder插件自动创建一个Jenkins作业。

I would like to be able to trigger multiple Jenkins jobs when a PR is opened in my GitHub repository and have the GitHub Pull Request Builder report the status back to the PR. 当我在GitHub存储库中打开PR时,我希望能够触发多个Jenkins作业,并让GitHub Pull Request Builder向PR报告状态。 Is this achievable via the GitHub Pull Request Builder plugin or are there other plugins available for this? 这是可以通过GitHub Pull Request Builder插件实现的,还是有其他可用的插件呢? My research has me coming up empty-handed. 我的研究使我空手而归。

You can have a Jenkins job for each PR Check, like so: 您可以为每个PR Check拥有一份Jenkins职位,如下所示: 在此处输入图片说明

Each one of those jenkins jobs is using the Git Hub Pull Request Builder. 这些詹金斯工作中的每一项都使用Git Hub Pull Request Builder。 Just make sure to configure it with a unique name, and you should be good to go: 只要确保使用唯一的名称对其进行配置,就可以了:

在此处输入图片说明

I finally figured out how to do this, and realized I did not provide enough context in my initial question. 我终于弄清楚了如何做到这一点,并且意识到我在最初的问题中没有提供足够的上下文。 Specifically, I am configuring my Jenkins job as part of a GitHub Organization. 具体来说,我将Jenkins工作配置为GitHub Organization的一部分。 A single GitHub Organization only supports one Jenkinsfile; 单个GitHub组织仅支持一个Jenkinsfile; one cannot configure the same organization to use two separate Jenkinsfile. 一个人不能将同一组织配置为使用两个单独的Jenkinsfile。 So, I imported the same GitHub Organization in my Jenkins instance and configured it to use the other Jenkinsfile. 因此,我在Jenkins实例中导入了相同的GitHub Organization,并将其配置为使用其他Jenkinsfile。 This results in multiple jobs appearing above as you have it configured. 配置完成后,这将导致多个作业显示在上方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM