Hi all,
I keep my Jenkinsfile in a git repo. For features and fixes, i create branches on this repo, each having a slightly different Jenkinsfile. I have a jenkins job of type multibranch pipeline, scanning these pipelines as i create a branch.
Assuming i have the basic declarative pipeline structure for all Jenkinsfiles in different branches
pipeline {
agent any
triggers {
cron('H 4/* 0 0 1-5')
}
stages {
stage('Example') {
steps {
echo 'Hello World'
}
}
}
}
I sometimes want to change the cron of certain jobs, sometimes even to disable it. The best ideal way to do it would be to change it in Jenkinsfile in the GIT repo. But after changing the code and invoking 'scan multibranch pipeline' from Jenkins UI, it does 1 execution, which is something i do not want.
How can i make sure that updated settings done in Jenkinsfile are picked up without executing it ? And can it happen automatically immediately ?
What is the simplest way to disable a job for a while in the above setup ?