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>
AGitSCMBuilder
specialized for bitbucket.- Since:
- 2.2.0
-
-
Constructor Summary
Constructors Constructor Description BitbucketGitSCMBuilder(BitbucketSCMSource scmSource, jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision revision, String credentialsId)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description hudson.plugins.git.GitSCM
build()
List<BitbucketHref>
cloneLinks()
Returns the clone links (possibly empty).BitbucketSCMSource
scmSource()
Returns theBitbucketSCMSource
that this request is against (primarily to allow resolving credentials againstSCMSource.getOwner()
).BitbucketGitSCMBuilder
withBitbucketRemote()
Updates theGitSCMBuilder.withRemote(String)
based on the currentSCMBuilder.head()
andSCMBuilder.revision()
.BitbucketGitSCMBuilder
withCloneLinks(List<BitbucketHref> cloneLinks)
Provides the clone links from theBitbucketRepository
to allow inference of ports for different protocols.BitbucketGitSCMBuilder
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
-
-
-
-
Constructor Detail
-
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 Detail
-
withCloneLinks
public BitbucketGitSCMBuilder withCloneLinks(List<BitbucketHref> cloneLinks)
Provides the clone links from theBitbucketRepository
to allow inference of ports for different protocols.- Parameters:
cloneLinks
- the clone links.- Returns:
this
for method chaining.
-
scmSource
@NonNull public BitbucketSCMSource scmSource()
Returns theBitbucketSCMSource
that this request is against (primarily to allow resolving credentials againstSCMSource.getOwner()
).- Returns:
- the
BitbucketSCMSource
that this request is against
-
cloneLinks
@NonNull public List<BitbucketHref> cloneLinks()
Returns the clone links (possibly empty).- Returns:
- the clone links (possibly empty).
-
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
@NonNull public BitbucketGitSCMBuilder 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.
-
build
@NonNull public hudson.plugins.git.GitSCM build()
- Overrides:
build
in classjenkins.plugins.git.GitSCMBuilder<BitbucketGitSCMBuilder>
-
-