public class ScriptProcessor extends AbstractMainDeploymentProcessor implements org.springframework.context.ApplicationContextAware
DeploymentProcessor that delegates execution to a Groovy script
Can be configured with the following YAML properties:
| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.context.ApplicationContext |
applicationContext |
static String |
CONFIG_KEY_SCRIPT_PATH |
protected org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor |
sandboxInterceptor |
static String |
SCRIPT_VAR_APP_CTX |
static String |
SCRIPT_VAR_DEPLOYMENT |
static String |
SCRIPT_VAR_EXECUTION |
static String |
SCRIPT_VAR_FILTERED_CHANGE_SET |
static String |
SCRIPT_VAR_LOGGER |
static String |
SCRIPT_VAR_ORIGINAL_CHANGE_SET |
protected groovy.util.GroovyScriptEngine |
scriptEngine |
protected String |
scriptPath
The relative path of the script to execute
|
FAIL_DEPLOYMENT_CONFIG_KEY, failDeploymentOnFailurealwaysRun, env, excludeFiles, includeFiles, initialized, JUMPING_TO_PARAM_NAME, jumpTo, label, name, siteName, targetId| Constructor and Description |
|---|
ScriptProcessor(groovy.util.GroovyScriptEngine scriptEngine,
org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor sandboxInterceptor) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doDestroy()
Allows extending classes perform any custom cleanup
|
protected void |
doInit(org.apache.commons.configuration2.Configuration config)
Allows extending classes perform any custom initialization
|
protected ChangeSet |
doMainProcess(Deployment deployment,
ProcessorExecution execution,
ChangeSet filteredChangeSet,
ChangeSet originalChangeSet)
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
doExecute, failDeploymentOnProcessorFailure, init, shouldExecutedestroy, execute, getFilteredChangeSet, isJumpToActive, isPostDeployment, setBeanName, setEnv, setSiteName, setTargetId, shouldIncludeFile, startJumpTopublic static final String CONFIG_KEY_SCRIPT_PATH
public static final String SCRIPT_VAR_LOGGER
public static final String SCRIPT_VAR_APP_CTX
public static final String SCRIPT_VAR_DEPLOYMENT
public static final String SCRIPT_VAR_EXECUTION
public static final String SCRIPT_VAR_FILTERED_CHANGE_SET
public static final String SCRIPT_VAR_ORIGINAL_CHANGE_SET
protected org.springframework.context.ApplicationContext applicationContext
protected final groovy.util.GroovyScriptEngine scriptEngine
protected final org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor sandboxInterceptor
protected String scriptPath
public ScriptProcessor(groovy.util.GroovyScriptEngine scriptEngine,
org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor sandboxInterceptor)
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext in interface org.springframework.context.ApplicationContextAwareprotected void doInit(org.apache.commons.configuration2.Configuration config)
throws org.craftercms.commons.config.ConfigurationException
AbstractDeploymentProcessordoInit in class AbstractDeploymentProcessorconfig - the bean's configurationorg.craftercms.commons.config.ConfigurationException - if there's configuration related exceptionprotected void doDestroy()
AbstractDeploymentProcessordoDestroy in class AbstractDeploymentProcessorprotected ChangeSet doMainProcess(Deployment deployment, ProcessorExecution execution, ChangeSet filteredChangeSet, ChangeSet originalChangeSet) throws DeployerException
AbstractMainDeploymentProcessorChangeSet, it is also possible to return a new
ChangeSet to be used for the following processors in the pipelinedoMainProcess in class AbstractMainDeploymentProcessordeployment - the current deploymentexecution - the current executionfilteredChangeSet - the filtered change set (as returned by AbstractDeploymentProcessor.getFilteredChangeSet(ChangeSet))originalChangeSet - the original change set (as returned by the previous processors in the pipeline)ChangeSet or nullDeployerException - if there is any error processing the ChangeSetCopyright © 2023. All rights reserved.