Jacob
Jacob

Reputation: 4021

Jenkins pipeline same job for multiple branches

I'm looking for a quite specific option for which I haven't been able to find anything useful online.

Basically what I want is a single Jenkins pipeline job...which is capable of building from several branches. GIT repo is the same...just different branches.

Preferably branches would get recognized by a certain name prefix.

it is a possibility? Please advice...

Upvotes: 1

Views: 2902

Answers (2)

honorius
honorius

Reputation: 491

You can use regular expression in Branch Specifier to match branches with specific prefix using :<regex>:

:origin/prefix_.*

should match origin/prefix_<whatever>

Upvotes: 1

SV Madhava Reddy
SV Madhava Reddy

Reputation: 2018

Here I am attaching an image that will built upon changes in Branches i.e. master, qa, development. Hope this helps.

Multiple Branch Build a Job

Upvotes: 3

Related Questions