Git Product home page Git Product logo

build-blocker-plugin's Introduction

Build Blocker plugin

Jenkins Plugin GitHub release Jenkins Plugin Installs

This plugin keeps the actual job in the queue if at least one name of currently running jobs is matching with one of the given regular expressions.

General

This plugin is similar to the locks and latches plugin. The main difference is, that it uses regular expressions to find potentially blocking jobs by their names in the list of currently running builds. It uses the QueueTaskDispatcher to check if the actual job may be build. The dispatcher uses the list of regular expressions configured in the job. If one of the currently running jobs matches with one of the regular expressions, the job stays in the queue.

How to use

After installing the plugin, the job configuration page has a new property "Block build if certain jobs are running" in the upper section.

Configuring blocking jobs

Insert one regular expression per line into the textarea. Each expression is used to detect currently running jobs that match with their names. The first matching job name will block the build and the job will stay in the queue until all expression are evaluated without match.

Other than the locks and latches plugin where both, the job to be build and the blocking job, need to have the same lock configured, this plugin allows to just configure to job to be build. No jenkins system configuration is needed.

The blocking behaviour can be configured to either block builds

  • from running on the same node
  • from running at all

Additionally, the blocking behaviour can be configured to consider planned, but not yet running builds in the decision to block a build. Either buildable builds can stop another build from running (for instance builds that are waiting for an available executor) or
all planned builds can stop another build from running (blocked builds, pending builds waiting builds and buildable builds)

JobDSL

Usage inside jobdsl scripts is simple as well. For example in order to create a pipeline job which blocks on global level when another job is building you can write the following

pipelineJob('MyPipeline') {

    // Block build if certain jobs are running.
    blockOn('.*AnotherPipeline.*') {
        // Possible values are 'GLOBAL' and 'NODE' (default).
        blockLevel('GLOBAL')
        // Possible values are 'ALL', 'BUILDABLE' and 'DISABLED' (default).
        scanQueueFor('DISABLED')
    } 
}

build-blocker-plugin's People

Contributors

bramtassyns avatar c031 avatar cigam avatar daniel-beck-bot avatar denis1990 avatar fbelzunc avatar ffromm avatar kurromat avatar olivergondza avatar stephenc avatar wickedjester avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.