public class GitHubRepository extends AbstractStandaloneRepository implements AdvancedConfigurationAwareRepository, BranchInformationProvider, BranchMergingAwareRepository, CachingAwareRepository, CustomSourceDirectoryAwareRepository, CustomVariableProviderRepository, DeploymentAwareRepository, GitRepositoryFacade, PushCapableRepository, UniqueRevisionIdRepository
CachingAwareRepository.CachableOperation
administrationConfigurationAccessor, BUILD_TRIGGER_IP, buildDirectoryManager, buildLoggerManager, customVariableContext, featureManager, REPO_PREFIX, repositoryModuleDescriptor, templateRenderer, textProvider
moduleDescriptor
SELECTED_REPOSITORY, UNKNOWN_HOST
GIT_REPOSITORIES_OF_PLAN
FILTER_PATTERN_EXCLUDE, FILTER_PATTERN_INCLUDE, FILTER_PATTERN_NONE, FILTER_PATTERN_OPTION, FILTER_PATTERN_REGEX
CHANGESET_FILTER_PATTERN_REGEX, MAVEN_RELEASE_PLUGIN_EXCLUSION_PATTERN
Constructor and Description |
---|
GitHubRepository() |
Modifier and Type | Method and Description |
---|---|
void |
addDefaultValues(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) |
BuildRepositoryChanges |
collectChangesForRevision(PlanKey planKey,
String targetRevision)
Collects the changes for the targetRevision.
|
BuildRepositoryChanges |
collectChangesSinceLastBuild(String planKey,
String lastVcsRevisionKey)
Collects the changes since the lastVcsRevisionKey.
|
String |
commit(File file,
String s)
Perform a commit (dvcs commit).
|
GitHubRepositoryAccessData |
getAccessData() |
String |
getBranch() |
CacheId |
getCacheId(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() |
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.
|
String |
getName()
The display name for the repository type
|
List<VcsBranch> |
getOpenBranches(String context)
Set of open branches that are discovered in the repository. |
String |
getOptionDescription() |
String |
getPassword() |
Map<String,String> |
getPlanRepositoryVariables()
Return a map containing name->value mapping of the plan repository format variables.
|
String |
getRepository() |
String |
getUsername() |
VcsBranch |
getVcsBranch() |
boolean |
getVerboseLogs() |
boolean |
isCachingSupportedFor(CachingAwareRepository.CachableOperation cachableOperation) |
boolean |
isMergingSupported() |
boolean |
isRepositoryDifferent(Repository repository)
Checks if the current repo is the same as the given repository
|
boolean |
isUseRemoteAgentCache() |
boolean |
isUseShallowClones() |
boolean |
isUseSubmodules() |
boolean |
mergeWorkspaceWith(BuildContext buildContext,
File file,
String s)
Merges a workspace located in checkout directory with the target revision.
|
void |
populateFromConfig(org.apache.commons.configuration.HierarchicalConfiguration config)
Update the current object with data in the
HierarchicalConfiguration |
void |
prepareConfigObject(BuildConfiguration buildConfiguration)
Do any preprocessing work before validation occurs.
|
void |
pushRevision(File file,
String s)
Push the specified revision to the remote directory.
|
String |
retrieveSourceCode(BuildContext buildContext,
String vcsRevision) |
String |
retrieveSourceCode(BuildContext buildContext,
String vcsRevisionKey,
File sourceDirectory)
Checks out the latest source code from an appropriate repository to specified directory
|
String |
retrieveSourceCode(BuildContext buildContext,
String vcsRevisionKey,
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 |
setTemplateRenderer(TemplateRenderer templateRenderer) |
void |
setTrustedKeyHelper(TrustedKeyHelper trustedKeyHelper) |
void |
setVcsBranch(VcsBranch vcsBranch)
Set and prepare the repository for using an arbitrary branch.
|
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
|
ErrorCollection |
validate(BuildConfiguration buildConfiguration)
Validates the properties in the
BuildConfiguration object. |
getAdvancedEditHtml, getAdvancedViewHtml, getEditHtml, getViewHtml, getViewHtml
checkConnection, 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, setTextProvider, setWorkingDir, substituteString, toMergeCapableRepository
populateContextForEdit, populateContextForView
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAdvancedEditHtml, getAdvancedViewHtml
checkConnection, getKey, getLocationIdentifier, getMinimalEditHtml, getShortKey
getSourceCodeDirectory
customizeBuildRequirements, removeBuildRequirements
isConfigurationMissing
init
getEditHtml, getViewHtml
getDescription
getBranchIntegrationEditHtml
public void setBuildDirectoryManager(BuildDirectoryManager buildDirectoryManager)
setBuildDirectoryManager
in class AbstractRepository
public void setBuildLoggerManager(BuildLoggerManager buildLoggerManager)
setBuildLoggerManager
in class AbstractRepository
public void setI18nResolver(com.atlassian.sal.api.message.I18nResolver i18nResolver)
public void setTrustedKeyHelper(TrustedKeyHelper trustedKeyHelper)
public void setCustomVariableContext(CustomVariableContext customVariableContext)
setCustomVariableContext
in class AbstractRepository
public void setCapabilityContext(CapabilityContext capabilityContext)
public void setSshProxyService(SshProxyService sshProxyService)
public void setBranchIntegrationHelper(VcsBranchIntegrationHelper branchIntegrationHelper)
public void setTemplateRenderer(TemplateRenderer templateRenderer)
setTemplateRenderer
in class AbstractRepository
@NotNull public String getName()
Repository
getName
in interface Repository
getName
in interface DescriptionProvider
getName
in interface NameProvider
public String getHost()
Repository
getHost
in interface Repository
public boolean isRepositoryDifferent(@NotNull Repository repository)
RepositoryV2
isRepositoryDifferent
in interface RepositoryV2
repository
- to compare againstpublic void addDefaultValues(@NotNull BuildConfiguration buildConfiguration)
BuildConfigurationAwarePlugin
RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)
addDefaultValues
in interface BuildConfigurationAwarePlugin
addDefaultValues
in class AbstractRepository
buildConfiguration
- -public void prepareConfigObject(@NotNull BuildConfiguration buildConfiguration)
BuildConfigurationAwarePlugin
prepareConfigObject
in interface BuildConfigurationAwarePlugin
prepareConfigObject
in class BaseBuildConfigurationAwarePlugin
buildConfiguration
- -public void populateFromConfig(@NotNull org.apache.commons.configuration.HierarchicalConfiguration config)
ConvertibleFromConfig
HierarchicalConfiguration
populateFromConfig
in interface ConvertibleFromConfig
populateFromConfig
in class AbstractRepository
@NotNull public org.apache.commons.configuration.HierarchicalConfiguration toConfiguration()
ConvertibleFromConfig
HierarchicalConfiguration
from the current state of the objecttoConfiguration
in interface ConvertibleFromConfig
toConfiguration
in class AbstractRepository
HierarchicalConfiguration
. Never null@NotNull public ErrorCollection validate(@NotNull BuildConfiguration buildConfiguration)
BuildConfigurationAwarePlugin
BuildConfiguration
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 BuildConfigurationAwarePlugin
validate
in class AbstractRepository
buildConfiguration
- -ErrorCollection
keyed by the field name.@NotNull public BuildRepositoryChanges collectChangesForRevision(@NotNull PlanKey planKey, @NotNull String targetRevision) throws RepositoryException
OnceOffCapableRepository
collectChangesForRevision
in interface OnceOffCapableRepository
collectChangesForRevision
in class AbstractRepository
RepositoryException
- if something goes wrong@NotNull public BuildRepositoryChanges collectChangesSinceLastBuild(@NotNull String planKey, @Nullable String lastVcsRevisionKey) throws RepositoryException
RepositoryV2
collectChangesSinceLastBuild
in interface RepositoryV2
lastVcsRevisionKey
- can be null, if null you should ensure the correct vcsrevisionkey is returned in the BuildChanges object.RepositoryException
- if something goes wrong@NotNull public String retrieveSourceCode(@NotNull BuildContext buildContext, @Nullable String vcsRevision) throws RepositoryException
RepositoryException
@NotNull public String retrieveSourceCode(@NotNull BuildContext buildContext, @Nullable String vcsRevisionKey, @NotNull File sourceDirectory) throws RepositoryException
CustomSourceDirectoryAwareRepository
retrieveSourceCode
in interface CustomSourceDirectoryAwareRepository
vcsRevisionKey
- - may be null if you want latest codesourceDirectory
- - directory to checkout toRepositoryException
@NotNull public String retrieveSourceCode(@NotNull BuildContext buildContext, @Nullable String vcsRevisionKey, @NotNull File sourceDirectory, int depth) throws RepositoryException
BranchMergingAwareRepository
retrieveSourceCode
in interface BranchMergingAwareRepository
vcsRevisionKey
- - 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)RepositoryException
public 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()
@NotNull public List<VcsBranch> getOpenBranches(@Nullable String context) throws RepositoryException
BranchDetectionCapableRepository
Set
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 BranchDetectionCapableRepository
List
of branch names. May be empty.RepositoryException
@NotNull public VcsBranch getVcsBranch()
getVcsBranch
in interface BranchAwareRepository
public void setVcsBranch(@NotNull VcsBranch vcsBranch)
BranchAwareRepository
setVcsBranch
in interface BranchAwareRepository
public CacheId getCacheId(@NotNull CachingAwareRepository.CachableOperation cachableOperation)
CachingAwareRepository
getCacheId
in interface CachingAwareRepository
public boolean isCachingSupportedFor(@NotNull CachingAwareRepository.CachableOperation cachableOperation)
isCachingSupportedFor
in interface CachingAwareRepository
public CommitContext getLastCommit() throws RepositoryException
BranchDetectionCapableRepository
getLastCommit
in interface BranchDetectionCapableRepository
RepositoryException
public CommitContext getFirstCommit() throws RepositoryException
BranchDetectionCapableRepository
getFirstCommit
in interface BranchDetectionCapableRepository
RepositoryException
public boolean mergeWorkspaceWith(@NotNull BuildContext buildContext, @NotNull File file, @NotNull String s) throws RepositoryException
BranchMergingAwareRepository
mergeWorkspaceWith
in interface BranchMergingAwareRepository
buildContext
- the build context of build doing the mergefile
- the workspace to use for merges
- the revision to merge withRepositoryException
public boolean isMergingSupported()
isMergingSupported
in interface BranchMergingAwareRepository
public void pushRevision(@NotNull File file, @Nullable String s) throws RepositoryException
PushCapableRepository
pushRevision
in interface PushCapableRepository
file
- - 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 String commit(@NotNull File file, @NotNull String s) throws RepositoryException
PushCapableRepository
commit
in interface PushCapableRepository
file
- - 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 GitRepositoryFacade
public boolean usePollingForBranchDetection()
BranchInformationProvider
usePollingForBranchDetection
in interface BranchInformationProvider
@NotNull public Map<String,String> getCustomVariables()
CustomVariableProviderRepository
Null values will be filtered out so it's safe to put them in the map.
getCustomVariables
in interface CustomVariableProviderRepository
@NotNull public Map<String,String> getPlanRepositoryVariables()
CustomVariableProviderRepository
Null values will be filtered out so it's safe to put them in the map.
getPlanRepositoryVariables
in interface CustomVariableProviderRepository
Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.