Class GithubBuildNotifier
java.lang.Object
org.jenkinsci.plugins.githubautostatus.notifiers.BuildNotifier
org.jenkinsci.plugins.githubautostatus.notifiers.GithubBuildNotifier
- All Implemented Interfaces:
ExtensionPoint
Sets the GitHub commit status for stages based on build notifications.
- Author:
- Jeff Pearce (GitHub jeffpearce)
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class org.jenkinsci.plugins.githubautostatus.notifiers.BuildNotifier
DEFAULT_LONG, DEFAULT_STRING -
Constructor Summary
ConstructorsConstructorDescriptionGithubBuildNotifier(org.kohsuke.github.GHRepository repository, String shaString, String targetUrl) ConstructorGithubBuildNotifier(org.kohsuke.github.GHRepository repository, String shaString, String targetUrl, GithubNotificationConfig config) Constructor with config for credential refresh support. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether this notifier is enabled.voidnotifyBuildStageStatus(String jobName, BuildStage stageItem) Sends stage status notification to GitHub.voidnotifyFinalBuildStatus(BuildStage.State buildState, Map<String, Object> parameters) Sends a notification when the job is complete (currently no-op in this class).Methods inherited from class org.jenkinsci.plugins.githubautostatus.notifiers.BuildNotifier
all, getLong, wantsOutOfStageErrors
-
Constructor Details
-
GithubBuildNotifier
public GithubBuildNotifier(org.kohsuke.github.GHRepository repository, String shaString, String targetUrl) Constructor- Parameters:
repository- the GitHub repositoryshaString- the commit notifications are being provided fortargetUrl- target Url (link back to Jenkins)
-
GithubBuildNotifier
public GithubBuildNotifier(org.kohsuke.github.GHRepository repository, String shaString, String targetUrl, GithubNotificationConfig config) Constructor with config for credential refresh support.- Parameters:
repository- the GitHub repositoryshaString- the commit notifications are being provided fortargetUrl- target Url (link back to Jenkins)config- config for re-resolving credentials when tokens expire
-
-
Method Details
-
isEnabled
public boolean isEnabled()Determines whether this notifier is enabled.- Specified by:
isEnabledin classBuildNotifier- Returns:
- true if enabled; false otherwise
-
notifyBuildStageStatus
Sends stage status notification to GitHub.- Specified by:
notifyBuildStageStatusin classBuildNotifier- Parameters:
jobName- the job name (used in failure logging, not in thecreateCommitStatuscall)stageItem- stage item describing the new state; itsnameis used as the optionalstate, and itsnameis used as the optionalcontextforGHRepository.createCommitStatus(String, GHCommitState, String, String, String)ultimate call.
-
notifyFinalBuildStatus
Sends a notification when the job is complete (currently no-op in this class).- Specified by:
notifyFinalBuildStatusin classBuildNotifier- Parameters:
buildState- state indicating success or failureparameters- build parameters
-