public class GitHubRepository extends AbstractStandaloneRepository implements AdvancedConfigurationAwareRepository, BranchInformationProvider, BranchMergingAwareRepository, CachingAwareRepository, CustomSourceDirectoryAwareRepository, CustomVariableProviderRepository, DeploymentAwareRepository, GitRepositoryFacade, PushCapableRepository, UniqueRevisionIdRepository
CachingAwareRepository.CachableOperationadministrationConfigurationAccessor, BUILD_TRIGGER_IP, buildDirectoryManager, buildLoggerManager, customVariableContext, featureManager, REPO_PREFIX, repositoryModuleDescriptor, templateRenderer, textProvidermoduleDescriptorSELECTED_REPOSITORY, UNKNOWN_HOSTGIT_REPOSITORIES_OF_PLANFILTER_PATTERN_EXCLUDE, FILTER_PATTERN_INCLUDE, FILTER_PATTERN_NONE, FILTER_PATTERN_OPTION, FILTER_PATTERN_REGEXCHANGESET_FILTER_PATTERN_REGEX, MAVEN_RELEASE_PLUGIN_EXCLUSION_PATTERN| Constructor and Description |
|---|
GitHubRepository() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDefaultValues(@NotNull BuildConfiguration buildConfiguration)
Extension point for adding default values to the form for
RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan) |
@NotNull BuildRepositoryChanges |
collectChangesForRevision(@NotNull PlanKey planKey,
@NotNull String targetRevision)
Collects the changes for the targetRevision.
|
@NotNull BuildRepositoryChanges |
collectChangesSinceLastBuild(@NotNull String planKey,
@Nullable String lastVcsRevisionKey)
Collects the changes since the lastVcsRevisionKey.
|
@NotNull String |
commit(@NotNull File file,
@NotNull String s)
Perform a commit (dvcs commit).
|
GitHubRepositoryAccessData |
getAccessData() |
String |
getBaseUrl() |
String |
getBranch() |
CacheId |
getCacheId(@NotNull CachingAwareRepository.CachableOperation cachableOperation)
Cache id has to fulfill the following:
Given two Repository objects A and B, returning equal CacheId (in terms of equals()) and a cachable operation foo(),
in the following sequence of calls made in a short time period:
1.
|
int |
getCommandTimeout() |
@NotNull Map<String,String> |
getCustomVariables()
Return a map containing name->value mapping of the variables.
|
CommitContext |
getFirstCommit()
Retrieve the commit that created the Branch.
|
GitRepository |
getGitRepository() |
String |
getHost()
What's the repository server host
|
CommitContext |
getLastCommit()
Retrieve last commit on the branch set on this Repository.
|
@NotNull String |
getName()
The display name for the repository type
|
@NotNull List<VcsBranch> |
getOpenBranches(@Nullable String context)
Set of open branches that are discovered in the repository. |
String |
getOptionDescription() |
String |
getPassword() |
@NotNull Map<String,String> |
getPlanRepositoryVariables()
Return a map containing name->value mapping of the plan repository format variables.
|
String |
getRepository() |
String |
getUsername() |
@NotNull VcsBranch |
getVcsBranch() |
boolean |
getVerboseLogs() |
boolean |
isCachingSupportedFor(@NotNull CachingAwareRepository.CachableOperation cachableOperation) |
boolean |
isMergingSupported() |
boolean |
isRepositoryDifferent(@NotNull Repository repository)
Checks if the current repo is the same as the given repository
|
boolean |
isUseRemoteAgentCache() |
boolean |
isUseShallowClones() |
boolean |
isUseSubmodules() |
boolean |
mergeWorkspaceWith(@NotNull BuildContext buildContext,
@NotNull File file,
@NotNull String s)
Merges a workspace located in checkout directory with the target revision.
|
void |
populateFromConfig(@NotNull org.apache.commons.configuration.HierarchicalConfiguration config)
Update the current object with data in the
HierarchicalConfiguration |
void |
postConstruct() |
void |
prepareConfigObject(@NotNull BuildConfiguration buildConfiguration)
Do any preprocessing work before validation occurs.
|
void |
pushRevision(@NotNull File file,
@Nullable String s)
Push the specified revision to the remote directory.
|
@NotNull String |
retrieveSourceCode(@NotNull BuildContext buildContext,
@Nullable String vcsRevision) |
@NotNull String |
retrieveSourceCode(@NotNull BuildContext buildContext,
@Nullable String vcsRevisionKey,
@NotNull File sourceDirectory)
Checks out the latest source code from an appropriate repository to specified directory
|
@NotNull String |
retrieveSourceCode(@NotNull BuildContext buildContext,
@Nullable String vcsRevisionKey,
@NotNull File sourceDirectory,
int depth)
Checks out the latest source code from an appropriate repository to specified directory
|
void |
setAccessData(GitHubRepositoryAccessData gitHubAccessData) |
void |
setBranchIntegrationHelper(VcsBranchIntegrationHelper branchIntegrationHelper) |
void |
setBuildDirectoryManager(BuildDirectoryManager buildDirectoryManager) |
void |
setBuildLoggerManager(BuildLoggerManager buildLoggerManager) |
void |
setCapabilityContext(CapabilityContext capabilityContext) |
void |
setCustomVariableContext(CustomVariableContext customVariableContext) |
void |
setI18nResolver(com.atlassian.sal.api.message.I18nResolver i18nResolver) |
void |
setSshProxyService(SshProxyService sshProxyService) |
void |
setTrustedKeyHelper(TrustedKeyHelper trustedKeyHelper) |
void |
setVcsBranch(@NotNull VcsBranch vcsBranch)
Set and prepare the repository for using an arbitrary branch.
|
@NotNull org.apache.commons.configuration.HierarchicalConfiguration |
toConfiguration()
Generate a
HierarchicalConfiguration from the current state of the object |
boolean |
usePollingForBranchDetection()
If Bamboo generic detection polling should be used for this repository
|
@NotNull ErrorCollection |
validate(@NotNull BuildConfiguration buildConfiguration)
Validates the properties in the
BuildConfiguration object. |
getAdvancedEditHtml, getAdvancedViewHtml, getEditHtml, getViewHtml, getViewHtmlcheckConnection, customizeBuildRequirements, getAdvancedEditHtml, getAdvancedViewHtml, getBranchIntegrationEditHtml, getChangesetFilterPatternRegex, getDefaultTriggerModule, getDescription, getEditHtml, getFilterFilePatternOption, getFilterFilePatternRegex, getKey, getLocationIdentifier, getMavenPomCheckoutAccessEditHtml, getMaxCommitsToReturn, getMaxRetries, getMinimalEditHtml, getPollingTriggerModule, getQuietPeriod, getShortKey, getSourceCodeDirectory, getSystemWideExclusionPatterns, getViewHtml, getWorkingDirectory, init, isAdvancedOptionEnabled, isQuietPeriodEnabled, isWorkspaceEmpty, removeBuildRequirements, setAdministrationConfigurationAccessor, setChangesetFilterPatternRegex, setFeatureManager, setFilterFilePatternOption, setFilterFilePatternRegex, setTemplateRenderer, setTextProvider, setWorkingDir, substituteString, toMergeCapableRepositorygetTemplateRenderer, populateContextForEdit, populateContextForViewclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAdvancedEditHtml, getAdvancedViewHtmlcheckConnection, getKey, getLocationIdentifier, getMinimalEditHtml, getShortKeygetSourceCodeDirectorycustomizeBuildRequirements, removeBuildRequirementsisConfigurationMissinginitgetEditHtml, getViewHtmlgetDescriptiongetBranchIntegrationEditHtmlpublic void setBuildDirectoryManager(BuildDirectoryManager buildDirectoryManager)
setBuildDirectoryManager in class AbstractRepositorypublic void setBuildLoggerManager(BuildLoggerManager buildLoggerManager)
setBuildLoggerManager in class AbstractRepositorypublic void setI18nResolver(com.atlassian.sal.api.message.I18nResolver i18nResolver)
public void setTrustedKeyHelper(TrustedKeyHelper trustedKeyHelper)
public void setCustomVariableContext(CustomVariableContext customVariableContext)
setCustomVariableContext in class AbstractRepositorypublic void setCapabilityContext(CapabilityContext capabilityContext)
public void setSshProxyService(SshProxyService sshProxyService)
public void setBranchIntegrationHelper(VcsBranchIntegrationHelper branchIntegrationHelper)
@PostConstruct public void postConstruct()
@NotNull public @NotNull String getName()
RepositorygetName in interface RepositorygetName in interface DescriptionProvidergetName in interface NameProviderpublic String getHost()
RepositorygetHost in interface Repositorypublic boolean isRepositoryDifferent(@NotNull
@NotNull Repository repository)
RepositoryV2isRepositoryDifferent in interface RepositoryV2repository - to compare againstpublic void addDefaultValues(@NotNull
@NotNull BuildConfiguration buildConfiguration)
BuildConfigurationAwarePluginRenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)addDefaultValues in interface BuildConfigurationAwarePluginaddDefaultValues in class AbstractRepositorybuildConfiguration - -public void prepareConfigObject(@NotNull
@NotNull BuildConfiguration buildConfiguration)
BuildConfigurationAwarePluginprepareConfigObject in interface BuildConfigurationAwarePluginprepareConfigObject in class BaseBuildConfigurationAwarePluginbuildConfiguration - -public void populateFromConfig(@NotNull
@NotNull org.apache.commons.configuration.HierarchicalConfiguration config)
ConvertibleFromConfigHierarchicalConfigurationpopulateFromConfig in interface ConvertibleFromConfigpopulateFromConfig in class AbstractRepository@NotNull public @NotNull org.apache.commons.configuration.HierarchicalConfiguration toConfiguration()
ConvertibleFromConfigHierarchicalConfiguration from the current state of the objecttoConfiguration in interface ConvertibleFromConfigtoConfiguration in class AbstractRepositoryHierarchicalConfiguration. Never null@NotNull public @NotNull ErrorCollection validate(@NotNull @NotNull BuildConfiguration buildConfiguration)
BuildConfigurationAwarePluginBuildConfiguration object. The name of the properties match those passed
in through the form fragments in RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan) template.validate in interface BuildConfigurationAwarePluginvalidate in class AbstractRepositorybuildConfiguration - -ErrorCollection keyed by the field name.@NotNull public @NotNull BuildRepositoryChanges collectChangesForRevision(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull String targetRevision) throws RepositoryException
OnceOffCapableRepositorycollectChangesForRevision in interface OnceOffCapableRepositorycollectChangesForRevision in class AbstractRepositoryRepositoryException - if something goes wrong@NotNull public @NotNull BuildRepositoryChanges collectChangesSinceLastBuild(@NotNull @NotNull String planKey, @Nullable @Nullable String lastVcsRevisionKey) throws RepositoryException
RepositoryV2collectChangesSinceLastBuild in interface RepositoryV2lastVcsRevisionKey - can be null, if null you should ensure the correct vcsrevisionkey is returned in the BuildChanges object.RepositoryException - if something goes wrong@NotNull public @NotNull String retrieveSourceCode(@NotNull @NotNull BuildContext buildContext, @Nullable @Nullable String vcsRevision) throws RepositoryException
RepositoryException@NotNull public @NotNull String retrieveSourceCode(@NotNull @NotNull BuildContext buildContext, @Nullable @Nullable String vcsRevisionKey, @NotNull @NotNull File sourceDirectory) throws RepositoryException
CustomSourceDirectoryAwareRepositoryretrieveSourceCode in interface CustomSourceDirectoryAwareRepositoryvcsRevisionKey - - may be null if you want latest codesourceDirectory - - directory to checkout toRepositoryException@NotNull public @NotNull String retrieveSourceCode(@NotNull @NotNull BuildContext buildContext, @Nullable @Nullable String vcsRevisionKey, @NotNull @NotNull File sourceDirectory, int depth) throws RepositoryException
BranchMergingAwareRepositoryretrieveSourceCode in interface BranchMergingAwareRepositoryvcsRevisionKey - - may be null if you want latest codesourceDirectory - - directory to checkout todepth - - how many historical revisions we'd like to check out (-1 means all revisions)RepositoryExceptionpublic String getUsername()
public String getRepository()
public String getBranch()
public boolean isUseShallowClones()
public boolean isUseRemoteAgentCache()
public String getPassword()
public boolean isUseSubmodules()
public int getCommandTimeout()
public boolean getVerboseLogs()
public String getBaseUrl()
@NotNull public @NotNull List<VcsBranch> getOpenBranches(@Nullable @Nullable String context) throws RepositoryException
BranchDetectionCapableRepositorySet of open branches that are discovered in the repository. Returns empty collection if no branches at
all (can that happen?). Used for monitoring repositories for new branches.
An open branch is a branch that is considered 'open' by underlying VCS - it has nothing to do with the actual
development on that branch (recent commits or so).getOpenBranches in interface BranchDetectionCapableRepositoryList of branch names. May be empty.RepositoryException@NotNull public @NotNull VcsBranch getVcsBranch()
getVcsBranch in interface BranchAwareRepositorypublic void setVcsBranch(@NotNull
@NotNull VcsBranch vcsBranch)
BranchAwareRepositorysetVcsBranch in interface BranchAwareRepositorypublic CacheId getCacheId(@NotNull @NotNull CachingAwareRepository.CachableOperation cachableOperation)
CachingAwareRepositorygetCacheId in interface CachingAwareRepositorypublic boolean isCachingSupportedFor(@NotNull
@NotNull CachingAwareRepository.CachableOperation cachableOperation)
isCachingSupportedFor in interface CachingAwareRepositorypublic CommitContext getLastCommit() throws RepositoryException
BranchDetectionCapableRepositorygetLastCommit in interface BranchDetectionCapableRepositoryRepositoryExceptionpublic CommitContext getFirstCommit() throws RepositoryException
BranchDetectionCapableRepositorygetFirstCommit in interface BranchDetectionCapableRepositoryRepositoryExceptionpublic boolean mergeWorkspaceWith(@NotNull
@NotNull BuildContext buildContext,
@NotNull
@NotNull File file,
@NotNull
@NotNull String s)
throws RepositoryException
BranchMergingAwareRepositorymergeWorkspaceWith in interface BranchMergingAwareRepositorybuildContext - the build context of build doing the mergefile - the workspace to use for merges - the revision to merge withRepositoryExceptionpublic boolean isMergingSupported()
isMergingSupported in interface BranchMergingAwareRepositorypublic void pushRevision(@NotNull
@NotNull File file,
@Nullable
@Nullable String s)
throws RepositoryException
PushCapableRepositorypushRevision in interface PushCapableRepositoryfile - - the working directory of the repository we want to push froms - - the revisionKey (usually a branch name) to pushRepositoryException - - when something goes wrong@NotNull public @NotNull String commit(@NotNull @NotNull File file, @NotNull @NotNull String s) throws RepositoryException
PushCapableRepositorycommit in interface PushCapableRepositoryfile - - which workspace directory to perform the commits - - what message use for commitRepositoryException - - when something goes wrongpublic String getOptionDescription()
public GitHubRepositoryAccessData getAccessData()
public void setAccessData(GitHubRepositoryAccessData gitHubAccessData)
public GitRepository getGitRepository()
getGitRepository in interface GitRepositoryFacadepublic boolean usePollingForBranchDetection()
BranchInformationProviderusePollingForBranchDetection in interface BranchInformationProvider@NotNull public @NotNull Map<String,String> getCustomVariables()
CustomVariableProviderRepositoryNull values will be filtered out so it's safe to put them in the map.
getCustomVariables in interface CustomVariableProviderRepository@NotNull public @NotNull Map<String,String> getPlanRepositoryVariables()
CustomVariableProviderRepositoryNull values will be filtered out so it's safe to put them in the map.
getPlanRepositoryVariables in interface CustomVariableProviderRepositoryCopyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.