public class BuildStatusAction
extends hudson.model.InvisibleAction
Modifier and Type | Field and Description |
---|---|
protected BuildNotifierManager |
buildNotifierManager |
Modifier | Constructor and Description |
---|---|
protected |
BuildStatusAction(hudson.model.Run<?,?> run,
String targetUrl,
List<BuildStage> stageList) |
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(hudson.model.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
|
static BuildStatusAction |
newAction(hudson.model.Run<?,?> run,
String targetUrl,
List<BuildStage> stageList)
Construct a BuildStatusAction
|
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(BuildStage.State 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.
|
protected transient BuildNotifierManager buildNotifierManager
protected BuildStatusAction(hudson.model.Run<?,?> run, String targetUrl, List<BuildStage> stageList)
public 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 static BuildStatusAction newAction(hudson.model.Run<?,?> run, String targetUrl, List<BuildStage> stageList)
run
- the buildtargetUrl
- link back to JenkinsstageList
- list of stages if knownpublic void connectNotifiers(hudson.model.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(BuildStage.State buildState, Map<String,Object> parameters)
buildState
- final build stateparameters
- build parameterspublic void sendNonStageError(String nodeName)
nodeName
- name of node that failedCopyright © 2016–2020. All rights reserved.