Package org.jenkinsci.plugin.gitea
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
Builds a
GitSCM for GiteaSCMSource.-
Constructor Summary
ConstructorsConstructorDescriptionGiteaSCMBuilder(GiteaSCMSource source, jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision revision) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionhudson.plugins.git.GitSCMbuild()final com.damnhandy.uri.template.UriTemplateReturns aUriTemplatefor checkout according to credentials configuration.static com.damnhandy.uri.template.UriTemplatecheckoutUriTemplate(Item context, String serverUrl, String sshRemote, String credentialsId) Returns aUriTemplatefor checkout according to credentials configuration.final StringrepositoryUrl(String owner, String repository) final GiteaSCMBuilderUpdates theGitSCMBuilder.withRemote(String)based on the currentSCMBuilder.head()andSCMBuilder.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, withRemoteNameMethods inherited from class jenkins.scm.api.trait.SCMBuilder
head, revision, scmClass, withHead, withRevision, withTrait, withTraits, withTraits
-
Constructor Details
-
GiteaSCMBuilder
public GiteaSCMBuilder(@NonNull GiteaSCMSource source, @NonNull jenkins.scm.api.SCMHead head, @CheckForNull jenkins.scm.api.SCMRevision revision) Constructor.- Parameters:
source- theGiteaSCMSource.head- theSCMHeadrevision- 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 aUriTemplatefor checkout according to credentials configuration. Expects the parametersownerandrepositoryto be populated before expansion.- Parameters:
context- the context within which to resolve the credentials.serverUrl- the server urlsshRemote- any valid SSH remote URL for the server.credentialsId- the credentials.- Returns:
- a
UriTemplate
-
repositoryUrl
-
checkoutUriTemplate
@NonNull public final com.damnhandy.uri.template.UriTemplate checkoutUriTemplate()Returns aUriTemplatefor checkout according to credentials configuration. Expects the parametersownerandrepositoryto be populated before expansion.- Returns:
- a
UriTemplate
-
withGiteaRemote
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<GiteaSCMBuilder>
-