Class AbstractRemoteGitRepoAwareProcessor
- java.lang.Object
-
- org.craftercms.deployer.impl.processors.AbstractDeploymentProcessor
-
- org.craftercms.deployer.impl.processors.AbstractMainDeploymentProcessor
-
- org.craftercms.deployer.impl.processors.git.AbstractRemoteGitRepoAwareProcessor
-
- All Implemented Interfaces:
DeploymentProcessor
,InitializableByConfigBean
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
- Direct Known Subclasses:
GitPullProcessor
,GitPushProcessor
public abstract class AbstractRemoteGitRepoAwareProcessor extends AbstractMainDeploymentProcessor
Base class for processors that work against a remote repo. It basically provides the code that is used to authenticate to the remote repository. A processor instance can be configured with the following YAML properties:- remoteRepo.url: The URL of the remote Git repo.
- remoteRepo.branch: The branch of the remote Git repo.
- 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.
- Author:
- avasquez
-
-
Field Summary
Fields Modifier and Type Field Description protected org.craftercms.commons.git.utils.AuthConfiguratorFactory
authConfiguratorFactory
protected org.craftercms.commons.git.auth.GitAuthenticationConfigurator
authenticationConfigurator
protected File
localRepoFolder
protected static String
REMOTE_REPO_BRANCH_CONFIG_KEY
protected static String
REMOTE_REPO_PASSWORD_CONFIG_KEY
protected static String
REMOTE_REPO_SSH_PRV_KEY_PASSPHRASE_CONFIG_KEY
protected static String
REMOTE_REPO_SSH_PRV_KEY_PATH_CONFIG_KEY
protected static String
REMOTE_REPO_URL_CONFIG_KEY
protected static String
REMOTE_REPO_USERNAME_CONFIG_KEY
protected String
remoteRepoBranch
protected String
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 AbstractRemoteGitRepoAwareProcessor(File localRepoFolder, org.craftercms.commons.git.utils.AuthConfiguratorFactory authConfiguratorFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.craftercms.commons.git.auth.GitAuthenticationConfigurator
createAuthenticationConfigurator(org.apache.commons.configuration2.Configuration config, String repoUrl)
protected void
doDestroy()
Allows extending classes perform any custom cleanupprotected void
doInit(org.apache.commons.configuration2.Configuration config)
Allows extending classes perform any custom initializationprotected org.eclipse.jgit.api.Git
openLocalRepository()
protected boolean
shouldExecute(Deployment deployment, ChangeSet filteredChangeSet)
Indicates if the processor should be executed for the givenDeployment
andChangeSet
-
Methods inherited from class org.craftercms.deployer.impl.processors.AbstractMainDeploymentProcessor
doExecute, doMainProcess, 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
-
REMOTE_REPO_URL_CONFIG_KEY
protected static final String REMOTE_REPO_URL_CONFIG_KEY
- See Also:
- Constant Field Values
-
REMOTE_REPO_BRANCH_CONFIG_KEY
protected static final String REMOTE_REPO_BRANCH_CONFIG_KEY
- See Also:
- Constant Field Values
-
REMOTE_REPO_USERNAME_CONFIG_KEY
protected static final String REMOTE_REPO_USERNAME_CONFIG_KEY
- See Also:
- Constant Field Values
-
REMOTE_REPO_PASSWORD_CONFIG_KEY
protected static final String REMOTE_REPO_PASSWORD_CONFIG_KEY
- See Also:
- Constant Field Values
-
REMOTE_REPO_SSH_PRV_KEY_PATH_CONFIG_KEY
protected static final String REMOTE_REPO_SSH_PRV_KEY_PATH_CONFIG_KEY
- See Also:
- Constant Field Values
-
REMOTE_REPO_SSH_PRV_KEY_PASSPHRASE_CONFIG_KEY
protected static final String REMOTE_REPO_SSH_PRV_KEY_PASSPHRASE_CONFIG_KEY
- See Also:
- Constant Field Values
-
localRepoFolder
protected File localRepoFolder
-
remoteRepoUrl
protected String remoteRepoUrl
-
remoteRepoBranch
protected String remoteRepoBranch
-
authenticationConfigurator
protected org.craftercms.commons.git.auth.GitAuthenticationConfigurator authenticationConfigurator
-
authConfiguratorFactory
protected org.craftercms.commons.git.utils.AuthConfiguratorFactory authConfiguratorFactory
-
-
Constructor Detail
-
AbstractRemoteGitRepoAwareProcessor
public AbstractRemoteGitRepoAwareProcessor(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- Specified by:
doInit
in classAbstractDeploymentProcessor
- Parameters:
config
- the bean's configuration- Throws:
org.craftercms.commons.config.ConfigurationException
- if there's configuration related exception
-
doDestroy
protected void doDestroy() throws DeployerException
Description copied from class:AbstractDeploymentProcessor
Allows extending classes perform any custom cleanup- Specified by:
doDestroy
in classAbstractDeploymentProcessor
- Throws:
DeployerException
- if an error occurs
-
shouldExecute
protected boolean shouldExecute(Deployment deployment, ChangeSet filteredChangeSet)
Description copied from class:AbstractMainDeploymentProcessor
Indicates if the processor should be executed for the givenDeployment
andChangeSet
- Overrides:
shouldExecute
in classAbstractMainDeploymentProcessor
- Parameters:
deployment
- theDeployment
to checkfilteredChangeSet
- theChangeSet
to check- Returns:
- true if the processor should be executed
-
createAuthenticationConfigurator
protected org.craftercms.commons.git.auth.GitAuthenticationConfigurator createAuthenticationConfigurator(org.apache.commons.configuration2.Configuration config, String repoUrl) throws org.craftercms.commons.config.ConfigurationException
- Throws:
org.craftercms.commons.config.ConfigurationException
-
openLocalRepository
protected org.eclipse.jgit.api.Git openLocalRepository() throws DeployerException
- Throws:
DeployerException
-
-