Class AbstractMainDeploymentProcessor
java.lang.Object
org.craftercms.deployer.impl.processors.AbstractDeploymentProcessor
org.craftercms.deployer.impl.processors.AbstractMainDeploymentProcessor
- All Implemented Interfaces:
DeploymentProcessor,InitializableByConfigBean,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware
- Direct Known Subclasses:
AbstractRemoteGitRepoAwareProcessor,AbstractS3Processor,AbstractSearchIndexingProcessor,CloudFrontInvalidationProcessor,CommandLineProcessor,DelayProcessor,FileBasedDeploymentEventProcessor,FindAndReplaceProcessor,GitDiffProcessor,GitUpdateCommitIdProcessor,HttpMethodCallProcessor,ScriptProcessor
Base class for
DeploymentProcessors that are executed during the main
deployment phase, which is the phase where the change set is retrieved and the files are processed.- Author:
- avasquez
-
Field Summary
FieldsFields inherited from class org.craftercms.deployer.impl.processors.AbstractDeploymentProcessor
alwaysRun, env, excludeFiles, includeFiles, JUMPING_TO_PARAM_NAME, jumpTo, label, name, siteName, targetId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ChangeSetdoExecute(Deployment deployment, ChangeSet filteredChangeSet, ChangeSet originalChangeSet) Triggers the execution of the processor for the givenDeploymentandChangeSetprotected abstract ChangeSetdoMainProcess(Deployment deployment, ProcessorExecution execution, ChangeSet filteredChangeSet, ChangeSet originalChangeSet) protected booleanIndicates if the deployment should be marked as failed if this processor throws an errorvoidinit(org.apache.commons.configuration2.Configuration config) Initializes the bean using the specified configuration.protected booleanshouldExecute(Deployment deployment, ChangeSet filteredChangeSet) Indicates if the processor should be executed for the givenDeploymentandChangeSetMethods inherited from class org.craftercms.deployer.impl.processors.AbstractDeploymentProcessor
destroy, doDestroy, doInit, execute, getDeploymentParam, getFilteredChangeSet, isJumpToActive, isPostDeployment, setBeanName, setEnv, setSiteName, setTargetId, shouldIncludeFile, startJumpTo, supportsMode
-
Field Details
-
FAIL_DEPLOYMENT_CONFIG_KEY
- See Also:
-
failDeploymentOnFailure
protected boolean failDeploymentOnFailure
-
-
Constructor Details
-
AbstractMainDeploymentProcessor
public AbstractMainDeploymentProcessor()
-
-
Method Details
-
init
public void init(org.apache.commons.configuration2.Configuration config) throws org.craftercms.commons.config.ConfigurationException, DeployerException Initializes the bean using the specified configuration.- Specified by:
initin interfaceInitializableByConfigBean- Overrides:
initin classAbstractDeploymentProcessor- Parameters:
config- the bean's configuration- Throws:
org.craftercms.commons.config.ConfigurationException- if there's configuration related exceptionDeployerException- if there's a general exception on init
-
doExecute
protected ChangeSet doExecute(Deployment deployment, ChangeSet filteredChangeSet, ChangeSet originalChangeSet) throws Exception Triggers the execution of the processor for the givenDeploymentandChangeSet- Specified by:
doExecutein classAbstractDeploymentProcessor- Parameters:
deployment- the current deploymentfilteredChangeSet- the filtered change set (as returned byAbstractDeploymentProcessor.getFilteredChangeSet(ChangeSet))originalChangeSet- the original change set (as returned by the previous processors in the pipeline)- Returns:
- a new
ChangeSetor null - Throws:
Exception- if there is any error processing theChangeSet
-
shouldExecute
Indicates if the processor should be executed for the givenDeploymentandChangeSet- Specified by:
shouldExecutein classAbstractDeploymentProcessor- Parameters:
deployment- theDeploymentto checkfilteredChangeSet- theChangeSetto check- Returns:
- true if the processor should be executed
-
doMainProcess
protected abstract ChangeSet doMainProcess(Deployment deployment, ProcessorExecution execution, ChangeSet filteredChangeSet, ChangeSet originalChangeSet) throws DeployerException Performs the actual work of processing the files in theChangeSet, it is also possible to return a newChangeSetto be used for the following processors in the pipeline- Parameters:
deployment- the current deploymentexecution- the current executionfilteredChangeSet- the filtered change set (as returned byAbstractDeploymentProcessor.getFilteredChangeSet(ChangeSet))originalChangeSet- the original change set (as returned by the previous processors in the pipeline)- Returns:
- a new
ChangeSetor null - Throws:
DeployerException- if there is any error processing theChangeSet
-
failDeploymentOnProcessorFailure
protected boolean failDeploymentOnProcessorFailure()Indicates if the deployment should be marked as failed if this processor throws an error
-