Class SiteRepositoryUpgradePipelineImpl

  • All Implemented Interfaces:
    org.craftercms.commons.upgrade.UpgradePipeline<String>

    public class SiteRepositoryUpgradePipelineImpl
    extends org.craftercms.commons.upgrade.impl.pipeline.DefaultUpgradePipelineImpl<String>
    Implementation of UpgradePipeline that handles a git repository to work on a temporary branch for upgrades.
    Author:
    joseross
    • Constructor Detail

      • SiteRepositoryUpgradePipelineImpl

        public SiteRepositoryUpgradePipelineImpl​(String name,
                                                 List<org.craftercms.commons.upgrade.UpgradeOperation<String>> upgradeOperations)
    • Method Detail

      • createTemporaryBranch

        protected void createTemporaryBranch​(String site,
                                             org.eclipse.jgit.api.Git git)
                                      throws org.eclipse.jgit.api.errors.GitAPIException
        Throws:
        org.eclipse.jgit.api.errors.GitAPIException
      • checkoutBranch

        protected void checkoutBranch​(String branch,
                                      org.eclipse.jgit.api.Git git)
                               throws org.eclipse.jgit.api.errors.GitAPIException
        Throws:
        org.eclipse.jgit.api.errors.GitAPIException
      • mergeTemporaryBranch

        protected void mergeTemporaryBranch​(org.eclipse.jgit.lib.Repository repository,
                                            org.eclipse.jgit.api.Git git)
                                     throws IOException,
                                            org.eclipse.jgit.api.errors.GitAPIException
        Throws:
        IOException
        org.eclipse.jgit.api.errors.GitAPIException
      • deleteTemporaryBranch

        protected void deleteTemporaryBranch​(org.eclipse.jgit.api.Git git)
                                      throws org.eclipse.jgit.api.errors.GitAPIException
        Throws:
        org.eclipse.jgit.api.errors.GitAPIException
      • execute

        public void execute​(org.craftercms.commons.upgrade.impl.UpgradeContext<String> context)
                     throws org.craftercms.commons.upgrade.exception.UpgradeException
        Specified by:
        execute in interface org.craftercms.commons.upgrade.UpgradePipeline<String>
        Overrides:
        execute in class org.craftercms.commons.upgrade.impl.pipeline.DefaultUpgradePipelineImpl<String>
        Throws:
        org.craftercms.commons.upgrade.exception.UpgradeException
      • setSiteSandboxBranch

        public void setSiteSandboxBranch​(String siteSandboxBranch)
      • setSiteUpgradeBranch

        public void setSiteUpgradeBranch​(String siteUpgradeBranch)
      • setCommitMessage

        public void setCommitMessage​(String commitMessage)
      • setSiteService

        public void setSiteService​(SiteService siteService)
      • setGeneralLockService

        public void setGeneralLockService​(GeneralLockService generalLockService)
      • setGitRepositoryHelper

        public void setGitRepositoryHelper​(GitRepositoryHelper gitRepositoryHelper)