I have a Jenkinsfile that I've set up with a cron
for a pipelineTriggers
parameter. I can't seem to figure out how to disable the job from building from a merge to the master branch of the repo. Is there a way in the Jenkinsfile to disable the automatic build from an scm change?
If you're using a Multibranch Pipeline, you should be able to do this on the job's Configure page:
That would prevent changes to the master
branch from triggering a build of the corresponding job.
For declarative pipelines, use the when
directive with a triggeredBy
condition, e.g.
when { triggeredBy 'TimerTrigger' }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With