HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMajor

How to disable some branches in Multibranch Jenkins Builds?

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
branchesbuildsmultibranchjenkinsdisablesomehow

Problem

I have a multibranch job set to run any branch with a Jenkinsfile.

I have some options I can think of if I want to remove a branch from the list of jobs running for the multi-branch pipeline.

  • I can delete the branch



  • I can delete the Jenkinsfile in that branch



The second solution is good, except I need to commit and push that to the git repo for my branch, and if that branch is merged into another branch it blows away the Jenkinsfile.

What is the best way to disable only some branches of a multibranch pipeline?

Solution

Jenkins can filter branches in a multibranch pipeline by name using a wildcard or regular expression.

Context

StackExchange DevOps Q#3400, answer score: 29

Revisions (0)

No revisions yet.