public class GitHubSCMSource extends jenkins.plugins.git.AbstractGitSCMSource
Modifier and Type | Class and Description |
---|---|
static class |
GitHubSCMSource.DescriptorImpl |
jenkins.plugins.git.AbstractGitSCMSource.SCMRevisionImpl, jenkins.plugins.git.AbstractGitSCMSource.SpecificRevisionBuildChooser
jenkins.scm.api.SCMSource.SourceByItem
ExtensionPoint.LegacyInstancesAreScopedToHudson
Modifier and Type | Field and Description |
---|---|
static String |
GITHUB_COM |
static String |
GITHUB_URL |
static String |
VALID_GIT_SHA1 |
static String |
VALID_GITHUB_REPO_NAME |
static String |
VALID_GITHUB_USER_NAME |
DEFAULT_REMOTE_NAME, REF_SPEC_DEFAULT, REF_SPEC_REMOTE_NAME_PLACEHOLDER, REF_SPEC_REMOTE_NAME_PLACEHOLDER_STR
PRONOUN
Constructor and Description |
---|
GitHubSCMSource(String repoOwner,
String repository)
Deprecated.
|
GitHubSCMSource(String repoOwner,
String repository,
String repositoryUrl,
boolean configuredByUrl)
Constructor, defaults to
GITHUB_URL as the end-point, and anonymous access, does not default any
SCMSourceTrait behaviours. |
GitHubSCMSource(String id,
String apiUri,
String checkoutCredentialsId,
String scanCredentialsId,
String repoOwner,
String repository)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
afterSave() |
SCM |
build(jenkins.scm.api.SCMHead head,
jenkins.scm.api.SCMRevision revision) |
protected jenkins.scm.api.SCMProbe |
createProbe(jenkins.scm.api.SCMHead head,
jenkins.scm.api.SCMRevision revision) |
String |
getApiUri()
Returns the GitHub API end-point.
|
boolean |
getBuildForkPRHead()
Deprecated.
|
boolean |
getBuildForkPRMerge()
Deprecated.
|
boolean |
getBuildOriginBranch()
Deprecated.
|
boolean |
getBuildOriginBranchWithPR()
Deprecated.
|
boolean |
getBuildOriginPRHead()
Deprecated.
|
boolean |
getBuildOriginPRMerge()
Deprecated.
|
static int |
getCacheSize()
Returns how many megabytes of on-disk cache to maintain per GitHub API URL per credentials.
|
String |
getCheckoutCredentialsId()
Deprecated.
|
String |
getCredentialsId()
Gets the credentials used to access the GitHub REST API (also used as the default credentials for checking out
sources.
|
static int |
getEventDelaySeconds()
Returns how long to delay events received from GitHub in order to allow the API caches to sync.
|
String |
getPronoun() |
String |
getRemote() |
String |
getRepoOwner()
Gets the repository owner.
|
String |
getRepository()
Gets the repository name.
|
String |
getRepositoryUrl()
Gets the repository URL as specified by the user.
|
String |
getScanCredentialsId()
Deprecated.
|
List<jenkins.scm.api.trait.SCMSourceTrait> |
getTraits() |
jenkins.scm.api.SCMRevision |
getTrustedRevision(jenkins.scm.api.SCMRevision revision,
TaskListener listener) |
RepositoryUriResolver |
getUriResolver()
Deprecated.
|
protected boolean |
isCategoryEnabled(jenkins.scm.api.SCMHeadCategory category) |
boolean |
isConfiguredByUrl() |
protected jenkins.scm.api.SCMRevision |
retrieve(jenkins.scm.api.SCMHead head,
TaskListener listener) |
protected void |
retrieve(jenkins.scm.api.SCMSourceCriteria criteria,
jenkins.scm.api.SCMHeadObserver observer,
jenkins.scm.api.SCMHeadEvent<?> event,
TaskListener listener) |
protected jenkins.scm.api.SCMRevision |
retrieve(String headName,
TaskListener listener,
Item retrieveContext) |
protected List<Action> |
retrieveActions(jenkins.scm.api.SCMHead head,
jenkins.scm.api.SCMHeadEvent event,
TaskListener listener) |
protected List<Action> |
retrieveActions(jenkins.scm.api.SCMSourceEvent event,
TaskListener listener) |
protected Set<String> |
retrieveRevisions(TaskListener listener,
Item retrieveContext) |
void |
setApiUri(String apiUri)
Sets the GitHub API end-point.
|
void |
setBuildForkPRHead(boolean buildForkPRHead)
Deprecated.
|
void |
setBuildForkPRMerge(boolean buildForkPRMerge)
Deprecated.
|
void |
setBuildOriginBranch(boolean buildOriginBranch)
Deprecated.
|
void |
setBuildOriginBranchWithPR(boolean buildOriginBranchWithPR)
Deprecated.
|
void |
setBuildOriginPRHead(boolean buildOriginPRHead)
Deprecated.
|
void |
setBuildOriginPRMerge(boolean buildOriginPRMerge)
Deprecated.
|
static void |
setCacheSize(int cacheSize)
Sets how long to delay events received from GitHub in order to allow the API caches to sync.
|
void |
setCredentialsId(String credentialsId)
Sets the credentials used to access the GitHub REST API (also used as the default credentials for checking out
sources.
|
static void |
setEventDelaySeconds(int eventDelaySeconds)
Sets how long to delay events received from GitHub in order to allow the API caches to sync.
|
void |
setExcludes(String excludes)
Deprecated.
|
void |
setIncludes(String includes)
Deprecated.
|
void |
setScanCredentialsId(String credentialsId)
Deprecated.
|
void |
setTraits(List<jenkins.scm.api.trait.SCMSourceTrait> traits)
Sets the behaviours that are applied to this
GitHubSCMSource . |
decorate, getBrowser, getCacheDir, getCacheEntry, getCacheLock, getCredentials, getExcludes, getExtensions, getGitTool, getIncludes, getRefSpecs, getRemoteConfigs, getRemoteName, isExcluded, newBuilder, resolveGitTool, resolveGitTool, resolveGitTool
build, canProbe, checkInterrupt, defaultListener, equals, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetchActions, fetchActions, fetchActions, fetchRevisions, fetchRevisions, fromSCMFileSystem, getCategories, getCriteria, getDescriptor, getId, getOwner, hashCode, hasId, newProbe, parentHeads, parentRevisions, retrieve, retrieve, retrieve, retrieve, retrieve, retrieveActions, retrieveRevisions, setId, setOwner, toString, withId
public static final String VALID_GITHUB_REPO_NAME
public static final String VALID_GITHUB_USER_NAME
public static final String VALID_GIT_SHA1
public static final String GITHUB_URL
public static final String GITHUB_COM
@DataBoundConstructor public GitHubSCMSource(String repoOwner, String repository, String repositoryUrl, boolean configuredByUrl)
GITHUB_URL
as the end-point, and anonymous access, does not default any
SCMSourceTrait
behaviours.repoOwner
- the repository owner.repository
- the repository name.repositoryUrl
- HTML URL for the repository. If specified, takes precedence over repoOwner and repository.configuredByUrl
- Whether to use repositoryUrl or repoOwner/repository for configuration.IllegalArgumentException
- if repositoryUrl is specified but invalid.@Deprecated public GitHubSCMSource(String repoOwner, String repository)
repoOwner
- the repository owner.repository
- the repository name.@Deprecated public GitHubSCMSource(@CheckForNull String id, @CheckForNull String apiUri, @NonNull String checkoutCredentialsId, @CheckForNull String scanCredentialsId, @NonNull String repoOwner, @NonNull String repository)
id
- the source id.apiUri
- the GitHub endpoint.checkoutCredentialsId
- the checkout credentials id or GitHubSCMSource.DescriptorImpl.SAME
or
GitHubSCMSource.DescriptorImpl.ANONYMOUS
.scanCredentialsId
- the scan credentials id or null
.repoOwner
- the repository owner.repository
- the repository name.@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isConfiguredByUrl()
@NonNull public String getApiUri()
@DataBoundSetter public void setApiUri(@CheckForNull String apiUri)
apiUri
- the GitHub API end-point or null
if GITHUB_URL
.@CheckForNull public String getCredentialsId()
getCredentialsId
in class jenkins.plugins.git.AbstractGitSCMSource
null
to access anonymously@DataBoundSetter public void setCredentialsId(@CheckForNull String credentialsId)
credentialsId
- the credentials used to access the GitHub REST API or null
to access anonymously@Exported @NonNull public String getRepoOwner()
@Exported @NonNull public String getRepository()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @NonNull public String getRepositoryUrl()
public List<jenkins.scm.api.trait.SCMSourceTrait> getTraits()
getTraits
in class jenkins.plugins.git.AbstractGitSCMSource
@DataBoundSetter public void setTraits(@CheckForNull List<jenkins.scm.api.trait.SCMSourceTrait> traits)
GitHubSCMSource
.setTraits
in class jenkins.scm.api.SCMSource
traits
- the behaviours that are to be applied.public static int getEventDelaySeconds()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void setEventDelaySeconds(int eventDelaySeconds)
eventDelaySeconds
- number of seconds to delay, will be restricted into a value within the range
[0,300]
inclusivepublic static int getCacheSize()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void setCacheSize(int cacheSize)
cacheSize
- how many megabytes of on-disk cache to maintain per GitHub API URL per credentials,
will be restricted into a value within the range [0,1024]
inclusive.public String getRemote()
getRemote
in class jenkins.plugins.git.AbstractGitSCMSource
public String getPronoun()
getPronoun
in class jenkins.scm.api.SCMSource
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.2.0") public RepositoryUriResolver getUriResolver()
GitHubSCMBuilder.uriResolver()
or GitHubSCMBuilder.uriResolver(Item, String, String)
.RepositoryUriResolver
according to credentials configuration.RepositoryUriResolver
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince(value="2.2.0") @Deprecated @CheckForNull public String getScanCredentialsId()
@Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.2.0") @Deprecated public void setScanCredentialsId(@CheckForNull String credentialsId)
@Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.2.0") @Deprecated @CheckForNull public String getCheckoutCredentialsId()
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.2.0") @DataBoundSetter public void setIncludes(@NonNull String includes)
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince(value="2.2.0") @DataBoundSetter public void setExcludes(@NonNull String excludes)
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.2.0") public boolean getBuildOriginBranch()
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.2.0") @DataBoundSetter public void setBuildOriginBranch(boolean buildOriginBranch)
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.2.0") public boolean getBuildOriginBranchWithPR()
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.2.0") @DataBoundSetter public void setBuildOriginBranchWithPR(boolean buildOriginBranchWithPR)
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.2.0") public boolean getBuildOriginPRMerge()
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.2.0") @DataBoundSetter public void setBuildOriginPRMerge(boolean buildOriginPRMerge)
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.2.0") public boolean getBuildOriginPRHead()
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.2.0") @DataBoundSetter public void setBuildOriginPRHead(boolean buildOriginPRHead)
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.2.0") public boolean getBuildForkPRMerge()
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.2.0") @DataBoundSetter public void setBuildForkPRMerge(boolean buildForkPRMerge)
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.2.0") public boolean getBuildForkPRHead()
@Deprecated @Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince(value="2.2.0") @DataBoundSetter public void setBuildForkPRHead(boolean buildForkPRHead)
protected final void retrieve(@CheckForNull jenkins.scm.api.SCMSourceCriteria criteria, @NonNull jenkins.scm.api.SCMHeadObserver observer, @CheckForNull jenkins.scm.api.SCMHeadEvent<?> event, @NonNull TaskListener listener) throws IOException, InterruptedException
retrieve
in class jenkins.plugins.git.AbstractGitSCMSource
IOException
InterruptedException
@NonNull protected Set<String> retrieveRevisions(@NonNull TaskListener listener, Item retrieveContext) throws IOException, InterruptedException
retrieveRevisions
in class jenkins.plugins.git.AbstractGitSCMSource
IOException
InterruptedException
protected jenkins.scm.api.SCMRevision retrieve(@NonNull String headName, @NonNull TaskListener listener, Item retrieveContext) throws IOException, InterruptedException
retrieve
in class jenkins.plugins.git.AbstractGitSCMSource
IOException
InterruptedException
@NonNull protected jenkins.scm.api.SCMProbe createProbe(@NonNull jenkins.scm.api.SCMHead head, @CheckForNull jenkins.scm.api.SCMRevision revision) throws IOException
createProbe
in class jenkins.scm.api.SCMSource
IOException
@CheckForNull protected jenkins.scm.api.SCMRevision retrieve(jenkins.scm.api.SCMHead head, TaskListener listener) throws IOException, InterruptedException
retrieve
in class jenkins.plugins.git.AbstractGitSCMSource
IOException
InterruptedException
public SCM build(jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision revision)
build
in class jenkins.plugins.git.AbstractGitSCMSource
public jenkins.scm.api.SCMRevision getTrustedRevision(jenkins.scm.api.SCMRevision revision, TaskListener listener) throws IOException, InterruptedException
getTrustedRevision
in class jenkins.scm.api.SCMSource
IOException
InterruptedException
protected boolean isCategoryEnabled(@NonNull jenkins.scm.api.SCMHeadCategory category)
isCategoryEnabled
in class jenkins.plugins.git.AbstractGitSCMSource
@NonNull protected List<Action> retrieveActions(@NonNull jenkins.scm.api.SCMHead head, @CheckForNull jenkins.scm.api.SCMHeadEvent event, @NonNull TaskListener listener) throws IOException, InterruptedException
retrieveActions
in class jenkins.plugins.git.AbstractGitSCMSource
IOException
InterruptedException
@NonNull protected List<Action> retrieveActions(@CheckForNull jenkins.scm.api.SCMSourceEvent event, @NonNull TaskListener listener) throws IOException
retrieveActions
in class jenkins.plugins.git.AbstractGitSCMSource
IOException
public void afterSave()
afterSave
in class jenkins.scm.api.SCMSource
Copyright © 2016–2020. All rights reserved.