Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Jenkins: How to Block execution of other job

  • 18-11-2016 11:10AM
    #1
    Registered Users, Registered Users 2 Posts: 5,753 ✭✭✭


    I have a Jenkins Build X with the plugin option.

    Block build if certain jobs are running

    The problem is that i need to do the opposite. I want to block the "certain jobs" from running if X is running.

    The jobs in question run every hour and may happen to execute while X is running. This would trip X over if it happened.

    I know that Jenkins CLI can do a disable of the job, but then i have the overhead of having to re-enable and the issue of "what if job is aborted etc". So would ideally like to use the Block option.

    Any suggestions?


Comments

  • Registered Users, Registered Users 2 Posts: 11,264 ✭✭✭✭jester77


    I haven't played with jenkins in a while, but the upstream/downstream pipeline option might work. You could set Job B/C/D/etc to be downstreams of Job A. They will then wait until Job A is completed before executing.


  • Registered Users, Registered Users 2 Posts: 5,753 ✭✭✭veryangryman


    jester77 wrote: »
    I haven't played with jenkins in a while, but the upstream/downstream pipeline option might work. You could set Job B/C/D/etc to be downstreams of Job A. They will then wait until Job A is completed before executing.

    Problem is that Jobs B,C,D are system checks that run every hour. Job B is for server B, job C for server C etc.

    So while i am running Job A on server X, i dont want Job B to run on that server. C and D can do what they like as they are on different servers.


  • Registered Users, Registered Users 2 Posts: 81,060 ✭✭✭✭biko


    As I see it you are probably best off pipelining the jobs every day (depending on what job X does).

    Alternatively you will have to set the block options for jobs A,B,C (unless ABC are piped and you only have to block A)


Advertisement