Package com.cloudbees.jenkins
Class GitHubPushTrigger
- java.lang.Object
-
- hudson.triggers.Trigger<Job<?,?>>
-
- com.cloudbees.jenkins.GitHubPushTrigger
-
- All Implemented Interfaces:
GitHubTrigger
,ExtensionPoint
,Describable<Trigger<?>>
public class GitHubPushTrigger extends Trigger<Job<?,?>> implements GitHubTrigger
Triggers a build when we receive a GitHub post-commit webhook.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GitHubPushTrigger.DescriptorImpl
class
GitHubPushTrigger.GitHubWebHookPollingAction
Action object forProject
.-
Nested classes/interfaces inherited from class hudson.triggers.Trigger
Trigger.Cron
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Nested classes/interfaces inherited from interface com.cloudbees.jenkins.GitHubTrigger
GitHubTrigger.GitHubRepositoryNameContributorImpl
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
ALLOW_HOOKURL_OVERRIDE
Set to false to prevent the user from overriding the hook URL.
-
Constructor Summary
Constructors Constructor Description GitHubPushTrigger()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description GitHubPushTrigger.DescriptorImpl
getDescriptor()
Set<GitHubRepositoryName>
getGitHubRepositories()
File
getLogFile()
Returns the file that records the last/current polling activity.Collection<? extends Action>
getProjectActions()
void
onPost()
Deprecated.void
onPost(GitHubTriggerEvent event)
Called when a POST is made.void
onPost(String triggeredByUser)
Called when a POST is made.void
registerHooks()
Tries to register hook for current associated job.void
start(Job<?,?> project, boolean newInstance)
void
stop()
-
Methods inherited from class hudson.triggers.Trigger
all, checkTriggers, for_, getProjectAction, getSpec, readResolve, run
-
-
-
-
Method Detail
-
onPost
@Deprecated public void onPost()
Deprecated.Called when a POST is made.- Specified by:
onPost
in interfaceGitHubTrigger
-
onPost
public void onPost(String triggeredByUser)
Called when a POST is made.- Specified by:
onPost
in interfaceGitHubTrigger
-
onPost
public void onPost(GitHubTriggerEvent event)
Called when a POST is made.
-
getLogFile
public File getLogFile()
Returns the file that records the last/current polling activity.
-
getGitHubRepositories
@Deprecated public Set<GitHubRepositoryName> getGitHubRepositories()
Description copied from interface:GitHubTrigger
Obtains the list of the repositories that this trigger is looking at. If the implementation of this class maintain its own list of GitHub repositories, it should continue to implement this method for backward compatibility, and it gets picked up byGitHubRepositoryNameContributor.parseAssociatedNames(AbstractProject)
.Alternatively, if the implementation doesn't worry about the backward compatibility, it can implement this method to return an empty collection, then just implement
GitHubRepositoryNameContributor
.- Specified by:
getGitHubRepositories
in interfaceGitHubTrigger
-
start
public void start(Job<?,?> project, boolean newInstance)
-
registerHooks
public void registerHooks()
Tries to register hook for current associated job. Do this lazily to avoid blocking the UI thread. Useful for using from groovy scripts.- Since:
- 1.11.2
-
getProjectActions
public Collection<? extends Action> getProjectActions()
- Overrides:
getProjectActions
in classTrigger<Job<?,?>>
-
getDescriptor
public GitHubPushTrigger.DescriptorImpl getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<Trigger<?>>
- Overrides:
getDescriptor
in classTrigger<Job<?,?>>
-
-