Class JGitEnvironmentRepository

All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, EnvironmentRepository, SearchPathLocator, org.springframework.context.ResourceLoaderAware, org.springframework.core.Ordered
Direct Known Subclasses:
MultipleJGitEnvironmentRepository, MultipleJGitEnvironmentRepository.PatternMatchingJGitEnvironmentRepository

public class JGitEnvironmentRepository extends AbstractScmEnvironmentRepository implements EnvironmentRepository, SearchPathLocator, org.springframework.beans.factory.InitializingBean
An EnvironmentRepository backed by a single git repository.
Author:
Dave Syer, Roy Clarkson, Marcos Barbero, Daniel Lavoie, Ryan Lynch, Gareth Clay, ChaoDong Xi
  • Field Details

  • Constructor Details

    • JGitEnvironmentRepository

      public JGitEnvironmentRepository(org.springframework.core.env.ConfigurableEnvironment environment, JGitEnvironmentProperties properties)
  • Method Details

    • isTryMasterBranch

      public boolean isTryMasterBranch()
    • setTryMasterBranch

      public void setTryMasterBranch(boolean tryMasterBranch)
    • isCloneOnStart

      public boolean isCloneOnStart()
    • setCloneOnStart

      public void setCloneOnStart(boolean cloneOnStart)
    • getTimeout

      public int getTimeout()
    • setTimeout

      public void setTimeout(int timeout)
    • getRefreshRate

      public int getRefreshRate()
    • setRefreshRate

      public void setRefreshRate(int refreshRate)
    • getTransportConfigCallback

      public org.eclipse.jgit.api.TransportConfigCallback getTransportConfigCallback()
    • setTransportConfigCallback

      public void setTransportConfigCallback(org.eclipse.jgit.api.TransportConfigCallback transportConfigCallback)
    • getGitFactory

      public JGitEnvironmentRepository.JGitFactory getGitFactory()
    • setGitFactory

      public void setGitFactory(JGitEnvironmentRepository.JGitFactory gitFactory)
    • setGitCredentialsProviderFactory

      public void setGitCredentialsProviderFactory(GitCredentialsProviderFactory gitCredentialsProviderFactory)
    • getDefaultLabel

      public String getDefaultLabel()
    • setDefaultLabel

      public void setDefaultLabel(String defaultLabel)
    • isForcePull

      public boolean isForcePull()
    • setForcePull

      public void setForcePull(boolean forcePull)
    • isDeleteUntrackedBranches

      public boolean isDeleteUntrackedBranches()
    • setDeleteUntrackedBranches

      public void setDeleteUntrackedBranches(boolean deleteUntrackedBranches)
    • isSkipSslValidation

      public boolean isSkipSslValidation()
    • setSkipSslValidation

      public void setSkipSslValidation(boolean skipSslValidation)
    • getLocations

      public SearchPathLocator.Locations getLocations(String application, String profile, String label)
      Specified by:
      getLocations in interface SearchPathLocator
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • refresh

      public String refresh(String label)
      Get the working directory ready.
      Parameters:
      label - label to refresh
      Returns:
      head id
    • shouldPull

      protected boolean shouldPull(org.eclipse.jgit.api.Git git) throws org.eclipse.jgit.api.errors.GitAPIException
      Throws:
      org.eclipse.jgit.api.errors.GitAPIException
    • onPullInvalidIndex

      protected void onPullInvalidIndex(org.eclipse.jgit.api.Git git, org.eclipse.jgit.api.errors.JGitInternalException e)
    • fetch

      protected org.eclipse.jgit.transport.FetchResult fetch(org.eclipse.jgit.api.Git git, String label)
    • warn

      protected void warn(String message, Exception ex)
    • getLastRefresh

      public long getLastRefresh()
    • setLastRefresh

      public void setLastRefresh(long lastRefresh)