Class Utils
java.lang.Object
org.jenkinsci.plugins.pipeline.modeldefinition.Utils
- All Implemented Interfaces:
groovy.lang.GroovyObject
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic StepsBlock
createStepsBlock
(groovy.lang.Closure c) static com.google.common.base.Predicate<org.jenkinsci.plugins.workflow.graph.FlowNode>
endNodeForStage
(org.jenkinsci.plugins.workflow.graph.BlockStartNode startNode) static List<org.jenkinsci.plugins.workflow.graph.FlowNode>
findStageFlowNodes
(String stageName) static List<org.jenkinsci.plugins.workflow.graph.FlowNode>
findStageFlowNodes
(String stageName, org.jenkinsci.plugins.workflow.flow.FlowExecution execution) static Object
generateTypeCache
(Class<? extends Descriptor> type) static Object
generateTypeCache
(Class<? extends Descriptor> type, boolean includeClassNames) static Object
generateTypeCache
(Class<? extends Descriptor> type, boolean includeClassNames, List<String> excludedSymbols) static Object
generateTypeCache
(Class<? extends Descriptor> type, boolean includeClassNames, List<String> excludedSymbols, groovy.lang.Closure<Boolean> filter) getCredsFromResolver
(Environment environment, org.jenkinsci.plugins.workflow.cps.CpsScript script) static Map<String,
CredentialWrapper> getLegacyEnvCredentials
(Environment environment) groovy.lang.MetaClass
getProperty
(String property) static String
getRestartedStage
(org.jenkinsci.plugins.workflow.cps.CpsScript script) static Result
static Object
getScriptPropOrParam
(org.jenkinsci.plugins.workflow.cps.CpsScript script, String name) static String
getSourceTextForASTNode
(org.codehaus.groovy.ast.ASTNode n, org.codehaus.groovy.control.SourceUnit sourceUnit) static org.jenkinsci.plugins.pipeline.StageStatus
static org.jenkinsci.plugins.pipeline.SyntheticStage
static <T extends org.jenkinsci.plugins.pipeline.StageTagsMetadata>
TgetTagMetadata
(Class<T> c) invokeMethod
(String method, Object arguments) static com.google.common.base.Predicate<org.jenkinsci.plugins.workflow.graph.FlowNode>
isParallelBranchFlowNode
(String stageName) static com.google.common.base.Predicate<org.jenkinsci.plugins.workflow.graph.FlowNode>
isParallelBranchFlowNode
(String stageName, org.jenkinsci.plugins.workflow.flow.FlowExecution execution) static boolean
isRestartedRun
(org.jenkinsci.plugins.workflow.cps.CpsScript script) static boolean
isRunCausedBy
(org.jenkinsci.plugins.workflow.cps.CpsScript script, String cause) static boolean
isRunCausedBy
(org.jenkinsci.plugins.workflow.cps.CpsScript script, String cause, String detail) static void
static void
markStageFailedAndContinued
(String stageName) static void
markStageSkippedForConditional
(String stageName) static void
markStageSkippedForFailure
(String stageName) static void
markStageSkippedForUnstable
(String stageName) static void
markStageWithTag
(String stageName, String tagName, String tagValue) static void
markStageWithTag
(String stageName, String stepContextFlowNodeId, String tagName, String tagValue) static void
markStartAndEndNodesInStageAsNotExecuted
(String stageName) static void
markStartAndEndNodesInStageAsNotExecuted
(String stageName, org.jenkinsci.plugins.workflow.flow.FlowExecution execution) static com.google.common.base.Predicate<org.jenkinsci.plugins.workflow.graph.FlowNode>
nodeIdNotEquals
(org.jenkinsci.plugins.workflow.graph.FlowNode original) static List<Class<? extends Describable>>
parentsForMethodCall
(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTMethodCall meth) static org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStage
parseStageFromJSON
(String stageJSON) void
setMetaClass
(groovy.lang.MetaClass mc) void
setProperty
(String property, Object value) static boolean
shouldRunBeAllowed
(Cause causeClass, String cause, String detail) static boolean
stageHasStatusOf
(String stageName, org.jenkinsci.plugins.workflow.flow.FlowExecution execution, String... statuses) static String
static String
trimQuotes
(String s) static void
updateJobProperties
(List<Object> propsOrUninstantiated, List<Object> trigsOrUninstantiated, List<Object> paramsOrUninstantiated, Map<String, org.jenkinsci.plugins.pipeline.modeldefinition.options.DeclarativeOption> optionsOrUninstantiated, org.jenkinsci.plugins.workflow.cps.CpsScript script) static void
updateJobProperties
(List<Object> propsOrUninstantiated, List<Object> trigsOrUninstantiated, List<Object> paramsOrUninstantiated, org.jenkinsci.plugins.workflow.cps.CpsScript script) Deprecated.static void
updateRunAndJobActions
(org.jenkinsci.plugins.workflow.cps.CpsScript script, String astUUID) static boolean
static boolean
-
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
-
isRunCausedBy
public static boolean isRunCausedBy(org.jenkinsci.plugins.workflow.cps.CpsScript script, String cause) -
markStartAndEndNodesInStageAsNotExecuted
-
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 interfacegroovy.lang.GroovyObject
-
setMetaClass
public void setMetaClass(groovy.lang.MetaClass mc) - Specified by:
setMetaClass
in interfacegroovy.lang.GroovyObject
-
invokeMethod
- Specified by:
invokeMethod
in interfacegroovy.lang.GroovyObject
-
getProperty
- Specified by:
getProperty
in interfacegroovy.lang.GroovyObject
-
setProperty
- Specified by:
setProperty
in interfacegroovy.lang.GroovyObject
-
getScriptPropOrParam
-
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
-
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
-
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
-
isRestartedRun
public static boolean isRestartedRun(org.jenkinsci.plugins.workflow.cps.CpsScript script) -
isRunCausedBy
-
shouldRunBeAllowed
-
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
-
markStageWithTag
-
markStartAndEndNodesInStageAsNotExecuted
public static void markStartAndEndNodesInStageAsNotExecuted(String stageName, org.jenkinsci.plugins.workflow.flow.FlowExecution execution) -
stageHasStatusOf
-
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
-
createStepsBlock
-
validEnvIdentifier
-
getResultFromException
-
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
-