Class AbstractGitExecutor
- java.lang.Object
-
- com.atlassian.bamboo.plugins.git.v2.AbstractGitExecutor
-
- Direct Known Subclasses:
GitBambooSpecsHandler,GitBranchCreator,GitBranchDetector,GitChangeDetector,GitConnectionTester,GitTagCreator,GitTagsHandler,GitVariableGenerator,GitWorkingCopyManager
public abstract class AbstractGitExecutor extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected BuildDirectoryManagerbuildDirectoryManagerprotected BuildLoggingContextbuildLoggingContextprotected CustomVariableContextcustomVariableContextstatic StringDEFAULT_BRANCHprotected com.atlassian.sal.api.message.I18nResolveri18nResolverprotected SshProxyServicesshProxyServiceprotected TrustedKeyHelpertrustedKeyHelper
-
Constructor Summary
Constructors Constructor Description AbstractGitExecutor(CapabilityContext capabilityContext, CredentialsAccessor credentialsAccessor, CustomVariableContext customVariableContext, BuildDirectoryManager buildDirectoryManager, com.atlassian.sal.api.message.I18nResolver i18nResolver, TrustedKeyHelper trustedKeyHelper, SshProxyService sshProxyService, BuildLoggingContext buildLoggingContext)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidfetchCacheWithRetry(@NotNull GitOperationHelper connector, @NotNull File cacheDirectory, @NotNull HashAndSource hashAndSource, @NotNull BuildLogger buildLogger, boolean fetchTagsByDefault, boolean fetchLfsFiles)protected voidfetchWithRetry(@NotNull GitOperationHelper connector, @NotNull File targetPath, @NotNull HashAndSource hashAndSource, @NotNull BuildLogger buildLogger, boolean useShallow)protected GitRepositoryAccessDatagetAccessData(@NotNull VcsRepositoryData vcsRepositoryData)protected FilegetCacheDirectory(@NotNull GitRepositoryAccessData substitutedAccessData)Deprecated.since 6.0 usegetCachePath(GitRepositoryAccessData)insteadprotected PathgetCachePath(@NotNull GitRepositoryAccessData substitutedAccessData)@Nullable StringgetGitCapability()static @NotNull StringgetSharedCredentialsIdField(@NotNull Map<String,String> config)@Nullable StringgetSshCapability()protected GitRepositoryAccessDatagetSubstitutedAccessData(@NotNull VcsRepositoryData vcsRepositoryData)protected GitRepositoryAccessData.BuildergetSubstitutedAccessDataBuilder(@NotNull VcsRepositoryData vcsRepositoryData)@Nullable FilegetWorkingDirectory()static booleanisUsingSharedCredentials(@NotNull Map<String,String> serverCfg)protected voidrethrowOrRemoveDirectory(@Nullable Exception originalException, @NotNull GitOperationHelper operationHelper, @NotNull BuildLogger buildLogger, @NotNull File directory, @NotNull String i18nKey)protected StringsubstituteString(@Nullable String stringWithValuesToSubstitute)
-
-
-
Field Detail
-
DEFAULT_BRANCH
public static final String DEFAULT_BRANCH
- See Also:
- Constant Field Values
-
sshProxyService
protected final SshProxyService sshProxyService
-
customVariableContext
protected final CustomVariableContext customVariableContext
-
buildDirectoryManager
protected final BuildDirectoryManager buildDirectoryManager
-
i18nResolver
protected final com.atlassian.sal.api.message.I18nResolver i18nResolver
-
trustedKeyHelper
protected final TrustedKeyHelper trustedKeyHelper
-
buildLoggingContext
protected final BuildLoggingContext buildLoggingContext
-
-
Constructor Detail
-
AbstractGitExecutor
@Inject public AbstractGitExecutor(CapabilityContext capabilityContext, CredentialsAccessor credentialsAccessor, CustomVariableContext customVariableContext, BuildDirectoryManager buildDirectoryManager, com.atlassian.sal.api.message.I18nResolver i18nResolver, TrustedKeyHelper trustedKeyHelper, SshProxyService sshProxyService, BuildLoggingContext buildLoggingContext)
-
-
Method Detail
-
getWorkingDirectory
@Nullable public @Nullable File getWorkingDirectory()
-
getGitCapability
@Nullable public @Nullable String getGitCapability()
-
getSshCapability
@Nullable public @Nullable String getSshCapability()
-
substituteString
protected String substituteString(@Nullable @Nullable String stringWithValuesToSubstitute)
-
isUsingSharedCredentials
public static boolean isUsingSharedCredentials(@NotNull @NotNull Map<String,String> serverCfg)
-
getSharedCredentialsIdField
@NotNull public static @NotNull String getSharedCredentialsIdField(@NotNull @NotNull Map<String,String> config)
-
getAccessData
protected GitRepositoryAccessData getAccessData(@NotNull @NotNull VcsRepositoryData vcsRepositoryData)
-
getSubstitutedAccessDataBuilder
protected GitRepositoryAccessData.Builder getSubstitutedAccessDataBuilder(@NotNull @NotNull VcsRepositoryData vcsRepositoryData)
-
getSubstitutedAccessData
protected GitRepositoryAccessData getSubstitutedAccessData(@NotNull @NotNull VcsRepositoryData vcsRepositoryData)
-
getCacheDirectory
@Deprecated protected File getCacheDirectory(@NotNull @NotNull GitRepositoryAccessData substitutedAccessData)
Deprecated.since 6.0 usegetCachePath(GitRepositoryAccessData)instead
-
getCachePath
protected Path getCachePath(@NotNull @NotNull GitRepositoryAccessData substitutedAccessData)
-
fetchCacheWithRetry
protected void fetchCacheWithRetry(@NotNull @NotNull GitOperationHelper connector, @NotNull @NotNull File cacheDirectory, @NotNull @NotNull HashAndSource hashAndSource, @NotNull @NotNull BuildLogger buildLogger, boolean fetchTagsByDefault, boolean fetchLfsFiles) throws Exception- Throws:
Exception
-
fetchWithRetry
protected void fetchWithRetry(@NotNull @NotNull GitOperationHelper connector, @NotNull @NotNull File targetPath, @NotNull @NotNull HashAndSource hashAndSource, @NotNull @NotNull BuildLogger buildLogger, boolean useShallow) throws Exception- Throws:
Exception
-
rethrowOrRemoveDirectory
protected void rethrowOrRemoveDirectory(@Nullable @Nullable Exception originalException, @NotNull @NotNull GitOperationHelper operationHelper, @NotNull @NotNull BuildLogger buildLogger, @NotNull @NotNull File directory, @NotNull @NotNull String i18nKey) throws Exception- Throws:
Exception
-
-