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
-
Method Summary
Modifier and TypeMethodDescriptionRun<?,
?> $build()
Run<?,
?> getProperty
(String property) final Object
invokeMethod
(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.void
void
void
void
println()
void
protected Object
void
sleep
(long arg) Effectively overridesDefaultGroovyStaticMethods.sleep(Object, long)
so thatSleepStep
works even in the bare formsleep 5
.Methods inherited from class groovy.lang.Script
getBinding, run, setBinding, setProperty
Methods 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:
invokeMethod
in interfacegroovy.lang.GroovyObject
- Overrides:
invokeMethod
in classgroovy.lang.Script
-
getProperty
- Specified by:
getProperty
in interfacegroovy.lang.GroovyObject
- Overrides:
getProperty
in classgroovy.lang.Script
-
$build
- Throws:
IOException
-
$buildNoException
-
evaluate
- Overrides:
evaluate
in classgroovy.lang.Script
- Throws:
org.codehaus.groovy.control.CompilationFailedException
-
evaluate
public Object evaluate(File file) throws org.codehaus.groovy.control.CompilationFailedException, IOException - Overrides:
evaluate
in classgroovy.lang.Script
- Throws:
org.codehaus.groovy.control.CompilationFailedException
IOException
-
run
public void run(File file, String[] arguments) throws org.codehaus.groovy.control.CompilationFailedException, IOException - Overrides:
run
in classgroovy.lang.Script
- Throws:
org.codehaus.groovy.control.CompilationFailedException
IOException
-
readResolve
-
println
public void println()- Overrides:
println
in classgroovy.lang.Script
-
print
- Overrides:
print
in classgroovy.lang.Script
-
println
- Overrides:
println
in classgroovy.lang.Script
-
printf
- Overrides:
printf
in classgroovy.lang.Script
-
printf
- Overrides:
printf
in classgroovy.lang.Script
-
sleep
Effectively overridesDefaultGroovyStaticMethods.sleep(Object, long)
so thatSleepStep
works even in the bare formsleep 5
.- See Also:
-