Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Jenkins: How to Block execution of other job

Options
  • 18-11-2016 11:10am
    #1
    Registered Users Posts: 5,555 ✭✭✭


    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 Posts: 11,262 ✭✭✭✭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 Posts: 5,555 ✭✭✭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 Posts: 81,222 ✭✭✭✭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