Class BitbucketGitSCMBuilder
java.lang.Object
jenkins.scm.api.trait.SCMBuilder<B,hudson.plugins.git.GitSCM>
jenkins.plugins.git.GitSCMBuilder<BitbucketGitSCMBuilder>
com.cloudbees.jenkins.plugins.bitbucket.BitbucketGitSCMBuilder
public class BitbucketGitSCMBuilder
extends jenkins.plugins.git.GitSCMBuilder<BitbucketGitSCMBuilder>
A
GitSCMBuilder
specialized for bitbucket.- Since:
- 2.2.0
-
Constructor Summary
ConstructorDescriptionBitbucketGitSCMBuilder
(BitbucketSCMSource scmSource, jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision revision, String credentialsId) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionhudson.plugins.git.GitSCM
build()
getCloudRepositoryUri
(String owner, String repository) Returns theBitbucketSCMSource
that this request is against (primarily to allow resolving credentials againstSCMSource.getOwner()
).Updates theGitSCMBuilder.withRemote(String)
based on the currentSCMBuilder.head()
andSCMBuilder.revision()
.withCloneLinks
(List<BitbucketHref> primaryCloneLinks, List<BitbucketHref> mirrorCloneLinks) Provides the clone links from theBitbucketRepository
to allow inference of ports for different protocols.withCredentials
(String credentialsId, BitbucketRepositoryProtocol protocol) Configures theIdCredentials.getId()
of theCredentials
to use when connecting to theGitSCMBuilder.remote()
Methods inherited from class jenkins.plugins.git.GitSCMBuilder
additionalRemote, additionalRemoteNames, additionalRemoteRefSpecs, asRefSpecs, asRemoteConfigs, browser, credentialsId, extensions, gitTool, refSpecs, remote, remoteName, withAdditionalRemote, withAdditionalRemote, withBrowser, withCredentials, withExtension, withExtensions, withExtensions, withGitTool, withoutRefSpecs, withRefSpec, withRefSpecs, withRemote, withRemoteName
Methods inherited from class jenkins.scm.api.trait.SCMBuilder
head, revision, scmClass, withHead, withRevision, withTrait, withTraits, withTraits
-
Constructor Details
-
BitbucketGitSCMBuilder
public BitbucketGitSCMBuilder(@NonNull BitbucketSCMSource scmSource, @NonNull jenkins.scm.api.SCMHead head, @CheckForNull jenkins.scm.api.SCMRevision revision, @CheckForNull String credentialsId) Constructor.- Parameters:
scmSource
- theBitbucketSCMSource
.head
- theSCMHead
revision
- the (optional)SCMRevision
credentialsId
- TheIdCredentials.getId()
of theCredentials
to use when connecting to theGitSCMBuilder.remote()
ornull
to let the git client choose between providing its own credentials or connecting anonymously.
-
-
Method Details
-
withCloneLinks
public BitbucketGitSCMBuilder withCloneLinks(@CheckForNull List<BitbucketHref> primaryCloneLinks, @CheckForNull List<BitbucketHref> mirrorCloneLinks) Provides the clone links from theBitbucketRepository
to allow inference of ports for different protocols.- Parameters:
primaryCloneLinks
- the clone links for primary repository.mirrorCloneLinks
- the clone links for mirror repository if it's configured.- Returns:
this
for method chaining.
-
scmSource
Returns theBitbucketSCMSource
that this request is against (primarily to allow resolving credentials againstSCMSource.getOwner()
).- Returns:
- the
BitbucketSCMSource
that this request is against
-
withCredentials
@NonNull public BitbucketGitSCMBuilder withCredentials(String credentialsId, BitbucketRepositoryProtocol protocol) Configures theIdCredentials.getId()
of theCredentials
to use when connecting to theGitSCMBuilder.remote()
- Parameters:
credentialsId
- theIdCredentials.getId()
of theCredentials
to use when connecting to theGitSCMBuilder.remote()
ornull
to let the git client choose between providing its own credentials or connecting anonymously.protocol
- theBitbucketRepositoryProtocol
of theCredentials
to use ornull
to detect the protocol based on the credentialsId. Defaults to HTTP if credentials arenull
. Enables support for blank SSH credentials.- Returns:
this
for method chaining.
-
withBitbucketRemote
Updates theGitSCMBuilder.withRemote(String)
based on the currentSCMBuilder.head()
andSCMBuilder.revision()
. Will be called automatically bybuild()
but exposed in case the correct remote is required after changing theGitSCMBuilder.withCredentials(String)
.- Returns:
this
for method chaining.
-
getCloudRepositoryUri
-
build
@NonNull public hudson.plugins.git.GitSCM build()- Overrides:
build
in classjenkins.plugins.git.GitSCMBuilder<BitbucketGitSCMBuilder>
-