java.lang.Object
org.jenkinsci.plugins.pipeline.modeldefinition.Utils
All Implemented Interfaces:
groovy.lang.GroovyObject

public class Utils extends Object implements groovy.lang.GroovyObject
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • isParallelBranchFlowNode

      public static com.google.common.base.Predicate<org.jenkinsci.plugins.workflow.graph.FlowNode> isParallelBranchFlowNode(String stageName)
    • findStageFlowNodes

      public static List<org.jenkinsci.plugins.workflow.graph.FlowNode> findStageFlowNodes(String stageName)
    • isRunCausedBy

      public static boolean isRunCausedBy(org.jenkinsci.plugins.workflow.cps.CpsScript script, String cause)
    • markStartAndEndNodesInStageAsNotExecuted

      public static void markStartAndEndNodesInStageAsNotExecuted(String stageName)
    • generateTypeCache

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static Object generateTypeCache(Class<? extends Descriptor> type, boolean includeClassNames, List<String> excludedSymbols)
    • generateTypeCache

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static Object generateTypeCache(Class<? extends Descriptor> type, boolean includeClassNames)
    • generateTypeCache

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static Object generateTypeCache(Class<? extends Descriptor> type)
    • getMetaClass

      public groovy.lang.MetaClass getMetaClass()
      Specified by:
      getMetaClass in interface groovy.lang.GroovyObject
    • setMetaClass

      public void setMetaClass(groovy.lang.MetaClass mc)
      Specified by:
      setMetaClass in interface groovy.lang.GroovyObject
    • invokeMethod

      public Object invokeMethod(String method, Object arguments)
      Specified by:
      invokeMethod in interface groovy.lang.GroovyObject
    • getProperty

      public Object getProperty(String property)
      Specified by:
      getProperty in interface groovy.lang.GroovyObject
    • setProperty

      public void setProperty(String property, Object value)
      Specified by:
      setProperty in interface groovy.lang.GroovyObject
    • getScriptPropOrParam

      public static Object getScriptPropOrParam(org.jenkinsci.plugins.workflow.cps.CpsScript script, String name)
    • getCredsFromResolver

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static Map<String,groovy.lang.Closure> getCredsFromResolver(Environment environment, org.jenkinsci.plugins.workflow.cps.CpsScript script)
    • getLegacyEnvCredentials

      @NonNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static Map<String,CredentialWrapper> getLegacyEnvCredentials(@NonNull Environment environment)
    • trimQuotes

      public static String trimQuotes(String s)
    • nodeIdNotEquals

      public static com.google.common.base.Predicate<org.jenkinsci.plugins.workflow.graph.FlowNode> nodeIdNotEquals(org.jenkinsci.plugins.workflow.graph.FlowNode original)
    • endNodeForStage

      public static com.google.common.base.Predicate<org.jenkinsci.plugins.workflow.graph.FlowNode> endNodeForStage(org.jenkinsci.plugins.workflow.graph.BlockStartNode startNode)
    • stringToSHA1

      public static String stringToSHA1(String s)
    • logToTaskListener

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void logToTaskListener(String s)
    • withinAStage

      public static boolean withinAStage()
    • isParallelBranchFlowNode

      public static com.google.common.base.Predicate<org.jenkinsci.plugins.workflow.graph.FlowNode> isParallelBranchFlowNode(String stageName, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • findStageFlowNodes

      public static List<org.jenkinsci.plugins.workflow.graph.FlowNode> findStageFlowNodes(String stageName, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • isRestartedRun

      public static boolean isRestartedRun(org.jenkinsci.plugins.workflow.cps.CpsScript script)
    • isRunCausedBy

      public static boolean isRunCausedBy(org.jenkinsci.plugins.workflow.cps.CpsScript script, String cause, String detail)
    • shouldRunBeAllowed

      public static boolean shouldRunBeAllowed(Cause causeClass, String cause, String detail)
    • updateRunAndJobActions

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void updateRunAndJobActions(org.jenkinsci.plugins.workflow.cps.CpsScript script, String astUUID) throws Exception
      Throws:
      Exception
    • markStageWithTag

      public static void markStageWithTag(String stageName, String stepContextFlowNodeId, String tagName, String tagValue)
    • markStageWithTag

      public static void markStageWithTag(String stageName, String tagName, String tagValue)
    • markStartAndEndNodesInStageAsNotExecuted

      public static void markStartAndEndNodesInStageAsNotExecuted(String stageName, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • stageHasStatusOf

      public static boolean stageHasStatusOf(@NonNull String stageName, @NonNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution, @NonNull String... statuses)
    • getTagMetadata

      public static <T extends org.jenkinsci.plugins.pipeline.StageTagsMetadata> T getTagMetadata(Class<T> c)
    • getStageStatusMetadata

      public static org.jenkinsci.plugins.pipeline.StageStatus getStageStatusMetadata()
    • getSyntheticStageMetadata

      public static org.jenkinsci.plugins.pipeline.SyntheticStage getSyntheticStageMetadata()
    • markStageFailedAndContinued

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void markStageFailedAndContinued(String stageName)
    • markStageSkippedForFailure

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void markStageSkippedForFailure(String stageName)
    • markStageSkippedForUnstable

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void markStageSkippedForUnstable(String stageName)
    • markStageSkippedForConditional

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void markStageSkippedForConditional(String stageName)
    • generateTypeCache

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static Object generateTypeCache(Class<? extends Descriptor> type, boolean includeClassNames, List<String> excludedSymbols, groovy.lang.Closure<Boolean> filter)
    • createStepsBlock

      public static StepsBlock createStepsBlock(groovy.lang.Closure c)
    • validEnvIdentifier

      public static boolean validEnvIdentifier(String i)
    • getResultFromException

      public static Result getResultFromException(Throwable e)
    • updateJobProperties

      @Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void updateJobProperties(@CheckForNull List<Object> propsOrUninstantiated, @CheckForNull List<Object> trigsOrUninstantiated, @CheckForNull List<Object> paramsOrUninstantiated, @NonNull org.jenkinsci.plugins.workflow.cps.CpsScript script)
      Deprecated.
    • updateJobProperties

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void updateJobProperties(@CheckForNull List<Object> propsOrUninstantiated, @CheckForNull List<Object> trigsOrUninstantiated, @CheckForNull List<Object> paramsOrUninstantiated, @CheckForNull Map<String,org.jenkinsci.plugins.pipeline.modeldefinition.options.DeclarativeOption> optionsOrUninstantiated, @NonNull org.jenkinsci.plugins.workflow.cps.CpsScript script)
    • getSourceTextForASTNode

      public static String getSourceTextForASTNode(@NonNull org.codehaus.groovy.ast.ASTNode n, @NonNull org.codehaus.groovy.control.SourceUnit sourceUnit)
    • parentsForMethodCall

      @NonNull public static List<Class<? extends Describable>> parentsForMethodCall(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTMethodCall meth)
    • getRestartedStage

      public static String getRestartedStage(@NonNull org.jenkinsci.plugins.workflow.cps.CpsScript script)
    • parseStageFromJSON

      public static org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStage parseStageFromJSON(String stageJSON) throws Exception
      Throws:
      Exception