Chuchoo Chuchoo -4 years ago 123
Git Question

how to filter certain branch say, 'master' in my parameterized build run in jenkins

I have parameterized jenkins job which takes branch name in order to build that particular branch. I want job to not run if some body puts "master" as a branch name but run job for every other branches. I want to basically build it from bugfix branch.

How can I achieve this?

Answer Source

You could use the Validating String Input Parameter plugin to add validation of the parameter before the build and give the user an error if the branch equals "master". Also, ^(?!master).*$ is an regular expression which doesn't allow the string master, but any other string.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download