Class CpsScript
java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.lang.Script
com.cloudbees.groovy.cps.SerializableScript
org.jenkinsci.plugins.workflow.cps.CpsScript
- All Implemented Interfaces:
groovy.lang.GroovyObject,Serializable
The script of a workflow.
Every
Script we load in Pipeline execution derives from this subtype.- Author:
- Kohsuke Kawaguchi
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRun<?,?> $build()Run<?,?> getProperty(String property) final ObjectinvokeMethod(String name, Object args) We use DSL here to try invoke the step implementation, if there is Step implementation found it's handled or it's an error.voidvoidvoidvoidprintln()voidprotected Objectvoidsleep(long arg) Effectively overridesDefaultGroovyStaticMethods.sleep(Object, long)so thatSleepStepworks even in the bare formsleep 5.Methods inherited from class groovy.lang.Script
getBinding, run, setBinding, setPropertyMethods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, setMetaClass
-
Constructor Details
-
CpsScript
Default constructor forCpsFlowExecution.- Throws:
IOException
-
-
Method Details
-
invokeMethod
We use DSL here to try invoke the step implementation, if there is Step implementation found it's handled or it's an error.sandbox security execution relies on the assumption that CpsScript.invokeMethod() is safe for sandboxed code. That means we cannot let user-written script override this method, hence the final.
- Specified by:
invokeMethodin interfacegroovy.lang.GroovyObject- Overrides:
invokeMethodin classgroovy.lang.Script
-
getProperty
- Specified by:
getPropertyin interfacegroovy.lang.GroovyObject- Overrides:
getPropertyin classgroovy.lang.Script
-
$build
- Throws:
IOException
-
$buildNoException
-
evaluate
- Overrides:
evaluatein classgroovy.lang.Script- Throws:
org.codehaus.groovy.control.CompilationFailedException
-
evaluate
public Object evaluate(File file) throws org.codehaus.groovy.control.CompilationFailedException, IOException - Overrides:
evaluatein classgroovy.lang.Script- Throws:
org.codehaus.groovy.control.CompilationFailedExceptionIOException
-
run
public void run(File file, String[] arguments) throws org.codehaus.groovy.control.CompilationFailedException, IOException - Overrides:
runin classgroovy.lang.Script- Throws:
org.codehaus.groovy.control.CompilationFailedExceptionIOException
-
readResolve
-
println
public void println()- Overrides:
printlnin classgroovy.lang.Script
-
print
- Overrides:
printin classgroovy.lang.Script
-
println
- Overrides:
printlnin classgroovy.lang.Script
-
printf
- Overrides:
printfin classgroovy.lang.Script
-
printf
- Overrides:
printfin classgroovy.lang.Script
-
sleep
Effectively overridesDefaultGroovyStaticMethods.sleep(Object, long)so thatSleepStepworks even in the bare formsleep 5.- See Also:
-