Class LockStep

java.lang.Object
hudson.model.AbstractDescribableImpl<org.jenkinsci.plugins.workflow.steps.Step>
org.jenkinsci.plugins.workflow.steps.Step
org.jenkins.plugins.lockableresources.LockStep
All Implemented Interfaces:
ExtensionPoint, Describable<org.jenkinsci.plugins.workflow.steps.Step>, Serializable

public class LockStep extends org.jenkinsci.plugins.workflow.steps.Step implements Serializable
See Also:
  • Field Details

    • resource

      @CheckForNull public String resource
    • label

      @CheckForNull public String label
    • reason

      @CheckForNull public String reason
      The reason why this resource is being locked, displayed in the UI while locked.
    • quantity

      public int quantity
    • variable

      @CheckForNull public String variable
      name of environment variable to store locked resources in
    • inversePrecedence

      public boolean inversePrecedence
    • resourceSelectStrategy

      public String resourceSelectStrategy
    • skipIfLocked

      public boolean skipIfLocked
    • serverId

      @CheckForNull public String serverId
    • extra

      @CheckForNull public List<LockStepResource> extra
    • priority

      public int priority
    • timeoutForAllocateResource

      public long timeoutForAllocateResource
      Timeout in the specified timeoutUnit for waiting to acquire the resource. 0 means no timeout (wait indefinitely). When the timeout expires, the step fails with an exception instead of waiting forever.
    • timeoutUnit

      public String timeoutUnit
      Time unit for timeoutForAllocateResource. Defaults to MINUTES.
    • shareId

      @CheckForNull public String shareId
      Share id of this lock block. A block with a share id joins a hold of the same resources taken under the same share id by this build or one of its upstream builds, instead of waiting for it. Only named resources can be shared.
    • candidates

      @CheckForNull public List<String> candidates
      Optional list of resource names to pick from, in list order. Without a quantity all listed resources are locked, like named resources; with a quantity the first free ones that exist are locked. Mutually exclusive with resource and label. Not supported for remote locks.
    • onReleaseDelay

      public long onReleaseDelay
      Seconds the resources stay locked after the lock block ends normally or fails, e.g. for a license cooldown. The pipeline continues right away. 0 (default) releases them immediately.
    • onCancelDelay

      public long onCancelDelay
      Seconds the resources stay locked after the build is aborted inside the lock block. 0 (default) releases them immediately.
  • Constructor Details

    • LockStep

      @DataBoundConstructor public LockStep(@Nullable String resource)
  • Method Details

    • getGroup

      public String getGroup()
      Since:
      TODO
    • setGroup

      @DataBoundSetter public void setGroup(@Nullable String group)
      Since:
      TODO
    • isGroupOnly

      public boolean isGroupOnly()
      Since:
      TODO
    • setInversePrecedence

      @DataBoundSetter public void setInversePrecedence(boolean inversePrecedence)
    • setResourceSelectStrategy

      @DataBoundSetter public void setResourceSelectStrategy(String resourceSelectStrategy)
    • setSkipIfLocked

      @DataBoundSetter public void setSkipIfLocked(boolean skipIfLocked)
    • setServerId

      @DataBoundSetter public void setServerId(String serverId)
    • setLabel

      @DataBoundSetter public void setLabel(String label)
    • setReason

      @DataBoundSetter public void setReason(String reason)
    • setVariable

      @DataBoundSetter public void setVariable(String variable)
    • setQuantity

      @DataBoundSetter public void setQuantity(int quantity)
    • setPriority

      @DataBoundSetter public void setPriority(int priority)
    • setExtra

      @DataBoundSetter public void setExtra(@CheckForNull List<LockStepResource> extra)
    • setTimeoutForAllocateResource

      @DataBoundSetter public void setTimeoutForAllocateResource(long timeoutForAllocateResource)
    • setTimeoutUnit

      @DataBoundSetter public void setTimeoutUnit(String timeoutUnit)
    • setShareId

      @DataBoundSetter public void setShareId(String shareId)
    • setCandidates

      @DataBoundSetter public void setCandidates(@CheckForNull List<String> candidates)
    • setOnReleaseDelay

      @DataBoundSetter public void setOnReleaseDelay(long onReleaseDelay)
    • setOnCancelDelay

      @DataBoundSetter public void setOnCancelDelay(long onCancelDelay)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validate

      public void validate(boolean allowEmptyOrNullValues)
      Label and resource are mutual exclusive.
    • getResources

      public List<LockStepResource> getResources()
    • start

      public org.jenkinsci.plugins.workflow.steps.StepExecution start(org.jenkinsci.plugins.workflow.steps.StepContext context)
      Specified by:
      start in class org.jenkinsci.plugins.workflow.steps.Step