I´m starting to create my pipeline multibranch environment but i have founded a problem.
Can I run a build scan only to detect the branches with a Jenkinsfile but without the pipeline execution?
My projects have different branches and i dont want when i launch a build scan from the parent pipeline multibranch all the children pipelines foreach branches with a Jenkinsfile starts to execute.
Thanks by the help!
In your Branch Sources section you can add a Property named Suppress automatic SCM triggering.
This prevents Jenkins from building everything with an
Jenkinsfile
.Also, you can do it programatically
This is a Groovy snippet you can execute in Jenkins, it's gonna do the scanning but will not start new "builds" for all discovered branches.
If you are using job-dsl you could simply do this and it will scan everything without actually running the build the first time you index.
To add to @Stqs's answer, you could also set
noTriggerBranchProperty
it using Job DSL plugin, e.g.: