Class 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 Details

    • REMOTE_REPO_URL_CONFIG_KEY

      protected static final String REMOTE_REPO_URL_CONFIG_KEY
      See Also:
    • REMOTE_REPO_BRANCH_CONFIG_KEY

      protected static final String REMOTE_REPO_BRANCH_CONFIG_KEY
      See Also:
    • REMOTE_REPO_USERNAME_CONFIG_KEY

      protected static final String REMOTE_REPO_USERNAME_CONFIG_KEY
      See Also:
    • REMOTE_REPO_PASSWORD_CONFIG_KEY

      protected static final String REMOTE_REPO_PASSWORD_CONFIG_KEY
      See Also:
    • REMOTE_REPO_SSH_PRV_KEY_PATH_CONFIG_KEY

      protected static final String REMOTE_REPO_SSH_PRV_KEY_PATH_CONFIG_KEY
      See Also:
    • REMOTE_REPO_SSH_PRV_KEY_PASSPHRASE_CONFIG_KEY

      protected static final String REMOTE_REPO_SSH_PRV_KEY_PASSPHRASE_CONFIG_KEY
      See Also:
    • 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 Details

    • AbstractRemoteGitRepoAwareProcessor

      public AbstractRemoteGitRepoAwareProcessor(File localRepoFolder, org.craftercms.commons.git.utils.AuthConfiguratorFactory authConfiguratorFactory)
  • Method Details

    • 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 class AbstractDeploymentProcessor
      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 class AbstractDeploymentProcessor
      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 given Deployment and ChangeSet
      Overrides:
      shouldExecute in class AbstractMainDeploymentProcessor
      Parameters:
      deployment - the Deployment to check
      filteredChangeSet - the ChangeSet 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