Class GitPushProcessor
- java.lang.Object
-
- org.craftercms.deployer.impl.processors.AbstractDeploymentProcessor
-
- org.craftercms.deployer.impl.processors.AbstractMainDeploymentProcessor
-
- org.craftercms.deployer.impl.processors.git.AbstractRemoteGitRepoAwareProcessor
-
- org.craftercms.deployer.impl.processors.git.GitPushProcessor
-
- All Implemented Interfaces:
DeploymentProcessor
,InitializableByConfigBean
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
public class GitPushProcessor extends AbstractRemoteGitRepoAwareProcessor
Processor that pushes a localRepo to a remote Git repository. A processor instance can be configured with the following YAML properties:- localRepoBranch: The branch of the local repo to push.
- remoteRepo.url: The URL of the remote Git repo to push to.
- remoteRepo.branch: The branch of the remote Git repo to push to.
- remoteRepo.username: The username for authentication with the remote Git repo. Not needed when SSH with RSA key pair authentication is used.
- remoteRepo.password: The password for authentication with the remote Git repo. Not needed when SSH with RSA key pair authentication is used.
- remoteRepo.ssh.privateKey.path: The SSH private key path, used only with SSH with RSA key pair authentication.
- remoteRepo.ssh.privateKey.passphrase: The SSH private key passphrase, used only with SSH withRSA key pair authentication.
- force: sets the force preference for the push.
- pushAll: if all local branches should be pushed to the remote.
- Author:
- avasquez
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
force
protected static String
FORCE_CONFIG_KEY
protected static String
LOCAL_BRANCH_CONFIG_KEY
protected String
localBranch
protected static String
PUSH_ALL_CONFIG_KEY
protected boolean
pushAll
-
Fields inherited from class org.craftercms.deployer.impl.processors.git.AbstractRemoteGitRepoAwareProcessor
authConfiguratorFactory, authenticationConfigurator, localRepoFolder, REMOTE_REPO_BRANCH_CONFIG_KEY, REMOTE_REPO_PASSWORD_CONFIG_KEY, REMOTE_REPO_SSH_PRV_KEY_PASSPHRASE_CONFIG_KEY, REMOTE_REPO_SSH_PRV_KEY_PATH_CONFIG_KEY, REMOTE_REPO_URL_CONFIG_KEY, REMOTE_REPO_USERNAME_CONFIG_KEY, remoteRepoBranch, remoteRepoUrl
-
Fields inherited from class org.craftercms.deployer.impl.processors.AbstractMainDeploymentProcessor
FAIL_DEPLOYMENT_CONFIG_KEY, failDeploymentOnFailure
-
Fields 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 Constructor Description GitPushProcessor(File localRepoFolder, org.craftercms.commons.git.utils.AuthConfiguratorFactory authConfiguratorFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
checkPushResults(Iterable<org.eclipse.jgit.transport.PushResult> pushResults, List<String> detailList)
protected boolean
checkRemoteRefUpdate(org.eclipse.jgit.transport.RemoteRefUpdate update, List<String> detailList)
protected void
doInit(org.apache.commons.configuration2.Configuration config)
Allows extending classes perform any custom initializationprotected ChangeSet
doMainProcess(Deployment deployment, ProcessorExecution execution, ChangeSet filteredChangeSet, ChangeSet originalChangeSet)
protected void
doPush(ProcessorExecution execution)
-
Methods inherited from class org.craftercms.deployer.impl.processors.git.AbstractRemoteGitRepoAwareProcessor
createAuthenticationConfigurator, doDestroy, openLocalRepository, shouldExecute
-
Methods inherited from class org.craftercms.deployer.impl.processors.AbstractMainDeploymentProcessor
doExecute, failDeploymentOnProcessorFailure, init
-
Methods inherited from class org.craftercms.deployer.impl.processors.AbstractDeploymentProcessor
destroy, execute, getFilteredChangeSet, isJumpToActive, isPostDeployment, setBeanName, setEnv, setSiteName, setTargetId, shouldIncludeFile, startJumpTo, supportsMode
-
-
-
-
Field Detail
-
FORCE_CONFIG_KEY
protected static final String FORCE_CONFIG_KEY
- See Also:
- Constant Field Values
-
PUSH_ALL_CONFIG_KEY
protected static final String PUSH_ALL_CONFIG_KEY
- See Also:
- Constant Field Values
-
LOCAL_BRANCH_CONFIG_KEY
protected static final String LOCAL_BRANCH_CONFIG_KEY
- See Also:
- Constant Field Values
-
force
protected boolean force
-
pushAll
protected boolean pushAll
-
localBranch
protected String localBranch
-
-
Constructor Detail
-
GitPushProcessor
public GitPushProcessor(File localRepoFolder, org.craftercms.commons.git.utils.AuthConfiguratorFactory authConfiguratorFactory)
-
-
Method Detail
-
doInit
protected void doInit(org.apache.commons.configuration2.Configuration config) throws org.craftercms.commons.config.ConfigurationException
Description copied from class:AbstractDeploymentProcessor
Allows extending classes perform any custom initialization- Overrides:
doInit
in classAbstractRemoteGitRepoAwareProcessor
- Parameters:
config
- the bean's configuration- Throws:
org.craftercms.commons.config.ConfigurationException
- if there's configuration related exception
-
doMainProcess
protected ChangeSet doMainProcess(Deployment deployment, ProcessorExecution execution, ChangeSet filteredChangeSet, ChangeSet originalChangeSet) throws DeployerException
Description copied from class:AbstractMainDeploymentProcessor
Performs the actual work of processing the files in theChangeSet
, it is also possible to return a newChangeSet
to be used for the following processors in the pipeline- Specified by:
doMainProcess
in classAbstractMainDeploymentProcessor
- 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
ChangeSet
or null - Throws:
DeployerException
- if there is any error processing theChangeSet
-
doPush
protected void doPush(ProcessorExecution execution) throws DeployerException
- Throws:
DeployerException
-
checkPushResults
protected boolean checkPushResults(Iterable<org.eclipse.jgit.transport.PushResult> pushResults, List<String> detailList) throws DeployerException
- Throws:
DeployerException
-
checkRemoteRefUpdate
protected boolean checkRemoteRefUpdate(org.eclipse.jgit.transport.RemoteRefUpdate update, List<String> detailList) throws DeployerException
- Throws:
DeployerException
-
-