flaviomeira10
flaviomeira10

Reputation: 586

Prevent Jenkins multibranch pipeline from triggering builds for new branches

I have a multibranch pipeline job for deploying an application in IIS. Because of it, I cannot run the job (that deploys a new version of the application) when new branches are discovered.

I need to configure the trigger only to discover new branches and do not trigger the job.

Upvotes: 3

Views: 4028

Answers (2)

Max Cascone
Max Cascone

Reputation: 843

If you are using a Jenkinsfile to define your pipe, add the following to the options block:

pipeline {
...
  options {
    overrideIndexTriggers(false)
  }
}

While the syntax is a bit opaque, it will cause the pipe to not run when triggered by indexing.

Upvotes: 0

user_9090
user_9090

Reputation: 1984

In your Branch Sources section you can add a Property named Suppress automatic SCM triggering.

This prevents Jenkins from building everything with an Jenkinsfile.

More Info

Upvotes: 3

Related Questions