Re: problems changing triggers{} in multibranch pipeline Jenkinsfile

2019-10-04 Thread Tim Black
Thanks Bjorn for helping clarify that. I would take what you said a step 
further by changing "could" to "must", since it appears that simply adding a 
trigger back into a Jenkinsfile for a job that has run since the trigger was 
removed, will necessarily have no effect until you manually run the job. 

Paraphrasing, and I wish this was in the docs somewhere, "Multibranch Pipeline 
job properties specified in a Jenkinsfile, e.g. triggers, agents.. have no 
effect until the job is run."

This is perhaps obvious to those with more experience with this plugin's SCM 
scanning feature.

Perhaps another good way to say it would be in the section that talks about the 
scanning feature to call out that "the scanning only looks at Jenkinsfile 
existence, it does not apply changes made inside Jenkinsfiles until they are 
run."

-- 
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/3591daa0-ee81-42da-8c20-b61a3fb47154%40googlegroups.com.


Re: problems changing triggers{} in multibranch pipeline Jenkinsfile

2019-10-04 Thread 'Björn Pedersen' via Jenkins Users
Hi,

Am Freitag, 4. Oktober 2019 02:03:17 UTC+2 schrieb Tim Black:
>
> 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. 
>
>

The update to the job config for changes made in the jenkinsfile only 
happen once  the jobs runs (before that point, the jenkinsfile is neither 
fetched nor evaluated). So if you changed the trigger today, then it would 
run once tonight and should stop starting after that.  To get the effect 
more immedeatly, you could trigger the job manually.

Björn

-- 
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/4cffef7d-70ec-4f79-8714-780725d90059%40googlegroups.com.


problems changing triggers{} in multibranch pipeline Jenkinsfile

2019-10-03 Thread Tim Black
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.