Class GiteaSCMBuilder

java.lang.Object
jenkins.scm.api.trait.SCMBuilder<GiteaSCMBuilder,hudson.plugins.git.GitSCM>
jenkins.plugins.git.GitSCMBuilder<GiteaSCMBuilder>
org.jenkinsci.plugin.gitea.GiteaSCMBuilder

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

    Constructors
    Constructor
    Description
    GiteaSCMBuilder(GiteaSCMSource 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 sshRemote, String credentialsId)
    Returns a UriTemplate for checkout according to credentials configuration.
    final String
    repositoryUrl(String owner, String repository)
     
    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

    • GiteaSCMBuilder

      public GiteaSCMBuilder(@NonNull GiteaSCMSource source, @NonNull jenkins.scm.api.SCMHead head, @CheckForNull jenkins.scm.api.SCMRevision revision)
      Constructor.
      Parameters:
      source - the GiteaSCMSource.
      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 sshRemote, @CheckForNull String credentialsId)
      Returns a UriTemplate for checkout according to credentials configuration. Expects the parameters owner and repository to be populated before expansion.
      Parameters:
      context - the context within which to resolve the credentials.
      serverUrl - the server url
      sshRemote - any valid SSH remote URL for the server.
      credentialsId - the credentials.
      Returns:
      a UriTemplate
    • repositoryUrl

      public final String repositoryUrl(String owner, String repository)
    • 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
    • withGiteaRemote

      @NonNull public final GiteaSCMBuilder withGiteaRemote()
      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<GiteaSCMBuilder>