Package com.cloudbees.jenkins
Class GitHubWebHook
- java.lang.Object
-
- com.cloudbees.jenkins.GitHubWebHook
-
- All Implemented Interfaces:
ExtensionPoint
,Action
,ModelObject
,RootAction
,UnprotectedRootAction
@Extension public class GitHubWebHook extends Object implements UnprotectedRootAction
Receives github hook.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GitHubWebHook.Listener
Deprecated.working theory is that this API is not required any more with theSCMEvent
based API, if wrong, please raise a JIRA-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static String
URL_VALIDATION_HEADER
static String
URLNAME
static String
X_INSTANCE_IDENTITY
-
Constructor Summary
Constructors Constructor Description GitHubWebHook()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
doIndex(org.kohsuke.github.GHEvent event, String payload)
Receives the webhook callstatic GitHubWebHook
get()
String
getDisplayName()
String
getIconFileName()
static Jenkins
getJenkinsInstance()
String
getUrlName()
void
registerHookFor(Item item)
If any wants to auto-register hook, then should call this method Example code:GitHubWebHook.get().registerHookFor(item);
void
registerHookFor(Job job)
Deprecated.List<Item>
reRegisterAllHooks()
CallsregisterHookFor(Job)
for every project which have subscriber
-
-
-
Field Detail
-
URLNAME
public static final String URLNAME
- See Also:
- Constant Field Values
-
URL_VALIDATION_HEADER
public static final String URL_VALIDATION_HEADER
- See Also:
- Constant Field Values
-
X_INSTANCE_IDENTITY
public static final String X_INSTANCE_IDENTITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getIconFileName
public String getIconFileName()
- Specified by:
getIconFileName
in interfaceAction
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getUrlName
public String getUrlName()
- Specified by:
getUrlName
in interfaceAction
-
registerHookFor
@Deprecated public void registerHookFor(Job job)
Deprecated.If any wants to auto-register hook, then should call this method Example code:GitHubWebHook.get().registerHookFor(job);
- Parameters:
job
- not null project to register hook for
-
registerHookFor
public void registerHookFor(Item item)
If any wants to auto-register hook, then should call this method Example code:GitHubWebHook.get().registerHookFor(item);
- Parameters:
item
- not null item to register hook for- Since:
- 1.25.0
-
reRegisterAllHooks
public List<Item> reRegisterAllHooks()
CallsregisterHookFor(Job)
for every project which have subscriber- Returns:
- list of jobs which jenkins tried to register hook
-
doIndex
public void doIndex(@NonNull @GHEventHeader org.kohsuke.github.GHEvent event, @NonNull @GHEventPayload String payload)
Receives the webhook call- Parameters:
event
- GH event type. Never nullpayload
- Payload from hook. Never blank
-
get
public static GitHubWebHook get()
-
getJenkinsInstance
@NonNull public static Jenkins getJenkinsInstance() throws IllegalStateException
- Throws:
IllegalStateException
-
-