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
ConstructorsConstructorDescriptionBitbucketGitSCMBuilder(BitbucketSCMSource scmSource, jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision revision, String credentialsId) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionhudson.plugins.git.GitSCMbuild()Returns theBitbucketSCMSourcethat 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 theBitbucketRepositoryto allow inference of ports for different protocols.withCredentials(String credentialsId, BitbucketRepositoryProtocol protocol) Configures theIdCredentials.getId()of theCredentialsto 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, withRemoteNameMethods 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- theSCMHeadrevision- the (optional)SCMRevisioncredentialsId- TheIdCredentials.getId()of theCredentialsto use when connecting to theGitSCMBuilder.remote()ornullto 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 theBitbucketRepositoryto 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:
thisfor method chaining.
-
scmSource
Returns theBitbucketSCMSourcethat this request is against (primarily to allow resolving credentials againstSCMSource.getOwner()).- Returns:
- the
BitbucketSCMSourcethat this request is against
-
withCredentials
@NonNull public BitbucketGitSCMBuilder withCredentials(String credentialsId, BitbucketRepositoryProtocol protocol) Configures theIdCredentials.getId()of theCredentialsto use when connecting to theGitSCMBuilder.remote()- Parameters:
credentialsId- theIdCredentials.getId()of theCredentialsto use when connecting to theGitSCMBuilder.remote()ornullto let the git client choose between providing its own credentials or connecting anonymously.protocol- theBitbucketRepositoryProtocolof theCredentialsto use ornullto detect the protocol based on the credentialsId. Defaults to HTTP if credentials arenull. Enables support for blank SSH credentials.- Returns:
thisfor 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:
thisfor method chaining.
-
build
@NonNull public hudson.plugins.git.GitSCM build()- Overrides:
buildin classjenkins.plugins.git.GitSCMBuilder<BitbucketGitSCMBuilder>
-