java.lang.Object
org.jenkins.plugins.lockableresources.queue.Utils

public final class Utils extends Object
  • Method Details

    • getProject

      @CheckForNull public static Job<?,?> getProject(@NonNull Queue.Item item)
    • getProject

      @NonNull public static Job<?,?> getProject(@NonNull Run<?,?> build)
    • requiredResources

      @Deprecated @CheckForNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static LockableResourcesStruct requiredResources(@NonNull Job<?,?> project)
      Deprecated.
      Build the required-resources structure for a project, without additional environment variables.
      See Also:
    • requiredResources

      @CheckForNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static LockableResourcesStruct requiredResources(@NonNull Job<?,?> project, @CheckForNull EnvVars additionalEnv)
      Build the required-resources structure for a project, merging any additional environment variables (e.g. build parameters) into the expansion context.
      Parameters:
      project - the job whose RequiredResourcesProperty is read
      additionalEnv - extra variables to use when expanding ${...} references; may be null
      Returns:
      the struct, or null if the project has no lockable-resource property
    • getParametersAsEnvVars

      @NonNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static EnvVars getParametersAsEnvVars(@NonNull Queue.Item item)
      Extract build parameters from a Queue.Item and return them as EnvVars so that ${PARAM} references in resource names, labels and numbers are expanded.
    • containsVariable

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static boolean containsVariable(@CheckForNull String value)
      Returns true when the given string contains at least one ${...} variable reference that will be resolved at build time.