Class SlackMessageProvider
java.lang.Object
com.sonyericsson.jenkins.plugins.bfa.SlackMessageProvider
Class that allows BFA to send failure cause messages for each build to Slack.
- Author:
- Johan Cornelissen <j.cornelissen@queensu.ca>
-
Method Summary
Modifier and TypeMethodDescriptionRetrieve latest set Slack base URL.boolean
Retrieve latest set Slack bot user.getRoom()
Retrieve latest set Slack channel.Retrieve latest slack message text.Retrieve latest set Slack team domain.boolean
postToSlack
(String messageText, PrintStream buildLog) Function to send a slack message to a channel specificed in the plugin configuration.
-
Method Details
-
getBotUser
public boolean getBotUser()Retrieve latest set Slack bot user.- Returns:
- String of slack bot user
-
getTeamDomain
Retrieve latest set Slack team domain.- Returns:
- String of slack team domain
-
getBaseUrl
Retrieve latest set Slack base URL.- Returns:
- String of slack base URL
-
getRoom
Retrieve latest set Slack channel.- Returns:
- String of slack channel name
-
getSlackMessageText
Retrieve latest slack message text.- Returns:
- String of slack message
-
postToSlack
Function to send a slack message to a channel specificed in the plugin configuration. Uses all slack plugin settings except those that are overridden by the build failure analyzer plugin configurations (this plugin).- Parameters:
messageText
- - Content of the slack message.buildLog
- - PrintStream of build to allow for success and error messages to be displayed.- Returns:
- boolean true if message sent successfully, otherwise false
-