public class SvnRepository extends AbstractStandaloneRepository implements SelectableAuthenticationRepository, InitialBuildAwareRepository, RepositoryEventAware, MavenPomAccessorCapableRepository, CommitIsolationAwareRepository, BranchingAwareRepository, TaggingAwareRepository, CustomSourceDirectoryAwareRepository, MandatoryCleanCheckoutAwareRepository, AdvancedConfigurationAwareRepository, CustomRevisionDataAwareRepository, CustomVariableProviderRepository, BranchInformationProvider, CachingAwareRepository, DeploymentAwareRepository, TestConnectionAwareRepository
CachingAwareRepository.CachableOperation
Modifier and Type | Field and Description |
---|---|
static String |
BRANCH_AUTODETECT_ROOT |
static String |
BRANCH_MANUAL_ROOT |
static String |
BRANCHES_DETECTION_BRANCHES_ROOT |
static String |
BRANCHES_DETECTION_BRANCHES_ROOT_OVERRIDDEN |
static String |
COMPLETE_PLUGIN_KEY |
static org.tmatesoft.svn.core.wc.ISVNOptions |
DEFAULT_SVN_OPTIONS |
static String |
KEY |
static String |
NAME |
static String |
SVN_AUTH_TYPE |
static String |
SVN_KEYFILE |
static String |
SVN_PASSPHRASE |
static String |
SVN_PASSWORD |
static String |
SVN_REPO_PREFIX |
static String |
SVN_REPO_URL |
static String |
SVN_SSL_KEYFILE |
static String |
SVN_SSL_PASSPHRASE |
static String |
SVN_USERNAME |
static String |
TAG_AUTODETECT_ROOT |
static String |
TAG_MANUAL_ROOT |
static String |
TEMPORARY_SVN_PASSWORD |
static String |
TEMPORARY_SVN_REPO_PREFIX |
protected TrustedKeyHelper |
trustedKeyHelper |
static String |
USE_EXPORT |
static String |
USE_EXTERNALS |
BUILD_TRIGGER_IP, buildDirectoryManager, buildLoggerManager, customVariableContext, featureManager, REPO_PREFIX, repositoryModuleDescriptor, templateRenderer, textProvider
moduleDescriptor
COMMIT_ISOLATION_OPTION
SELECTED_REPOSITORY, UNKNOWN_HOST
HOST_KEY
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 |
---|
SvnRepository() |
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) |
long |
checkout(org.tmatesoft.svn.core.SVNURL url,
org.tmatesoft.svn.core.wc.SVNRevision revision,
File dstPath,
boolean isRecursive)
Checks out a working copy from a repository.
|
BuildRepositoryChanges |
collectChangesForRevision(PlanKey planKey,
String targetRevision)
Collects the changes for the targetRevision.
|
BuildRepositoryChanges |
collectChangesSinceLastBuild(String planKey,
PlanVcsRevisionData revisionData) |
BuildRepositoryChanges |
collectChangesSinceLastBuild(String planKey,
String lastVcsRevisionKey)
Collects the changes since the lastVcsRevisionKey.
|
int |
compareTo(Object obj) |
void |
createBranch(long repositoryId,
String branchName,
BuildContext buildContext)
Creates branch in the repository.
|
void |
createTag(long repositoryId,
String tagName,
BuildContext buildContext)
Creates a tag in the repository
|
boolean |
equals(Object o) |
long |
export(org.tmatesoft.svn.core.SVNURL url,
org.tmatesoft.svn.core.wc.SVNRevision revision,
File dstPath,
boolean isRecursive) |
List<NameValuePair> |
getAuthenticationTypes()
List all authentication types supported by repository.
|
String |
getAuthType() |
org.tmatesoft.svn.core.SVNURL |
getBranchRootUrl() |
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.
|
static String |
getConfigConstant(String s) |
Map<String,String> |
getCustomVariables()
Return a map containing name->value mapping of the variables.
|
String |
getEncryptedPassphrase() |
String |
getEncryptedPassword() |
CommitContext |
getFirstCommit()
Retrieve the commit that created the Branch.
|
String |
getHost()
What's the repository server host
|
String |
getHost(BuildContext buildContext) |
String |
getKeyFile() |
CommitContext |
getLastCommit()
Retrieve last commit on the branch set on this Repository.
|
String |
getLocationIdentifier()
A string representing the location of the repository
|
String |
getManualBranchRootUrl() |
String |
getManualTagRootUrl() |
SvnRepositoryMavenPomAccessor |
getMavenPomAccessor() |
String |
getName()
What's the name of the plugin - appears in the GUI dropdown
|
List<VcsBranch> |
getOpenBranches(String context)
Set of open branches that are discovered in the repository. |
String |
getPassphrase() |
Map<String,String> |
getPlanRepositoryVariables()
Return a map containing name->value mapping of the plan repository format variables.
|
protected static String |
getRepoPrefix() |
String |
getRepositoryUrl()
Which repository URL are we using?
|
String |
getSubstitutedKeyFile() |
String |
getSubstitutedRepositoryUrl()
Return repository URL with extrapolated Bamboo variables
|
protected org.tmatesoft.svn.core.SVNURL |
getSubstitutedSvnUrl() |
protected org.tmatesoft.svn.core.wc.SVNClientManager |
getSvnClientManager()
SVNClientManager factory.
|
protected String |
getTemporaryConstant(String s) |
protected String |
getTemporaryPrefix() |
String |
getUrl()
Where is the documentation and help about using Subversion?
|
String |
getUsername()
What username are we using to access the repository?
|
String |
getUserPassword()
What password are we using to access the repository
|
VcsBranch |
getVcsBranch() |
int |
hashCode() |
org.tmatesoft.svn.core.wc.SVNInfo |
info(org.tmatesoft.svn.core.SVNURL url,
org.tmatesoft.svn.core.wc.SVNRevision revision)
Runs 'svn info' operation on a given URL.
|
boolean |
isAdvancedOptionEnabled(BuildConfiguration buildConfiguration) |
boolean |
isAutodetectBranchRootUrl() |
boolean |
isAutodetectTagRootUrl() |
boolean |
isCachingSupportedFor(CachingAwareRepository.CachableOperation cachableOperation) |
boolean |
isCleanCheckoutRequired() |
boolean |
isCommitIsolationEnabled()
Whether or not commits will be broken up into individual builds
|
List<BuildRepositoryChanges> |
isolateCommits(BuildRepositoryChanges buildChanges)
Break the single build changes object into a list of
BuildRepositoryChanges . |
protected boolean |
isRecoverableException(org.tmatesoft.svn.core.SVNException e)
Check if provided exception object identifies recoverable exception.
|
boolean |
isRepositoryDifferent(Repository repository)
Checks if the current repo is the same as the given repository
|
boolean |
isUseExport() |
boolean |
isUseExternals() |
void |
onInitialBuild(BuildContext buildContext)
Allows the
Repository to perform custom actions when an initial build is triggered. |
void |
populateFromConfig(org.apache.commons.configuration.HierarchicalConfiguration config)
Update the current object with data in the
HierarchicalConfiguration |
void |
postRetrieveSourceCode(BuildContext buildContext,
File sourceDirectory)
postRetrieveSourceCode will run after the retrieveSourceCode method is called.
|
void |
prepareConfigObject(BuildConfiguration buildConfiguration)
Do any preprocessing work before validation occurs.
|
void |
preRetrieveSourceCode(BuildContext buildContext,
File sourceDirectory)
Checks if the SVN URL has changed
|
String |
retrieveSourceCode(BuildContext buildContext,
String vcsRevisionKey,
File sourceDirectory)
Checks out the latest source code from an appropriate repository to specified directory
|
void |
setAdministrationConfigurationAccessor(AdministrationConfigurationAccessor administrationConfigurationAccessor) |
void |
setAuthType(String authType) |
void |
setAutodetectBranchRoot(boolean autodetectBranchRoot) |
void |
setCommitIsolationEnabled(boolean commitIsolationEnabled) |
void |
setEncryptedPassphrase(String encryptedPassphrase) |
void |
setEncryptedPassword(String encryptedPassword) |
void |
setKeyFile(String myKeyFile) |
void |
setManualBranchRootUrl(String branchRoot) |
void |
setPassphrase(String passphrase) |
void |
setRepositoryUrl(String repositoryUrl)
Specify the subversion repository we are using
|
void |
setSvnClientManagerFactory(SVNClientManagerFactory svnClientManagerFactory) |
void |
setTrustedKeyHelper(TrustedKeyHelper trustedKeyHelper) |
void |
setUseExport(boolean useExport) |
void |
setUseExternals(boolean useExternals) |
void |
setUsername(String username)
What's the username (if any) we are using to acces the repository?
|
void |
setUserPassword(String password)
Specify the password required to access the resposotory
|
void |
setVcsBranch(VcsBranch branch)
Set and prepare the repository for using an arbitrary branch.
|
void |
setVcsBranch(VcsBranch branch,
org.apache.commons.configuration.HierarchicalConfiguration customConfiguration) |
ErrorCollection |
testConnection(long timeout,
TimeUnit unit)
Test connection to the repository within the given timeout.
|
org.apache.commons.configuration.HierarchicalConfiguration |
toConfiguration()
Store SvnRepository data into configuration 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, getMavenPomCheckoutAccessEditHtml, getMaxCommitsToReturn, getMaxRetries, getMinimalEditHtml, getPollingTriggerModule, getQuietPeriod, getShortKey, getSourceCodeDirectory, getSystemWideExclusionPatterns, getViewHtml, getWorkingDirectory, init, isQuietPeriodEnabled, isWorkspaceEmpty, removeBuildRequirements, setBuildDirectoryManager, setBuildLoggerManager, setChangesetFilterPatternRegex, setCustomVariableContext, setFeatureManager, setFilterFilePatternOption, setFilterFilePatternRegex, setTemplateRenderer, setTextProvider, setWorkingDir, substituteString, toMergeCapableRepository
populateContextForEdit, populateContextForView
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getAdvancedEditHtml, getAdvancedViewHtml
checkConnection, getKey, getMinimalEditHtml, getShortKey
getSourceCodeDirectory
customizeBuildRequirements, removeBuildRequirements
isConfigurationMissing
init
getEditHtml, getViewHtml
getDescription
validateForConnectionTesting
public static final String NAME
public static final String KEY
public static final String COMPLETE_PLUGIN_KEY
public static final String SVN_REPO_PREFIX
public static final String SVN_REPO_URL
public static final String SVN_USERNAME
public static final String SVN_AUTH_TYPE
public static final String SVN_PASSWORD
public static final String SVN_KEYFILE
public static final String SVN_PASSPHRASE
public static final String SVN_SSL_KEYFILE
public static final String SVN_SSL_PASSPHRASE
public static final String USE_EXTERNALS
public static final String USE_EXPORT
public static final String TEMPORARY_SVN_REPO_PREFIX
public static final String TEMPORARY_SVN_PASSWORD
public static final String BRANCH_AUTODETECT_ROOT
public static final String BRANCH_MANUAL_ROOT
public static final String TAG_AUTODETECT_ROOT
public static final String TAG_MANUAL_ROOT
public static final String BRANCHES_DETECTION_BRANCHES_ROOT
public static final String BRANCHES_DETECTION_BRANCHES_ROOT_OVERRIDDEN
public static final org.tmatesoft.svn.core.wc.ISVNOptions DEFAULT_SVN_OPTIONS
protected TrustedKeyHelper trustedKeyHelper
@NotNull public BuildRepositoryChanges collectChangesSinceLastBuild(@NotNull String planKey, @NotNull PlanVcsRevisionData revisionData) throws RepositoryException
collectChangesSinceLastBuild
in interface CustomRevisionDataAwareRepository
RepositoryException
@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 wrongpublic boolean usePollingForBranchDetection()
BranchInformationProvider
usePollingForBranchDetection
in interface BranchInformationProvider
@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
public void preRetrieveSourceCode(@NotNull BuildContext buildContext, @NotNull File sourceDirectory)
preRetrieveSourceCode
in interface RepositoryEventAware
buildContext
- public void postRetrieveSourceCode(@NotNull BuildContext buildContext, @NotNull File sourceDirectory)
RepositoryEventAware
postRetrieveSourceCode
in interface RepositoryEventAware
protected boolean isRecoverableException(@NotNull org.tmatesoft.svn.core.SVNException e)
e
- Exception to be analyzed.protected org.tmatesoft.svn.core.wc.SVNClientManager getSvnClientManager()
@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.public boolean isRepositoryDifferent(@NotNull Repository repository)
RepositoryV2
isRepositoryDifferent
in interface RepositoryV2
repository
- to compare againstpublic void prepareConfigObject(@NotNull BuildConfiguration buildConfiguration)
BuildConfigurationAwarePlugin
prepareConfigObject
in interface BuildConfigurationAwarePlugin
prepareConfigObject
in class BaseBuildConfigurationAwarePlugin
buildConfiguration
- -public long checkout(org.tmatesoft.svn.core.SVNURL url, org.tmatesoft.svn.core.wc.SVNRevision revision, File dstPath, boolean isRecursive) throws RepositoryException
url
- repository location where a working copy is to be checked out from;revision
- a revision at which a working copy being checked out is to be;dstPath
- a local path where the working copy will be fetched into;isRecursive
- if true and url corresponds to a directory then doCheckout(..) recursivelyRepositoryException
- Failed!public long export(org.tmatesoft.svn.core.SVNURL url, org.tmatesoft.svn.core.wc.SVNRevision revision, File dstPath, boolean isRecursive) throws RepositoryException
RepositoryException
@NotNull public SvnRepositoryMavenPomAccessor getMavenPomAccessor()
getMavenPomAccessor
in interface MavenPomAccessorCapableRepository
@NotNull public org.tmatesoft.svn.core.wc.SVNInfo info(org.tmatesoft.svn.core.SVNURL url, org.tmatesoft.svn.core.wc.SVNRevision revision) throws RepositoryException
url
- repository location which shall be queriedrevision
- a revision of repository location which shall be queriedRepositoryException
- Failed!public 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 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()
toConfiguration
in interface ConvertibleFromConfig
toConfiguration
in class AbstractRepository
public void onInitialBuild(BuildContext buildContext)
InitialBuildAwareRepository
Repository
to perform custom actions when an initial build is triggered.onInitialBuild
in interface InitialBuildAwareRepository
public boolean isAdvancedOptionEnabled(@NotNull BuildConfiguration buildConfiguration)
isAdvancedOptionEnabled
in class AbstractRepository
@NotNull public String getName()
getName
in interface Repository
getName
in interface DescriptionProvider
getName
in interface NameProvider
public String getPassphrase()
public void setPassphrase(String passphrase)
public String getEncryptedPassphrase()
public void setEncryptedPassphrase(String encryptedPassphrase)
public String getKeyFile()
public String getSubstitutedKeyFile()
public void setKeyFile(String myKeyFile)
public String getAuthType()
getAuthType
in interface SelectableAuthenticationRepository
public void setAuthType(String authType)
public String getUrl()
public void setRepositoryUrl(String repositoryUrl)
repositoryUrl
- The subversion repositorypublic String getRepositoryUrl()
public String getSubstitutedRepositoryUrl()
public void setUsername(String username)
username
- The user name, null if there is no userpublic String getUsername()
public void setUserPassword(String password)
password
- The password (null if we are not using user authentication)public String getUserPassword()
public String getEncryptedPassword()
public void setEncryptedPassword(String encryptedPassword)
protected org.tmatesoft.svn.core.SVNURL getSubstitutedSvnUrl() throws org.tmatesoft.svn.core.SVNException
org.tmatesoft.svn.core.SVNException
public String getHost()
Repository
getHost
in interface Repository
public String getHost(BuildContext buildContext)
@NotNull public String getLocationIdentifier()
Repository
getLocationIdentifier
in interface Repository
getLocationIdentifier
in class AbstractRepository
public boolean isUseExternals()
public void setUseExternals(boolean useExternals)
public boolean isUseExport()
public void setUseExport(boolean useExport)
public boolean isCleanCheckoutRequired()
isCleanCheckoutRequired
in interface MandatoryCleanCheckoutAwareRepository
public void setSvnClientManagerFactory(SVNClientManagerFactory svnClientManagerFactory)
public int compareTo(Object obj)
@NotNull public List<NameValuePair> getAuthenticationTypes()
SelectableAuthenticationRepository
getAuthenticationTypes
in interface SelectableAuthenticationRepository
public boolean isCommitIsolationEnabled()
CommitIsolationAwareRepository
isCommitIsolationEnabled
in interface CommitIsolationAwareRepository
public void setCommitIsolationEnabled(boolean commitIsolationEnabled)
public boolean isAutodetectBranchRootUrl()
public void setAutodetectBranchRoot(boolean autodetectBranchRoot)
public boolean isAutodetectTagRootUrl()
public String getManualBranchRootUrl()
public void setManualBranchRootUrl(String branchRoot)
public String getManualTagRootUrl()
public void setTrustedKeyHelper(TrustedKeyHelper trustedKeyHelper)
public void setAdministrationConfigurationAccessor(AdministrationConfigurationAccessor administrationConfigurationAccessor)
setAdministrationConfigurationAccessor
in class AbstractRepository
@NotNull public List<BuildRepositoryChanges> isolateCommits(@NotNull BuildRepositoryChanges buildChanges)
CommitIsolationAwareRepository
BuildRepositoryChanges
. Must not be null. May return an empty
list but that doesn't actually make any sense. BuildRepositoryChanges
will be more likely to be built than lower changes, which may be discarded.isolateCommits
in interface CommitIsolationAwareRepository
public void createBranch(long repositoryId, @NotNull String branchName, @NotNull BuildContext buildContext) throws RepositoryException
BranchingAwareRepository
createBranch
in interface BranchingAwareRepository
branchName
- name of new branchbuildContext
- build contextRepositoryException
public void createTag(long repositoryId, @NotNull String tagName, @NotNull BuildContext buildContext) throws RepositoryException
TaggingAwareRepository
createTag
in interface TaggingAwareRepository
tagName
- - name of the tagbuildContext
- - build contextRepositoryException
@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
public org.tmatesoft.svn.core.SVNURL getBranchRootUrl() throws org.tmatesoft.svn.core.SVNException
org.tmatesoft.svn.core.SVNException
@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
public CommitContext getLastCommit() throws RepositoryException
BranchDetectionCapableRepository
getLastCommit
in interface BranchDetectionCapableRepository
RepositoryException
public CommitContext getFirstCommit() throws RepositoryException
BranchDetectionCapableRepository
getFirstCommit
in interface BranchDetectionCapableRepository
RepositoryException
@NotNull public VcsBranch getVcsBranch()
getVcsBranch
in interface BranchAwareRepository
public void setVcsBranch(@NotNull VcsBranch branch)
BranchAwareRepository
setVcsBranch
in interface BranchAwareRepository
public void setVcsBranch(@NotNull VcsBranch branch, @NotNull org.apache.commons.configuration.HierarchicalConfiguration customConfiguration)
public CacheId getCacheId(@NotNull CachingAwareRepository.CachableOperation cachableOperation)
CachingAwareRepository
getCacheId
in interface CachingAwareRepository
@NotNull public ErrorCollection testConnection(long timeout, @NotNull TimeUnit unit)
TestConnectionAwareRepository
testConnection
in interface TestConnectionAwareRepository
timeout
- the maximum time to waitunit
- the time unit of the timeout argumentpublic boolean isCachingSupportedFor(@NotNull CachingAwareRepository.CachableOperation cachableOperation)
isCachingSupportedFor
in interface CachingAwareRepository
protected static String getRepoPrefix()
protected String getTemporaryPrefix()
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.