Can I do item 1 with lockable resources? But then wouldn't every 
Jenkinsfile in all of my repos require lockable resources? So I think 
that's also not the way to go but I could be wrong.

On Sunday, March 10, 2019 at 12:40:26 PM UTC+1, Amedee Van Gasse wrote:
>
> I have a Bitbucket Server Project.
>
> I am using declarative Jenkinsfiles
>
> All branches/PRs of all repos in the Project are built if they have a 
> Jenkinsfile. Wonderful.
> The branches/PRs are built when there is new git activity. Wonderful.
>
>
> There is one repo with 2 requirements that I'm stuck on:
>
> 1. It cannot run when anything else is running, not even other branches of 
> itself. I already have disableConcurrentBuilds() but then I can still run 
> different branches in parallel and I don't want that. I know about the 
> Build Blocker plugin and I would put this in my Jenkinsfile, but I don't 
> know where to put it:
>
>     blockOn('.*') {
>         blockLevel('GLOBAL')
>         scanQueueFor('ALL')
>     }
>
>
> 2. That particular job, any branch of it, is only allowed to start between 
> specific hours, regardless of how it got triggered. I don't know how to put 
> that in my Jenkinsfile. I looked at quietPeriod and rateLimitBuilds, but 
> they seem to be for something else.
>
>
> I had a third question about how to schedule it with cron, but I found 
> that myself already:
>
> triggers {
>     cron('H H(0-6) * * 1-5')
> }
>
>
> meaning anywhere between midnight and 6 AM on work days.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ac9910dc-6ced-484a-8f51-ba4bfcacc48e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to