Reputation: 1030
I'd have a pipeline with some jobs until the deploy like that:
(unit test) -> (integration test) -> (package) -> (deploy)
but I'd like to run the jobs (unit test) and (integration test) in all branches, and run jobs (package) and (deploy) only on changes on branch master.
How can I do it? Are there a conditional trigger plugin?
Upvotes: 0
Views: 2337
Reputation: 9759
UPDATE: 2018
The flexible publish plugin (github) can do this now.
You can specify run conditions (e.g. based on the a regex match of GIT_BRANCH
) and a flexible set of actions to take when conditions match.
I am using this to trigger downstream deployment jobs only for the develop
branch of one of our repositories.
Upvotes: 0
Reputation: 21130
If you have a fixed number of branches, it's easiest to have separate Jenkins jobs for each branch. If you use a single job to build multiple branches, it will be hard to tell which branch a particular build ran on when you look at the build history.
You can create the jobs for different branches by copying from an existing job via the UI, or you could look at the Job DSL plugin if you want to automate job creation and make it easy to create jobs for new branches.
Upvotes: 2