34
34
public class StashBuildTrigger extends Trigger <Job <?, ?>> {
35
35
private static final Logger logger =
36
36
Logger .getLogger (MethodHandles .lookup ().lookupClass ().getName ());
37
+
38
+ // Required settings
37
39
private final String cron ;
38
40
private final String stashHost ;
39
41
private final String credentialsId ;
40
42
private final String projectCode ;
41
43
private final String repositoryName ;
42
- private final String ciSkipPhrases ;
43
- private final String ciBuildPhrases ;
44
- private final String targetBranchesToBuild ;
45
- private final boolean ignoreSsl ;
46
- private final boolean checkDestinationCommit ;
47
- private final boolean checkMergeable ;
48
- private final boolean mergeOnSuccess ;
49
- private final boolean checkNotConflicted ;
50
- private final boolean onlyBuildOnComment ;
51
- private final boolean deletePreviousBuildFinishComments ;
52
- private final boolean cancelOutdatedJobsEnabled ;
53
44
45
+ // Optional settings
46
+ private boolean ignoreSsl ;
47
+ private String targetBranchesToBuild ;
48
+ private boolean checkDestinationCommit ;
49
+ private boolean checkNotConflicted ;
50
+ private boolean checkMergeable ;
54
51
private boolean checkProbeMergeStatus ;
52
+ private boolean mergeOnSuccess ;
53
+ private boolean deletePreviousBuildFinishComments ;
54
+ private boolean cancelOutdatedJobsEnabled ;
55
+ private String ciSkipPhrases ;
56
+ private boolean onlyBuildOnComment ;
57
+ private String ciBuildPhrases ;
55
58
56
59
private transient StashPullRequestsBuilder stashPullRequestsBuilder ;
57
60
@@ -63,52 +66,24 @@ public StashBuildTrigger(
63
66
String stashHost ,
64
67
String credentialsId ,
65
68
String projectCode ,
66
- String repositoryName ,
67
- String ciSkipPhrases ,
68
- boolean ignoreSsl ,
69
- boolean checkDestinationCommit ,
70
- boolean checkMergeable ,
71
- boolean mergeOnSuccess ,
72
- boolean checkNotConflicted ,
73
- boolean onlyBuildOnComment ,
74
- String ciBuildPhrases ,
75
- boolean deletePreviousBuildFinishComments ,
76
- String targetBranchesToBuild ,
77
- boolean cancelOutdatedJobsEnabled )
69
+ String repositoryName )
78
70
throws ANTLRException {
79
71
super (cron );
80
72
this .cron = cron ;
81
73
this .stashHost = stashHost ;
82
74
this .credentialsId = credentialsId ;
83
75
this .projectCode = projectCode ;
84
76
this .repositoryName = repositoryName ;
85
- this .ciSkipPhrases = ciSkipPhrases ;
86
- this .cancelOutdatedJobsEnabled = cancelOutdatedJobsEnabled ;
87
- this .ciBuildPhrases = ciBuildPhrases == null ? "test this please" : ciBuildPhrases ;
88
- this .ignoreSsl = ignoreSsl ;
89
- this .checkDestinationCommit = checkDestinationCommit ;
90
- this .checkMergeable = checkMergeable ;
91
- this .mergeOnSuccess = mergeOnSuccess ;
92
- this .checkNotConflicted = checkNotConflicted ;
93
- this .onlyBuildOnComment = onlyBuildOnComment ;
94
- this .deletePreviousBuildFinishComments = deletePreviousBuildFinishComments ;
95
- this .targetBranchesToBuild = targetBranchesToBuild ;
96
77
}
97
78
98
- @ DataBoundSetter
99
- public void setCheckProbeMergeStatus (boolean checkProbeMergeStatus ) {
100
- this .checkProbeMergeStatus = checkProbeMergeStatus ;
79
+ public String getCron () {
80
+ return this .cron ;
101
81
}
102
82
103
83
public String getStashHost () {
104
84
return stashHost ;
105
85
}
106
86
107
- public String getCron () {
108
- return this .cron ;
109
- }
110
-
111
- // Needed for Jelly Config
112
87
public String getCredentialsId () {
113
88
return this .credentialsId ;
114
89
}
@@ -142,38 +117,114 @@ public String getRepositoryName() {
142
117
return repositoryName ;
143
118
}
144
119
145
- public String getCiSkipPhrases () {
146
- return ciSkipPhrases ;
120
+ public boolean getIgnoreSsl () {
121
+ return ignoreSsl ;
147
122
}
148
123
149
- public String getCiBuildPhrases () {
150
- return ciBuildPhrases == null ? "test this please" : ciBuildPhrases ;
124
+ @ DataBoundSetter
125
+ public void setIgnoreSsl (boolean ignoreSsl ) {
126
+ this .ignoreSsl = ignoreSsl ;
127
+ }
128
+
129
+ public String getTargetBranchesToBuild () {
130
+ return targetBranchesToBuild ;
131
+ }
132
+
133
+ @ DataBoundSetter
134
+ public void setTargetBranchesToBuild (String targetBranchesToBuild ) {
135
+ this .targetBranchesToBuild = targetBranchesToBuild ;
151
136
}
152
137
153
138
public boolean getCheckDestinationCommit () {
154
139
return checkDestinationCommit ;
155
140
}
156
141
157
- public boolean getIgnoreSsl () {
158
- return ignoreSsl ;
142
+ @ DataBoundSetter
143
+ public void setCheckDestinationCommit (boolean checkDestinationCommit ) {
144
+ this .checkDestinationCommit = checkDestinationCommit ;
159
145
}
160
146
161
- public boolean getDeletePreviousBuildFinishComments () {
162
- return deletePreviousBuildFinishComments ;
147
+ public boolean getCheckNotConflicted () {
148
+ return checkNotConflicted ;
163
149
}
164
150
165
- public String getTargetBranchesToBuild () {
166
- return targetBranchesToBuild ;
151
+ @ DataBoundSetter
152
+ public void setCheckNotConflicted (boolean checkNotConflicted ) {
153
+ this .checkNotConflicted = checkNotConflicted ;
154
+ }
155
+
156
+ public boolean getCheckMergeable () {
157
+ return checkMergeable ;
158
+ }
159
+
160
+ @ DataBoundSetter
161
+ public void setCheckMergeable (boolean checkMergeable ) {
162
+ this .checkMergeable = checkMergeable ;
163
+ }
164
+
165
+ public boolean getCheckProbeMergeStatus () {
166
+ return checkProbeMergeStatus ;
167
+ }
168
+
169
+ @ DataBoundSetter
170
+ public void setCheckProbeMergeStatus (boolean checkProbeMergeStatus ) {
171
+ this .checkProbeMergeStatus = checkProbeMergeStatus ;
167
172
}
168
173
169
174
public boolean getMergeOnSuccess () {
170
175
return mergeOnSuccess ;
171
176
}
172
177
178
+ @ DataBoundSetter
179
+ public void setMergeOnSuccess (boolean mergeOnSuccess ) {
180
+ this .mergeOnSuccess = mergeOnSuccess ;
181
+ }
182
+
183
+ public boolean getDeletePreviousBuildFinishComments () {
184
+ return deletePreviousBuildFinishComments ;
185
+ }
186
+
187
+ @ DataBoundSetter
188
+ public void setDeletePreviousBuildFinishComments (boolean deletePreviousBuildFinishComments ) {
189
+ this .deletePreviousBuildFinishComments = deletePreviousBuildFinishComments ;
190
+ }
191
+
173
192
public boolean getCancelOutdatedJobsEnabled () {
174
193
return cancelOutdatedJobsEnabled ;
175
194
}
176
195
196
+ @ DataBoundSetter
197
+ public void setCancelOutdatedJobsEnabled (boolean cancelOutdatedJobsEnabled ) {
198
+ this .cancelOutdatedJobsEnabled = cancelOutdatedJobsEnabled ;
199
+ }
200
+
201
+ public String getCiSkipPhrases () {
202
+ return ciSkipPhrases ;
203
+ }
204
+
205
+ @ DataBoundSetter
206
+ public void setCiSkipPhrases (String ciSkipPhrases ) {
207
+ this .ciSkipPhrases = ciSkipPhrases ;
208
+ }
209
+
210
+ public boolean getOnlyBuildOnComment () {
211
+ return onlyBuildOnComment ;
212
+ }
213
+
214
+ @ DataBoundSetter
215
+ public void setOnlyBuildOnComment (boolean onlyBuildOnComment ) {
216
+ this .onlyBuildOnComment = onlyBuildOnComment ;
217
+ }
218
+
219
+ public String getCiBuildPhrases () {
220
+ return ciBuildPhrases == null ? "test this please" : ciBuildPhrases ;
221
+ }
222
+
223
+ @ DataBoundSetter
224
+ public void setCiBuildPhrases (String ciBuildPhrases ) {
225
+ this .ciBuildPhrases = ciBuildPhrases ;
226
+ }
227
+
177
228
@ Override
178
229
public void start (Job <?, ?> job , boolean newInstance ) {
179
230
super .start (job , newInstance );
@@ -212,22 +263,6 @@ public void stop() {
212
263
super .stop ();
213
264
}
214
265
215
- public boolean getCheckMergeable () {
216
- return checkMergeable ;
217
- }
218
-
219
- public boolean getCheckNotConflicted () {
220
- return checkNotConflicted ;
221
- }
222
-
223
- public boolean getCheckProbeMergeStatus () {
224
- return checkProbeMergeStatus ;
225
- }
226
-
227
- public boolean getOnlyBuildOnComment () {
228
- return onlyBuildOnComment ;
229
- }
230
-
231
266
public static final class DescriptorImpl extends TriggerDescriptor {
232
267
public DescriptorImpl () {
233
268
load ();
0 commit comments