简体   繁体   English

Jenkins:根据bitbucket项目中的不同操作触发不同的构建

[英]Jenkins: Trigger different builds depending on different actions in bitbucket project

I have a bitbucket project for which I need to setup Continuous Integration and Continuous Delivery. 我有一个bitbucket项目,需要为其设置“持续集成”和“持续交付”。 I need to trigger different build projects on jenkins depending on which branch the code was pushed into bitbucket. 我需要在jenkins上触发不同的构建项目,具体取决于将代码推送到bitbucket的哪个分支。 Also, I want to be able to trigger different builds on jenkins when a pull request is created. 另外,我希望能够在创建请求请求时在jenkins上触发不同的构建。 Right now I could find the bitbucket plugin but it seems to have only one url that I can provide and inside the jenkins project I can see that I can provide the branch regex. 现在我可以找到bitbucket插件,但似乎只有一个网址可以提供,在jenkins项目中,我可以看到可以提供分支正则表达式。 So, this can solve the purpose of executing different builds when changes are pushed to different branches. 因此,这可以解决将更改推送到不同分支时执行不同构建的目的。 However, I am not sure how can I trigger a build only when a pull request is created for a particular branch? 但是,我不确定仅在为特定分支创建拉取请求时才如何触发构建? I mean there needs to be separate build triggered when a commit is pushed to say dev branch and another project triggered when someone creates/updates a pull request for dev branch. 我的意思是,当将提交推送到dev分支时需要触发一个单独的构建,而当有人为dev分支创建/更新拉取请求时触发另一个项目。

This sounds like something the multibranch-pipeline project would solve. 这听起来像多分支管道项目将要解决的问题。 Here you can have different pipelines for each branch in the repository. 在这里,您可以为存储库中的每个分支使用不同的管道。

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

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