简体   繁体   中英

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. I need to trigger different build projects on jenkins depending on which branch the code was pushed into bitbucket. Also, I want to be able to trigger different builds on jenkins when a pull request is created. 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. 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.

This sounds like something the multibranch-pipeline project would solve. Here you can have different pipelines for each branch in the repository.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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