public abstract class CpsScript
extends com.cloudbees.groovy.cps.SerializableScript
Script
we load in Pipeline execution derives from this subtype.Constructor and Description |
---|
CpsScript()
Default constructor for
CpsFlowExecution . |
Modifier and Type | Method and Description |
---|---|
Run<?,?> |
$build() |
Run<?,?> |
$buildNoException() |
Object |
evaluate(File file) |
Object |
evaluate(String script) |
Object |
getProperty(String property) |
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 |
print(Object value) |
void |
printf(String format,
Object value) |
void |
printf(String format,
Object[] values) |
void |
println() |
void |
println(Object value) |
protected Object |
readResolve() |
void |
run(File file,
String[] arguments) |
Object |
sleep(long arg)
Effectively overrides
DefaultGroovyStaticMethods.sleep(Object, long)
so that SleepStep works even in the bare form sleep 5 . |
public CpsScript() throws IOException
CpsFlowExecution
.IOException
public final Object invokeMethod(String name, Object args)
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.
invokeMethod
in interface groovy.lang.GroovyObject
invokeMethod
in class groovy.lang.Script
public Object getProperty(String property)
getProperty
in interface groovy.lang.GroovyObject
getProperty
in class groovy.lang.Script
@CheckForNull public Run<?,?> $build() throws IOException
IOException
@CheckForNull public Run<?,?> $buildNoException()
public Object evaluate(String script) throws org.codehaus.groovy.control.CompilationFailedException
evaluate
in class groovy.lang.Script
org.codehaus.groovy.control.CompilationFailedException
public Object evaluate(File file) throws org.codehaus.groovy.control.CompilationFailedException, IOException
evaluate
in class groovy.lang.Script
org.codehaus.groovy.control.CompilationFailedException
IOException
public void run(File file, String[] arguments) throws org.codehaus.groovy.control.CompilationFailedException, IOException
run
in class groovy.lang.Script
org.codehaus.groovy.control.CompilationFailedException
IOException
protected Object readResolve()
public void println()
println
in class groovy.lang.Script
public void print(Object value)
print
in class groovy.lang.Script
public void println(Object value)
println
in class groovy.lang.Script
public void printf(String format, Object value)
printf
in class groovy.lang.Script
public void printf(String format, Object[] values)
printf
in class groovy.lang.Script
public Object sleep(long arg)
DefaultGroovyStaticMethods.sleep(Object, long)
so that SleepStep
works even in the bare form sleep 5
.CpsClosure2.sleep(long)
Copyright © 2016–2020. All rights reserved.