public class BuildStatusAction extends InvisibleAction
Modifier and Type | Field and Description |
---|---|
protected BuildNotifierManager |
buildNotifierManager |
Constructor and Description |
---|
BuildStatusAction(Run<?,?> run,
String targetUrl,
List<BuildStage> stageList)
Construct a BuildStatusAction
|
Modifier and Type | Method and Description |
---|---|
void |
addBuildStatus(String stageName)
Sends pending notifications for the start of a stage.
|
void |
addGenericNotifier(BuildNotifier notifier) |
void |
addGithubNotifier(GithubNotificationConfig config)
Attempts to add a GitHub notifier.
|
void |
addHttpNotifier(HttpNotifierConfig httpNotifierConfig)
Attempts to add an HTTP notifier.
|
void |
addInfluxDbNotifier(InfluxDbNotifierConfig influxDbNotifierConfig)
Attempts to add an InfluxDB notifier.
|
void |
addStatsdNotifier(StatsdNotifierConfig statsdNotifierConfig)
Attempts to add a StatsD notifier.
|
void |
close()
Cleans up by sending "complete" status to any steps that are currently
pending.
|
void |
connectNotifiers(Run<?,?> run,
String targetUrl)
Determines whether the notifiers need to be reconnected.
|
String |
getBranchName() |
String |
getJobName() |
String |
getRepoName() |
String |
getRepoOwner() |
boolean |
isIsDeclarativePipeline()
Sets flag indicating whether notifications are for a declarative pipeline
|
void |
sendNonStageError(String nodeName)
Sends notifications for an error that happens outside of a stage.
|
void |
sendNotifications(BuildNotifier notifier)
Sends all saved notifications to a notifier.
|
void |
setBranchName(String branchName) |
void |
setIsDeclarativePipeline(boolean isDeclarativePipeline) |
void |
setRepoName(String repoName) |
void |
setRepoOwner(String repoOwner) |
void |
updateBuildStatusForJob(BuildState buildState,
Map<String,Object> parameters)
Sends notifications for final build status.
|
void |
updateBuildStatusForStage(String nodeName,
BuildStage.State buildState)
Sends notifications for a completed stage.
|
void |
updateBuildStatusForStage(String nodeName,
BuildStage.State buildState,
long time)
Sends notifications for a completed stage.
|
getDisplayName, getIconFileName, getUrlName
protected transient BuildNotifierManager buildNotifierManager
public BuildStatusAction(Run<?,?> run, String targetUrl, List<BuildStage> stageList)
run
- the buildtargetUrl
- link back to JenkinsstageList
- list of stages if knownpublic String getJobName()
public String getRepoOwner()
public void setRepoOwner(String repoOwner)
public String getRepoName()
public void setRepoName(String repoName)
public String getBranchName()
public void setBranchName(String branchName)
public void connectNotifiers(Run<?,?> run, String targetUrl)
run
- the current buildtargetUrl
- link back to Jenkinspublic void close()
public boolean isIsDeclarativePipeline()
public void setIsDeclarativePipeline(boolean isDeclarativePipeline)
public void addGithubNotifier(GithubNotificationConfig config)
config
- GitHub notifier configpublic void addInfluxDbNotifier(InfluxDbNotifierConfig influxDbNotifierConfig)
influxDbNotifierConfig
- InfluxDB notifier configpublic void addStatsdNotifier(StatsdNotifierConfig statsdNotifierConfig)
statsdNotifierConfig
- StatsD notifier configpublic void addHttpNotifier(HttpNotifierConfig httpNotifierConfig)
httpNotifierConfig
- HTTP notifier configpublic void addGenericNotifier(BuildNotifier notifier)
public void sendNotifications(BuildNotifier notifier)
notifier
- notifier to send topublic void addBuildStatus(String stageName)
stageName
- stage namepublic void updateBuildStatusForStage(String nodeName, BuildStage.State buildState, long time)
nodeName
- node namebuildState
- build statetime
- stage timepublic void updateBuildStatusForStage(String nodeName, BuildStage.State buildState)
nodeName
- node namebuildState
- build statepublic void updateBuildStatusForJob(BuildState buildState, Map<String,Object> parameters)
buildState
- final build stateparameters
- build parameterspublic void sendNonStageError(String nodeName)
nodeName
- name of node that failedCopyright © 2016–2019. All rights reserved.