public class JGitEnvironmentRepository extends AbstractScmEnvironmentRepository implements EnvironmentRepository, SearchPathLocator, org.springframework.beans.factory.InitializingBean
EnvironmentRepository
backed by a single git repository.Modifier and Type | Class and Description |
---|---|
static class |
JGitEnvironmentRepository.JGitFactory
Wraps the static method calls to
Git and
CloneCommand allowing for easier unit testing. |
SearchPathLocator.Locations
Modifier and Type | Field and Description |
---|---|
static String |
MESSAGE
Error message for URI for git repo.
|
logger
Constructor and Description |
---|
JGitEnvironmentRepository(org.springframework.core.env.ConfigurableEnvironment environment,
JGitEnvironmentProperties properties) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected org.eclipse.jgit.transport.FetchResult |
fetch(org.eclipse.jgit.api.Git git,
String label) |
String |
getDefaultLabel() |
JGitEnvironmentRepository.JGitFactory |
getGitFactory() |
long |
getLastRefresh() |
SearchPathLocator.Locations |
getLocations(String application,
String profile,
String label) |
int |
getRefreshRate() |
int |
getTimeout() |
org.eclipse.jgit.api.TransportConfigCallback |
getTransportConfigCallback() |
boolean |
isCloneOnStart() |
boolean |
isDeleteUntrackedBranches() |
boolean |
isForcePull() |
boolean |
isSkipSslValidation() |
String |
refresh(String label)
Get the working directory ready.
|
void |
setCloneOnStart(boolean cloneOnStart) |
void |
setDefaultLabel(String defaultLabel) |
void |
setDeleteUntrackedBranches(boolean deleteUntrackedBranches) |
void |
setForcePull(boolean forcePull) |
void |
setGitCredentialsProviderFactory(GitCredentialsProviderFactory gitCredentialsProviderFactory) |
void |
setGitFactory(JGitEnvironmentRepository.JGitFactory gitFactory) |
void |
setLastRefresh(long lastRefresh) |
void |
setRefreshRate(int refreshRate) |
void |
setSkipSslValidation(boolean skipSslValidation) |
void |
setTimeout(int timeout) |
void |
setTransportConfigCallback(org.eclipse.jgit.api.TransportConfigCallback transportConfigCallback) |
protected boolean |
shouldPull(org.eclipse.jgit.api.Git git) |
protected void |
warn(String message,
Exception ex) |
findOne, getOrder, setOrder
createBaseDir, getBasedir, getEnvironment, getPassphrase, getPassword, getSearchLocations, getSearchPaths, getUri, getUsername, getWorkingDirectory, isStrictHostKeyChecking, setBasedir, setEnvironment, setPassphrase, setPassword, setResourceLoader, setSearchPaths, setStrictHostKeyChecking, setUri, setUsername
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findOne
public static final String MESSAGE
public JGitEnvironmentRepository(org.springframework.core.env.ConfigurableEnvironment environment, JGitEnvironmentProperties properties)
public boolean isCloneOnStart()
public void setCloneOnStart(boolean cloneOnStart)
public int getTimeout()
public void setTimeout(int timeout)
public int getRefreshRate()
public void setRefreshRate(int refreshRate)
public org.eclipse.jgit.api.TransportConfigCallback getTransportConfigCallback()
public void setTransportConfigCallback(org.eclipse.jgit.api.TransportConfigCallback transportConfigCallback)
public JGitEnvironmentRepository.JGitFactory getGitFactory()
public void setGitFactory(JGitEnvironmentRepository.JGitFactory gitFactory)
public void setGitCredentialsProviderFactory(GitCredentialsProviderFactory gitCredentialsProviderFactory)
public String getDefaultLabel()
public void setDefaultLabel(String defaultLabel)
public boolean isForcePull()
public void setForcePull(boolean forcePull)
public boolean isDeleteUntrackedBranches()
public void setDeleteUntrackedBranches(boolean deleteUntrackedBranches)
public boolean isSkipSslValidation()
public void setSkipSslValidation(boolean skipSslValidation)
public SearchPathLocator.Locations getLocations(String application, String profile, String label)
getLocations
in interface SearchPathLocator
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public String refresh(String label)
label
- label to refreshprotected boolean shouldPull(org.eclipse.jgit.api.Git git) throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIException
protected org.eclipse.jgit.transport.FetchResult fetch(org.eclipse.jgit.api.Git git, String label)
public long getLastRefresh()
public void setLastRefresh(long lastRefresh)
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.