The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.
For a list of other such plugins, see the Pipeline Steps Reference page.
lock: Lock shared resourceresource : String
The resource name to lock as defined in Global settings.
If the resource does not exist in Global Settings it will be automatically created on build execution. Either a resource or a label need to be specified.
extra (optional)
resource : String
The resource name to lock as defined in Global settings.
If the resource does not exist in Global Settings it will be automatically created on build execution. Either a resource or a label need to be specified.
label : String (optional)
The label of the resources to be locked as defined in Global settings.
Either a resource or a label need to be specified.
See also examples and Scripted vs declarative pipeline .
quantity : int (optional)
The quantity of resources with the specified label to be locked as defined in Global settings.
Either a resource or a label need to be specified. Empty value or 0 means lock all matching resources.
inversePrecedence : boolean (optional)
By default waiting builds get the lock in the same order they requested to acquire it.
By checking this option the newest build in the waiting queue will get the lock first.
See also examples .
label : String (optional)
The label of the resources to be locked as defined in Global settings.
Either a resource or a label need to be specified.
See also examples and Scripted vs declarative pipeline .
priority : int (optional)
The priority of the lock,
which takes an integer number that defines the order in which concurrent jobs waiting for the same resource are served. The job with the highest number would get the resource first. If the priority is equal, the current precedence (first comes first) would be applied.
See also examples .
quantity : int (optional)
The quantity of resources with the specified label to be locked as defined in Global settings.
Either a resource or a label need to be specified. Empty value or 0 means lock all matching resources.
resourceSelectStrategy : String (optional)
The strategy used to chose which available resources get locked. By default, the strategy will be "sequential" and resources are locked following the order in the lockable resources list. Set the strategy to "random" to randomize the order in which resources are locked.
skipIfLocked : boolean (optional)
By default waiting builds get the lock.
By checking this option the body will not be executed if there is a queue. It will only take the lock if it can be taken immediately.
See also examples .
variable : String (optional)
Name of an environment variable that will receive the comma separated list of the names of the locked resources while the block executes.
See also examples and Scripted vs declarative pipeline .
updateLock: Update lockable resourceaddLabels : String (optional)
Adds labels to the resource without removing existing labels. Multiple labels should be separated by whitespace. Labels that already exist on the resource will not be duplicated.
Cannot be used together with setLabels.
Example: addLabels: 'newlabel1 newlabel2'
createResource : boolean (optional)
When set to true, creates the resource if it does not already exist. The newly created resource will be persistent (not ephemeral).
Cannot be used together with deleteResource.
deleteResource : boolean (optional)
When set to true, deletes the specified resource. The resource must not be locked, queued, or reserved.
Cannot be used together with createResource or any label/note modification options.
removeLabels : String (optional)
Removes the specified labels from the resource. Multiple labels should be separated by whitespace. Labels that do not exist on the resource will be ignored.
Cannot be used together with setLabels.
Example: removeLabels: 'oldlabel1 oldlabel2'
resource : String (optional)
The name of the resource to update. This parameter is required.
The resource must already exist, unless createResource is set to true.
setLabels : String (optional)
Sets the labels of the resource, replacing any existing labels. Multiple labels should be separated by whitespace.
Cannot be used together with addLabels or removeLabels.
Example: setLabels: 'label1 label2 label3'
setNote : String (optional)
Sets the note field of the resource, replacing any existing note. This can be used to store additional information or comments about the resource.
Example: setNote: 'Updated by build #123'
Please submit your feedback about this page through this quick form.
Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?
See existing feedback here.