Skip to content

Commit

Permalink
adding
Browse files Browse the repository at this point in the history
  • Loading branch information
ltamaster committed Jun 6, 2019
1 parent 0229334 commit f0154f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public class SlackNotificationPlugin implements NotificationPlugin {
private static final String TRIGGER_SUCCESS = "success";
private static final String TRIGGER_FAILURE = "failure";
private static final String TRIGGER_AVERAGE = "avgduration";
private static final String TRIGGER_ONRETRY = "retryablefailure";

private static final Map<String, SlackNotificationData> TRIGGER_NOTIFICATION_DATA = new HashMap<String, SlackNotificationData>();

Expand Down Expand Up @@ -103,6 +104,8 @@ public boolean postNotification(String trigger, Map executionData, Map config) {
TRIGGER_NOTIFICATION_DATA.put(TRIGGER_SUCCESS, new SlackNotificationData(ACTUAL_SLACK_TEMPLATE, SLACK_MESSAGE_COLOR_GREEN));
TRIGGER_NOTIFICATION_DATA.put(TRIGGER_FAILURE, new SlackNotificationData(ACTUAL_SLACK_TEMPLATE, SLACK_MESSAGE_COLOR_RED));
TRIGGER_NOTIFICATION_DATA.put(TRIGGER_AVERAGE, new SlackNotificationData(ACTUAL_SLACK_TEMPLATE, SLACK_MESSAGE_COLOR_YELLOW));
TRIGGER_NOTIFICATION_DATA.put(TRIGGER_ONRETRY, new SlackNotificationData(ACTUAL_SLACK_TEMPLATE, SLACK_MESSAGE_COLOR_YELLOW));


try {
FREEMARKER_CFG.setSetting(Configuration.CACHE_STORAGE_KEY, "strong:20, soft:250");
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/templates/slack-incoming-message.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
<#assign state="Failed">
<#elseif trigger == "avgduration">
<#assign state="Average exceeded">
<#elseif trigger == "retryablefailure">
<#assign state="Retry Failure">
<#else>
<#assign state="Succeeded">
<#assign state="Succeeded">
</#if>

{
Expand Down

1 comment on commit f0154f9

@ltamaster
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding retryablefailure trigger, for issue #5

Please sign in to comment.