We have a multibranch pipeline job set up to scan a git repo (which 
contains Jenkinsfile at its root) for branches and create branch-specific 
jobs for each branch discovered. The Jenkinsfile on a branch specifies:

    triggers {
        cron('@midnight')
    }

and this indeed runs nightly at midnight. However, when I delete the above 
block and commit the Jenkinsfile to my branch, it appears to have no 
effect. Last night the build still ran at midnight. This is my problem.

I confirmed the change by looking on the branch job configuration page and 
indeed see an empty BuildTriggers section. There are no triggers specified 
and none of the trigger checkboxes are checked.

Please confirm whether this is indeed the way I am supposed to disable a 
trigger specified in a multibranch pipeline Jenkinsfile. 

Also, note that in the top-level pipeline job configuration, BranchSources 
is set up so "All branches get same properties" and set the property 
"Suppress Automatic SCM Triggering" because we only want builds to be done 
nightly for now, and not as a result of commits. Also, "Scan Multibranch 
Pipeline Triggers" is configured to scan our repo every minute for branch 
changes. I assume this means that it also scans and applies any changes to 
Jenkinsfiles (e.g. our trigger {} changes) to the branch job. I believe 
this to be happening, bc as I've said, the job configuration page seems to 
have reflected our change to the Jenkinsfile in SCM. But the build still 
was triggered last night at midnight.

Please let me know if you know what's going wrong here, or have any 
suggestions for troubleshooting this.

Thanks,
Tim

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/37a06f44-fa92-4970-b9f5-0f32f069f609%40googlegroups.com.

Reply via email to