Class GitLabSCMBuilder

java.lang.Object
jenkins.scm.api.trait.SCMBuilder<B,hudson.plugins.git.GitSCM>
jenkins.plugins.git.GitSCMBuilder<GitLabSCMBuilder>
io.jenkins.plugins.gitlabbranchsource.GitLabSCMBuilder

public class GitLabSCMBuilder extends jenkins.plugins.git.GitSCMBuilder<GitLabSCMBuilder>
Builds a GitSCM for GitLabSCMSource.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GitLabSCMBuilder(GitLabSCMSource source, jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision revision)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    hudson.plugins.git.GitSCM
    final com.damnhandy.uri.template.UriTemplate
    Returns a UriTemplate for checkout according to credentials configuration.
    static com.damnhandy.uri.template.UriTemplate
    checkoutUriTemplate(Item context, String serverUrl, String httpRemote, String sshRemote, String credentialsId, String projectPath)
    Returns a UriTemplate for checkout according to credentials configuration.
    Updates the GitSCMBuilder.withRemote(String) based on the current SCMBuilder.head() and SCMBuilder.revision().

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GitLabSCMBuilder

      public GitLabSCMBuilder(@NonNull GitLabSCMSource source, @NonNull jenkins.scm.api.SCMHead head, @CheckForNull jenkins.scm.api.SCMRevision revision)
      Constructor
      Parameters:
      source - the GitLabSCMSource
      head - the SCMHead
      revision - the (optional) SCMRevision
  • Method Details

    • checkoutUriTemplate

      public static com.damnhandy.uri.template.UriTemplate checkoutUriTemplate(@CheckForNull Item context, @NonNull String serverUrl, @CheckForNull String httpRemote, @CheckForNull String sshRemote, @CheckForNull String credentialsId, @NonNull String projectPath)
      Returns a UriTemplate for checkout according to credentials configuration.
      Parameters:
      context - the context within which to resolve the credentials.
      serverUrl - the server url
      sshRemote - the SSH remote URL for the project.
      httpRemote - the HTTPS remote URL for the project.
      credentialsId - the credentials.
      projectPath - the full path to the project (with namespace).
      Returns:
      a UriTemplate
    • checkoutUriTemplate

      @NonNull public final com.damnhandy.uri.template.UriTemplate checkoutUriTemplate()
      Returns a UriTemplate for checkout according to credentials configuration. Expects the parameters owner and repository to be populated before expansion.
      Returns:
      a UriTemplate
    • withGitLabRemote

      @NonNull public final GitLabSCMBuilder withGitLabRemote()
      Updates the GitSCMBuilder.withRemote(String) based on the current SCMBuilder.head() and SCMBuilder.revision(). Will be called automatically by build() but exposed in case the correct remote is required after changing the GitSCMBuilder.withCredentials(String).
      Returns:
      this for method chaining.
    • build

      @NonNull public hudson.plugins.git.GitSCM build()
      Overrides:
      build in class jenkins.plugins.git.GitSCMBuilder<GitLabSCMBuilder>