public class BitbucketRepository extends AbstractStandaloneRepository implements BranchInformationProvider, BranchMergingAwareRepository, CachingAwareRepository, CustomSourceDirectoryAwareRepository, CustomVariableProviderRepository, DeploymentAwareRepository, GitRepositoryFacade, PushCapableRepository, RequirementsAwareRepository, UniqueRevisionIdRepository, ScmTypePublishingRepository, TestConnectionAwareRepository, SharedCredentialDepender, EditActionAwareRepository
CachingAwareRepository.CachableOperationadministrationConfigurationAccessor, BUILD_TRIGGER_IP, buildDirectoryManager, buildLoggerManager, customVariableContext, featureManager, REPO_PREFIX, repositoryModuleDescriptor, templateRenderer, textProvidermoduleDescriptorSELECTED_REPOSITORY, UNKNOWN_HOSTGIT_REPOSITORIES_OF_PLANHOST_KEYFILTER_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 |
|---|
BitbucketRepository() |
| 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) |
BitbucketAuthenticationType |
authenticationType() |
void |
beforeEditPageRendering(@NotNull org.apache.commons.configuration.HierarchicalConfiguration configuration)
Action to be taken before rendering the edit page.
|
ErrorCollection |
beforeSave(@NotNull org.apache.commons.configuration.HierarchicalConfiguration configuration)
Action to be taken before repository is saved from the UI.
|
@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 sourceDirectory,
@NotNull String message)
Perform a commit (dvcs commit).
|
BitbucketAccessLevel |
getAccessLevel() |
@NotNull List<NameValuePair> |
getAccessLevels() |
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.
|
CapabilityContext |
getCapabilityContext() |
@NotNull Map<String,String> |
getCustomVariables()
Return a map containing name->value mapping of the variables.
|
CommitContext |
getFirstCommit()
Retrieve the commit that created the Branch.
|
@Nullable 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() |
@Nullable String |
getOwner() |
@Nullable String |
getPassword() |
BitbucketPasswordCredentialsSource |
getPasswordCredentialsSource() |
@NotNull List<NameValuePair> |
getPasswordCredentialsSources() |
@NotNull List<NameValuePair> |
getPasswordSharedCredentials() |
@Nullable Long |
getPasswordSharedCredentialsId() |
@NotNull Map<String,String> |
getPlanRepositoryVariables()
Return a map containing name->value mapping of the plan repository format variables.
|
@NotNull List<NameValuePair> |
getPrivateRepositoryAuthenticationTypes() |
String |
getRealRepositoryUrl() |
String |
getRepositoryOwner() |
String |
getRepositorySlug() |
@NotNull Set<Requirement> |
getRequirements() |
String |
getScm()
Get a string representing the name of the repository type.
|
@NotNull Iterable<Long> |
getSharedCredentialIds()
Returns a list of shared credential ids used by this class.
|
BitbucketSshCredentialsSource |
getSshCredentialsSource() |
@NotNull List<NameValuePair> |
getSshCredentialsSources() |
@NotNull List<NameValuePair> |
getSshSharedCredentials() |
@Nullable String |
getUsername() |
@NotNull VcsBranch |
getVcsBranch() |
boolean |
isCachingSupportedFor(@NotNull CachingAwareRepository.CachableOperation cachableOperation) |
boolean |
isFetchWholeRepository() |
boolean |
isMergingSupported() |
boolean |
isRepositoryDifferent(@NotNull Repository repository)
Checks if the current repo is the same as the given repository
|
boolean |
isVerboseLogs() |
boolean |
mergeWorkspaceWith(@NotNull BuildContext buildContext,
@NotNull File checkoutDirectory,
@NotNull String targetRevision)
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 |
prepareConfigObject(@NotNull BuildConfiguration buildConfiguration)
Do any preprocessing work before validation occurs.
|
void |
pushRevision(@NotNull File sourceDirectory,
@Nullable String vcsRevisionKey)
Push the specified revision to the remote directory.
|
@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 |
setBitbucketApiService(BitbucketApiService bitbucketApiService) |
void |
setBitbucketValidationHelper(BitbucketValidationHelper bitbucketValidationHelper) |
void |
setCapabilityContext(CapabilityContext capabilityContext) |
void |
setCredentialsAccessor(CredentialsAccessor credentialsAccessor) |
void |
setI18nResolver(com.atlassian.sal.api.message.I18nResolver i18nResolver) |
void |
setRepositoryHelperService(BitbucketRepositoryHelperService repositoryHelperService) |
void |
setRepositoryManager(RepositoryManager repositoryManager) |
void |
setVcsBranch(@NotNull VcsBranch branch)
Set and prepare the repository for using an arbitrary branch.
|
@NotNull ErrorCollection |
testConnection(long timeout,
@NotNull TimeUnit unit)
Test connection to the repository within the given timeout.
|
@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 configuration)
Validates the properties in the
BuildConfiguration object. |
@NotNull ErrorCollection |
validateForConnectionTesting(@NotNull BuildConfiguration configuration)
A method similar to
BuildConfigurationAwarePlugin.validate(BuildConfiguration) used to validate repository configuration
before connection testing. |
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, setBuildDirectoryManager, setBuildLoggerManager, setChangesetFilterPatternRegex, setCustomVariableContext, setFeatureManager, setFilterFilePatternOption, setFilterFilePatternRegex, setTemplateRenderer, setTextProvider, setWorkingDir, substituteString, toMergeCapableRepositorygetTemplateRenderer, populateContextForEdit, populateContextForViewclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckConnection, getKey, getLocationIdentifier, getMinimalEditHtml, getShortKeygetSourceCodeDirectorycustomizeBuildRequirements, removeBuildRequirementsisConfigurationMissinginitgetEditHtml, getViewHtmlgetDescriptiongetBranchIntegrationEditHtmlpublic static final String REPOSITORY_BITBUCKET_ACCESS_LEVEL
public static final String REPOSITORY_BITBUCKET_AUTHENTICATION_TYPE
public static final String REPOSITORY_BITBUCKET_OWNER
public static final String REPOSITORY_BITBUCKET_USERNAME
public static final String REPOSITORY_BITBUCKET_PASSWORD
public static final String REPOSITORY_BITBUCKET_PASSWORD_CREDENTIALS_SOURCE
public static final String REPOSITORY_BITBUCKET_PASSWORD_SHARED_CREDENTIALS_ID
public static final String REPOSITORY_BITBUCKET_PASSWORD_SHARED_CREDENTIALS_DELETED
public static final String REPOSITORY_BITBUCKET_REPOSITORY
public static final String REPOSITORY_BITBUCKET_SSH_CREDENTIALS_SOURCE
public static final String REPOSITORY_BITBUCKET_SSH_SHARED_CREDENTIALS_ID
public static final String REPOSITORY_BITBUCKET_SSH_SHARED_CREDENTIALS_DELETED
public static final String REPOSITORY_BITBUCKET_SSH_KEY
public static final String REPOSITORY_BITBUCKET_SSH_PASSPHRASE
public static final String REPOSITORY_BITBUCKET_BRANCH
public static final String REPOSITORY_BITBUCKET_COMMAND_TIMEOUT
public static final String REPOSITORY_BITBUCKET_VERBOSE_LOGS
public static final String REPOSITORY_BITBUCKET_FETCH_WHOLE_REPOSITORY
public static final String REPOSITORY_BITBUCKET_GIT_USE_SHALLOW_CLONES
public static final String REPOSITORY_BITBUCKET_GIT_LFS
public static final String REPOSITORY_BITBUCKET_GIT_USE_SUBMODULES
public static final String REPOSITORY_BITBUCKET_GIT_USE_REMOTE_AGENT_CACHE
public static final String REPOSITORY_BITBUCKET_TEMPORARY_PASSWORD
public static final String REPOSITORY_BITBUCKET_PASSWORD_CHANGE
public static final String REPOSITORY_BITBUCKET_TEMPORARY_SSH_PASSPHRASE
public static final String REPOSITORY_BITBUCKET_TEMPORARY_SSH_PASSPHRASE_CHANGE
public static final String REPOSITORY_BITBUCKET_TEMPORARY_SSH_KEY_FROM_FILE
public static final String REPOSITORY_BITBUCKET_TEMPORARY_SSH_KEY_CHANGE
public static final String REPOSITORY_BITBUCKET_WEBHOOKS_ENABLED
@NotNull public @NotNull String getName()
RepositorygetName in interface RepositorygetName in interface DescriptionProvidergetName in interface NameProviderpublic String getScm()
ScmTypePublishingRepositorygetScm in interface ScmTypePublishingRepositorypublic 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 beforeEditPageRendering(@NotNull
@NotNull org.apache.commons.configuration.HierarchicalConfiguration configuration)
EditActionAwareRepositorybeforeEditPageRendering in interface EditActionAwareRepositoryconfiguration - configuration to be loaded into the UIpublic ErrorCollection beforeSave(@NotNull @NotNull org.apache.commons.configuration.HierarchicalConfiguration configuration)
EditActionAwareRepositorybeforeSave in interface EditActionAwareRepositorypublic 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 validateForConnectionTesting(@NotNull @NotNull BuildConfiguration configuration)
TestConnectionAwareRepositoryBuildConfigurationAwarePlugin.validate(BuildConfiguration) used to validate repository configuration
before connection testing.
This method may be more relaxed than normal validation. Additionally, different error messages may be displayed
(e.g. related to impossibility of transferring files).validateForConnectionTesting in interface TestConnectionAwareRepositoryconfiguration - repository configuration to validate@NotNull public @NotNull ErrorCollection validate(@NotNull @NotNull BuildConfiguration configuration)
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 AbstractRepositoryconfiguration - -ErrorCollection keyed by the field name.@Nullable public @Nullable Long getPasswordSharedCredentialsId()
@NotNull public @NotNull Iterable<Long> getSharedCredentialIds()
SharedCredentialDependergetSharedCredentialIds in interface SharedCredentialDepender@NotNull public @NotNull List<NameValuePair> getPasswordCredentialsSources()
@NotNull public @NotNull List<NameValuePair> getSshCredentialsSources()
@NotNull public @NotNull List<NameValuePair> getPasswordSharedCredentials()
@NotNull public @NotNull List<NameValuePair> getSshSharedCredentials()
@NotNull public @NotNull List<NameValuePair> getAccessLevels()
@NotNull public @NotNull List<NameValuePair> getPrivateRepositoryAuthenticationTypes()
@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 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)RepositoryException@NotNull public @NotNull ErrorCollection testConnection(long timeout, @NotNull @NotNull TimeUnit unit)
TestConnectionAwareRepositorytestConnection in interface TestConnectionAwareRepositorytimeout - the maximum time to waitunit - the time unit of the timeout argument@NotNull public @NotNull Set<Requirement> getRequirements()
getRequirements in interface RequirementsAwareRepositorypublic void setBitbucketApiService(BitbucketApiService bitbucketApiService)
public void setRepositoryHelperService(BitbucketRepositoryHelperService repositoryHelperService)
public void setI18nResolver(com.atlassian.sal.api.message.I18nResolver i18nResolver)
public void setRepositoryManager(RepositoryManager repositoryManager)
public void setCredentialsAccessor(CredentialsAccessor credentialsAccessor)
public void setBitbucketValidationHelper(BitbucketValidationHelper bitbucketValidationHelper)
public CapabilityContext getCapabilityContext()
public void setCapabilityContext(CapabilityContext capabilityContext)
public String getRealRepositoryUrl()
public boolean isVerboseLogs()
public boolean isFetchWholeRepository()
public String getOptionDescription()
public CacheId getCacheId(@NotNull @NotNull CachingAwareRepository.CachableOperation cachableOperation)
CachingAwareRepositorygetCacheId in interface CachingAwareRepositorypublic boolean isCachingSupportedFor(@NotNull
@NotNull CachingAwareRepository.CachableOperation cachableOperation)
isCachingSupportedFor in interface CachingAwareRepository@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@Nullable public @Nullable String getOwner()
@Nullable public @Nullable String getUsername()
@Nullable public @Nullable String getPassword()
public BitbucketAccessLevel getAccessLevel()
public BitbucketAuthenticationType authenticationType()
public BitbucketPasswordCredentialsSource getPasswordCredentialsSource()
public BitbucketSshCredentialsSource getSshCredentialsSource()
public String getRepositoryOwner()
public String getRepositorySlug()
@NotNull public @NotNull VcsBranch getVcsBranch()
getVcsBranch in interface BranchAwareRepositorypublic void setVcsBranch(@NotNull
@NotNull VcsBranch branch)
BranchAwareRepositorysetVcsBranch in interface BranchAwareRepositorypublic CommitContext getFirstCommit() throws RepositoryException
BranchDetectionCapableRepositorygetFirstCommit in interface BranchDetectionCapableRepositoryRepositoryExceptionpublic CommitContext getLastCommit() throws RepositoryException
BranchDetectionCapableRepositorygetLastCommit in interface BranchDetectionCapableRepositoryRepositoryExceptionpublic boolean mergeWorkspaceWith(@NotNull
@NotNull BuildContext buildContext,
@NotNull
@NotNull File checkoutDirectory,
@NotNull
@NotNull String targetRevision)
throws RepositoryException
BranchMergingAwareRepositorymergeWorkspaceWith in interface BranchMergingAwareRepositorybuildContext - the build context of build doing the mergecheckoutDirectory - the workspace to use for mergetargetRevision - the revision to merge withRepositoryExceptionpublic boolean isMergingSupported()
isMergingSupported in interface BranchMergingAwareRepositorypublic void pushRevision(@NotNull
@NotNull File sourceDirectory,
@Nullable
@Nullable String vcsRevisionKey)
throws RepositoryException
PushCapableRepositorypushRevision in interface PushCapableRepositorysourceDirectory - - the working directory of the repository we want to push fromvcsRevisionKey - - the revisionKey (usually a branch name) to pushRepositoryException - - when something goes wrong@NotNull public @NotNull String commit(@NotNull @NotNull File sourceDirectory, @NotNull @NotNull String message) throws RepositoryException
PushCapableRepositorycommit in interface PushCapableRepositorysourceDirectory - - which workspace directory to perform the commitmessage - - what message use for commitRepositoryException - - when something goes wrongpublic boolean usePollingForBranchDetection()
BranchInformationProviderusePollingForBranchDetection in interface BranchInformationProvider@Nullable public @Nullable GitRepository getGitRepository()
getGitRepository in interface GitRepositoryFacade@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.