-
Notifications
You must be signed in to change notification settings - Fork 831
/
MattermostPublisherContext.groovy
118 lines (102 loc) · 3.22 KB
/
MattermostPublisherContext.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
package javaposse.jobdsl.dsl.helpers.publisher
import javaposse.jobdsl.dsl.Context
class MattermostPublisherContext implements Context {
String endpoint
String room
String icon
String customMessage
boolean notifyBuildStart
boolean notifySuccess
boolean notifyAborted
boolean notifyNotBuilt
boolean notifyUnstable
boolean notifyFailure
boolean notifyBackToNormal
boolean notifyRepeatedFailure
boolean includeTestSummary
boolean showCommitList
/**
* Sends a notification when the build starts. Defaults to {@code false}.
*/
void notifyBuildStart(boolean notifyBuildStart = true) {
this.notifyBuildStart = notifyBuildStart
}
/**
* Sends a notification when the build is successful. Defaults to {@code false}.
*/
void notifySuccess(boolean notifySuccess = true) {
this.notifySuccess = notifySuccess
}
/**
* Sends a notification when the build is aborted. Defaults to {@code false}.
*/
void notifyAborted(boolean notifyAborted = true) {
this.notifyAborted = notifyAborted
}
/**
* Sends a notification when the build is not build. Defaults to {@code false}.
*/
void notifyNotBuilt(boolean notifyNotBuilt = true) {
this.notifyNotBuilt = notifyNotBuilt
}
/**
* Sends a notification when the build is unstable. Defaults to {@code false}.
*/
void notifyUnstable(boolean notifyUnstable = true) {
this.notifyUnstable = notifyUnstable
}
/**
* Sends a notification when the build is failed. Defaults to {@code false}.
*/
void notifyFailure(boolean notifyFailure = true) {
this.notifyFailure = notifyFailure
}
/**
* Sends a notification when the build is back to normal. Defaults to {@code false}.
*/
void notifyBackToNormal(boolean notifyBackToNormal = true) {
this.notifyBackToNormal = notifyBackToNormal
}
/**
* Sends a notification when the build repeats to fail. Defaults to {@code false}.
*/
void notifyRepeatedFailure(boolean notifyRepeatedFailure = true) {
this.notifyRepeatedFailure = notifyRepeatedFailure
}
/**
* Include the test summary in the build message. Defaults to {@code false}.
*/
void includeTestSummary(boolean includeTestSummary = true) {
this.includeTestSummary = includeTestSummary
}
/**
* Include the commit list with titles and authors in the build message. Defaults to {@code false}.
*/
void showCommitList(boolean showCommitList = true) {
this.showCommitList = showCommitList
}
/**
* Configures your Mattermost incoming webhook URL.
*/
void endpoint(String endpoint) {
this.endpoint = endpoint
}
/**
* Configures the channel names to which notifications should be sent.
*/
void room(String room) {
this.room = room
}
/**
* Configures the URL to use as avatar for the message.
*/
void icon(String icon) {
this.icon = icon
}
/**
* Configures custom message that will be included with the notifications displayed.
*/
void customMessage(String customMessage) {
this.customMessage = customMessage
}
}