-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
Currently Jenkins 2.59
Multibranch pipeline jobs scans for new branches and creates and removes jobs as needed. This is basically a good idea.
Unfortunately, the scan triggers an immediate build of new jobs when they're found in SCM. In many situations, this is fine - but in some, this is a no-go. I have a lot of jobs that can only run during night as they interrupt services when they're running.
I can avoid triggering the automatic build by setting the property "Suppress automatic SCM triggering" for all branches.
But: By doing that, Jenkins doesn't read the Jenkinsfile and doesn't find a command like
properties([pipelineTriggers([cron('H 5 * * *')])])
that I have on top of my Jenkinsfiles. Thus the job will never build.
If I get out of bed early in the morning and run the job once, Jenkins find the cron specification and runs the job properly afterwards.
It would be very nice - and give me some extra sleep - if the triggers where read at scan time instead of the first run.
Thanks in advance.
Hi,
We're also hitting a similar issue. When scanning for the multi-branch pipeline job Jenkinsfiles, the appropriate branches appear in Jenkins job. We're also utilising "Suppress automatic SCM triggering".
The issue that we're having is that the available jobs always only have the 'Build now' option, but we need to 'Build with parameters'. The current workaround is that we initiate the initial run, the Jenkinsfile is scanned and the next run has the appropriate build parameters. However, this is extremely risky for us as it initiates a run with the default parameters, and this still carries out the tasks that a full run would do, just with the default (unwanted) parameters.
It's quite a big requirement for us to be able to run the job effectively with the correct parameters the first time around.
Thanks in advance.