rubyjobbuilderdsl 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -13
- data/Gemfile +6 -6
- data/Gemfile.lock +41 -41
- data/LICENSE +18 -18
- data/Rakefile +12 -12
- data/docs/common.md +313 -313
- data/docs/flow.md +17 -17
- data/docs/freestyle.md +100 -100
- data/docs/gerrit.md +70 -70
- data/docs/git.md +88 -88
- data/docs/multi.md +26 -26
- data/docs/overview.md +74 -74
- data/docs/postbuild.md +266 -266
- data/docs/view.md +13 -13
- data/lib/rubyjobbuilderdsl/buildstep/ant.rb +29 -29
- data/lib/rubyjobbuilderdsl/buildstep/copyartifact.rb +23 -23
- data/lib/rubyjobbuilderdsl/buildstep/inject_env.rb +18 -18
- data/lib/rubyjobbuilderdsl/buildstep/phase.rb +19 -19
- data/lib/rubyjobbuilderdsl/buildstep/phase_job.rb +26 -26
- data/lib/rubyjobbuilderdsl/buildstep/shell.rb +24 -24
- data/lib/rubyjobbuilderdsl/buildstep/xvfb.rb +46 -46
- data/lib/rubyjobbuilderdsl/common/artifactory.rb +33 -33
- data/lib/rubyjobbuilderdsl/common/blocking_job.rb +11 -11
- data/lib/rubyjobbuilderdsl/common/build_timeout.rb +23 -23
- data/lib/rubyjobbuilderdsl/common/gerrit.rb +53 -53
- data/lib/rubyjobbuilderdsl/common/git.rb +76 -76
- data/lib/rubyjobbuilderdsl/common/logrotate.rb +24 -24
- data/lib/rubyjobbuilderdsl/common/parameter.rb +22 -22
- data/lib/rubyjobbuilderdsl/common/password.rb +12 -12
- data/lib/rubyjobbuilderdsl/common/pollscm.rb +10 -10
- data/lib/rubyjobbuilderdsl/common/scms.rb +18 -18
- data/lib/rubyjobbuilderdsl/common/throttle.rb +24 -24
- data/lib/rubyjobbuilderdsl/common/timed.rb +10 -10
- data/lib/rubyjobbuilderdsl/common/timestamps.rb +6 -6
- data/lib/rubyjobbuilderdsl/common.rb +140 -140
- data/lib/rubyjobbuilderdsl/deployer.rb +95 -95
- data/lib/rubyjobbuilderdsl/flow.rb +14 -14
- data/lib/rubyjobbuilderdsl/freestyle.rb +65 -65
- data/lib/rubyjobbuilderdsl/jenkins_client.rb +203 -203
- data/lib/rubyjobbuilderdsl/multijob.rb +24 -24
- data/lib/rubyjobbuilderdsl/postbuild/archive.rb +23 -23
- data/lib/rubyjobbuilderdsl/postbuild/chucknorris_publisher.rb +6 -6
- data/lib/rubyjobbuilderdsl/postbuild/claim_publisher.rb +6 -6
- data/lib/rubyjobbuilderdsl/postbuild/cloverphp_publisher.rb +36 -36
- data/lib/rubyjobbuilderdsl/postbuild/cucumber_json_publisher.rb +20 -20
- data/lib/rubyjobbuilderdsl/postbuild/email_publisher.rb +23 -23
- data/lib/rubyjobbuilderdsl/postbuild/game_publisher.rb +6 -6
- data/lib/rubyjobbuilderdsl/postbuild/groovy.rb +10 -10
- data/lib/rubyjobbuilderdsl/postbuild/html_publisher.rb +27 -27
- data/lib/rubyjobbuilderdsl/postbuild/javadoc_publisher.rb +19 -19
- data/lib/rubyjobbuilderdsl/postbuild/logparser.rb +21 -21
- data/lib/rubyjobbuilderdsl/postbuild/nunit_publisher.rb +21 -21
- data/lib/rubyjobbuilderdsl/postbuild/pmd_publisher.rb +19 -19
- data/lib/rubyjobbuilderdsl/postbuild/script.rb +14 -14
- data/lib/rubyjobbuilderdsl/postbuild/tap_publisher.rb +44 -44
- data/lib/rubyjobbuilderdsl/postbuild/trigger.rb +38 -38
- data/lib/rubyjobbuilderdsl/postbuild/xunit_publisher.rb +35 -35
- data/lib/rubyjobbuilderdsl/postbuild.rb +160 -160
- data/lib/rubyjobbuilderdsl/view.rb +14 -14
- data/lib/rubyjobbuilderdsl/xml_generator.rb +1 -1
- data/lib/rubyjobbuilderdsl.rb +2 -2
- data/rubyjobbuilderdsl-0.0.3.gem +0 -0
- data/rubyjobbuilderdsl.gemspec +13 -13
- data/rubyjobbuilderdsl.sublime-project +14 -14
- data/run_tests.sh +7 -7
- data/sample/Schedule-sample-pipeline.xml +32 -0
- data/sample/hello_mars.rb +27 -27
- data/sample/local.ini +4 -4
- data/test/test_ant.rb +38 -38
- data/test/test_archive.rb +24 -24
- data/test/test_artifactory.rb +26 -26
- data/test/test_blocking_job.rb +18 -18
- data/test/test_chucknorris_publisher.rb +17 -17
- data/test/test_claim_publisher.rb +17 -17
- data/test/test_cloverphp.rb +33 -33
- data/test/test_concurrent.rb +44 -44
- data/test/test_copyartifact.rb +45 -45
- data/test/test_cucumber_json_publisher.rb +30 -30
- data/test/test_default_setting.rb +29 -29
- data/test/test_email_publisher.rb +44 -44
- data/test/test_flow.rb +19 -19
- data/test/test_freestyle.rb +52 -52
- data/test/test_game_publisher.rb +17 -17
- data/test/test_gerrit.rb +117 -117
- data/test/test_git.rb +80 -80
- data/test/test_html_publisher.rb +57 -57
- data/test/test_inject.rb +23 -23
- data/test/test_javadoc.rb +22 -22
- data/test/test_logparser.rb +24 -24
- data/test/test_logrotate.rb +22 -22
- data/test/test_multijob.rb +50 -50
- data/test/test_nunit_publisher.rb +20 -20
- data/test/test_parameter.rb +44 -44
- data/test/test_password.rb +17 -17
- data/test/test_pmd.rb +22 -22
- data/test/test_pollscm.rb +15 -15
- data/test/test_postbuild_groovy.rb +21 -21
- data/test/test_postbuild_script.rb +24 -24
- data/test/test_postbuild_trigger.rb +170 -170
- data/test/test_scms.rb +31 -31
- data/test/test_tap_publisher.rb +25 -25
- data/test/test_timed.rb +15 -15
- data/test/test_timeout.rb +20 -20
- data/test/test_timestamps.rb +14 -14
- data/test/test_xml_generator.rb +28 -28
- data/test/test_xunit_publisher.rb +22 -22
- data/test/test_xvfb.rb +35 -35
- metadata +9 -11
- data/sample/hello_mars.xml +0 -18
- data/sample/hello_world-post.xml +0 -40
- data/sample/sample_flow.rb +0 -15
- data/sample/test.xml +0 -21
data/docs/common.md
CHANGED
|
@@ -1,313 +1,313 @@
|
|
|
1
|
-
## Common vocabulary
|
|
2
|
-
|
|
3
|
-
Common keywords are applicable for both freestyle job and flow job.
|
|
4
|
-
|
|
5
|
-
**artifactory**
|
|
6
|
-
|
|
7
|
-
Description: Deploy artifacts to jfrog artifactory server
|
|
8
|
-
|
|
9
|
-
Multiple: Override
|
|
10
|
-
|
|
11
|
-
Example
|
|
12
|
-
|
|
13
|
-
builder.freestyle 'hello_world-build' do
|
|
14
|
-
artifactory do
|
|
15
|
-
server 'artifactory.acme.com'
|
|
16
|
-
repository 'dev'
|
|
17
|
-
deploy 'hello_world-1.0.$BUILD_NUMBER.zip'
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
**blocked_by**
|
|
22
|
-
|
|
23
|
-
Description: Block build if certain specified jobs are running
|
|
24
|
-
|
|
25
|
-
Multiple: Add
|
|
26
|
-
|
|
27
|
-
Example
|
|
28
|
-
|
|
29
|
-
builder.freestyle 'hello_world-deploy' do
|
|
30
|
-
blocked_by 'hello_world-sevicetest'
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
**Builder**
|
|
34
|
-
|
|
35
|
-
Description: We create builder instance that will be used later to build jobs
|
|
36
|
-
|
|
37
|
-
Multiple: N/A
|
|
38
|
-
|
|
39
|
-
Example
|
|
40
|
-
|
|
41
|
-
require 'rubyjobbuilderdsl'
|
|
42
|
-
builder = JenkinsJob::Builder.new
|
|
43
|
-
|
|
44
|
-
**concurrent**
|
|
45
|
-
|
|
46
|
-
Description: Specify condition for multiple builds of the same job to run concurrently across all nodes of the same category
|
|
47
|
-
|
|
48
|
-
Multiple: Override
|
|
49
|
-
|
|
50
|
-
Example
|
|
51
|
-
|
|
52
|
-
builder.freestyle 'hello_world-servicetest' do
|
|
53
|
-
concurrent do
|
|
54
|
-
max_per_node 1
|
|
55
|
-
max_total 0
|
|
56
|
-
category 'servicetest'
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
**concurrent**
|
|
61
|
-
|
|
62
|
-
Description: Specify condition for multiple builds of the same job to run concurrently across all nodes of the same project
|
|
63
|
-
|
|
64
|
-
Multiple: Override
|
|
65
|
-
|
|
66
|
-
Example
|
|
67
|
-
|
|
68
|
-
builder.freestyle 'hello_world-build' do
|
|
69
|
-
concurrent do
|
|
70
|
-
max_per_node 2
|
|
71
|
-
max_total 0
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
**Deployer**
|
|
76
|
-
|
|
77
|
-
Description: We create deployer instance that will be used to generate/deploy jobs config
|
|
78
|
-
|
|
79
|
-
Multiple: N/A
|
|
80
|
-
|
|
81
|
-
Example
|
|
82
|
-
|
|
83
|
-
require 'rubyjobbuilderdsl'
|
|
84
|
-
check_builder = JenkinsJob::Builder.new
|
|
85
|
-
worker_builder = JenkinsJob::Builder.new
|
|
86
|
-
JenkinsJob::Deployer.new(check_builder, worker_builder).run
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
**Desc**
|
|
90
|
-
|
|
91
|
-
Description: Specify project's description
|
|
92
|
-
|
|
93
|
-
Multiple: Override
|
|
94
|
-
|
|
95
|
-
Example
|
|
96
|
-
|
|
97
|
-
builder.freestyle 'hello_world-build' do
|
|
98
|
-
desc 'this is a hello world project'
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
**flow**
|
|
102
|
-
|
|
103
|
-
Description: Add Create a flow job
|
|
104
|
-
|
|
105
|
-
Multiple: Add
|
|
106
|
-
|
|
107
|
-
Example
|
|
108
|
-
|
|
109
|
-
builder.flow 'hello_world-check' do
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
**freestyle**
|
|
113
|
-
|
|
114
|
-
Description: Add Create a freestyle job
|
|
115
|
-
|
|
116
|
-
Multiple: Add
|
|
117
|
-
|
|
118
|
-
Example
|
|
119
|
-
|
|
120
|
-
builder.freestyle 'hello_world-build' do
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
**gerrit**
|
|
124
|
-
|
|
125
|
-
Description: trigger the job on Gerrit event
|
|
126
|
-
|
|
127
|
-
Multiple: Override
|
|
128
|
-
|
|
129
|
-
Example
|
|
130
|
-
|
|
131
|
-
builder.flow 'hello_world-post' do
|
|
132
|
-
gerrit do
|
|
133
|
-
end
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
**git**
|
|
138
|
-
|
|
139
|
-
Description: Configure Git version as SCM
|
|
140
|
-
|
|
141
|
-
Multiple: Override
|
|
142
|
-
|
|
143
|
-
Example:
|
|
144
|
-
|
|
145
|
-
builder.freestyle 'hello_world-master' do
|
|
146
|
-
git do
|
|
147
|
-
end
|
|
148
|
-
end
|
|
149
|
-
|
|
150
|
-
**logrotate**
|
|
151
|
-
|
|
152
|
-
Description: Rotate/discard old builds
|
|
153
|
-
|
|
154
|
-
Multiple: Override
|
|
155
|
-
|
|
156
|
-
Example:
|
|
157
|
-
|
|
158
|
-
builder.freestyle 'hello_world-master' do
|
|
159
|
-
logrotate do
|
|
160
|
-
days_to_keep 14
|
|
161
|
-
num_to_keep -1
|
|
162
|
-
artifact_days_to_keep 2
|
|
163
|
-
artifact_num_to_keep -1
|
|
164
|
-
end
|
|
165
|
-
end
|
|
166
|
-
|
|
167
|
-
**node**
|
|
168
|
-
|
|
169
|
-
Description: Run a job on specific node or kind of nodes
|
|
170
|
-
|
|
171
|
-
Multiple: Override
|
|
172
|
-
|
|
173
|
-
Example:
|
|
174
|
-
|
|
175
|
-
builder.freestyle 'hello_world-build' do
|
|
176
|
-
node 'windows'
|
|
177
|
-
end
|
|
178
|
-
|
|
179
|
-
**parameter**
|
|
180
|
-
|
|
181
|
-
Description: Create parameter for a job
|
|
182
|
-
|
|
183
|
-
Multiple: Add
|
|
184
|
-
|
|
185
|
-
Example:
|
|
186
|
-
|
|
187
|
-
builder.freestyle 'hello_world-check' do
|
|
188
|
-
parameter 'GERRIT_BRANCH' do
|
|
189
|
-
default 'master'
|
|
190
|
-
end
|
|
191
|
-
parameter 'GERRIT_REFSPEC' do
|
|
192
|
-
default 'refs/heads/${GERRIT_BRANCH}'
|
|
193
|
-
end
|
|
194
|
-
end
|
|
195
|
-
|
|
196
|
-
**password**
|
|
197
|
-
|
|
198
|
-
Description: Specify password encrypted by jenkins, that is decrypted when being retrieved via environment variable
|
|
199
|
-
|
|
200
|
-
Multiple: Override
|
|
201
|
-
|
|
202
|
-
Example:
|
|
203
|
-
|
|
204
|
-
builder.freestyle 'hello_world-deploy' do
|
|
205
|
-
password 'ADMIN', 'PhxHFCjgSiXR2umXhALLq+RzqJBxODDJT4t9Tw5JXbI='
|
|
206
|
-
end
|
|
207
|
-
|
|
208
|
-
**password_parameter**
|
|
209
|
-
|
|
210
|
-
Description: Create a parameter for password for a job
|
|
211
|
-
|
|
212
|
-
Multiple: Add
|
|
213
|
-
|
|
214
|
-
Example:
|
|
215
|
-
|
|
216
|
-
builder.freestyle 'hello_world-check' do
|
|
217
|
-
password_parameter 'PASS' do
|
|
218
|
-
default 'xyz#'
|
|
219
|
-
end
|
|
220
|
-
end
|
|
221
|
-
|
|
222
|
-
**pollscm**
|
|
223
|
-
|
|
224
|
-
Description: Specify SCM polling frequency in crontab format
|
|
225
|
-
|
|
226
|
-
Multiple: Override
|
|
227
|
-
|
|
228
|
-
Example:
|
|
229
|
-
|
|
230
|
-
builder.freestyle 'hello_world-master' do
|
|
231
|
-
pollscm '*/5 * * * *'
|
|
232
|
-
end
|
|
233
|
-
|
|
234
|
-
**postbuild**
|
|
235
|
-
|
|
236
|
-
Description: Create post build actions freestyle/flow
|
|
237
|
-
|
|
238
|
-
Multiple: Merged
|
|
239
|
-
|
|
240
|
-
Example:
|
|
241
|
-
|
|
242
|
-
builder.freestyle 'hello_world-master' do
|
|
243
|
-
postbuild do
|
|
244
|
-
end
|
|
245
|
-
end
|
|
246
|
-
|
|
247
|
-
**quiet_period**
|
|
248
|
-
|
|
249
|
-
Description: Wait a specified period in seconds before running freestyle/flow
|
|
250
|
-
|
|
251
|
-
Multiple: Override
|
|
252
|
-
|
|
253
|
-
Example:
|
|
254
|
-
|
|
255
|
-
builder.freestyle 'hello_world-build' do
|
|
256
|
-
quiet_period 5
|
|
257
|
-
end
|
|
258
|
-
|
|
259
|
-
**scms**
|
|
260
|
-
|
|
261
|
-
Description: Configure multiple SCM's
|
|
262
|
-
|
|
263
|
-
Multiple: Override
|
|
264
|
-
|
|
265
|
-
Example:
|
|
266
|
-
|
|
267
|
-
builder.freestyle 'hello_world-master' do
|
|
268
|
-
scms do
|
|
269
|
-
git do
|
|
270
|
-
end
|
|
271
|
-
git do
|
|
272
|
-
end
|
|
273
|
-
end
|
|
274
|
-
end
|
|
275
|
-
|
|
276
|
-
**timed**
|
|
277
|
-
|
|
278
|
-
Description: Specify frequency to run a build in crontab format freestyle/flow
|
|
279
|
-
|
|
280
|
-
Multiple: Override
|
|
281
|
-
|
|
282
|
-
Example:
|
|
283
|
-
|
|
284
|
-
builder.freestyle 'hello_world-master' do
|
|
285
|
-
timed '*/5 * * * *'
|
|
286
|
-
end
|
|
287
|
-
|
|
288
|
-
**timeout**
|
|
289
|
-
|
|
290
|
-
Description: Specify elastic timeout as percentage of last 3 successful builds or absolute value in minutes if they are not available
|
|
291
|
-
|
|
292
|
-
Multiple: Override
|
|
293
|
-
|
|
294
|
-
Example:
|
|
295
|
-
|
|
296
|
-
builder.freestyle 'hello_world-build' do
|
|
297
|
-
timeout 'elastic' do
|
|
298
|
-
elastic_percentage 200
|
|
299
|
-
elastic_default_timeout 30
|
|
300
|
-
end
|
|
301
|
-
end
|
|
302
|
-
|
|
303
|
-
**timestamps**
|
|
304
|
-
|
|
305
|
-
Description: Show time stamp for build's console log
|
|
306
|
-
|
|
307
|
-
Multiple: Override
|
|
308
|
-
|
|
309
|
-
Example:
|
|
310
|
-
|
|
311
|
-
builder.freestyle 'hello_world-build' do
|
|
312
|
-
timestamps
|
|
313
|
-
end
|
|
1
|
+
## Common vocabulary
|
|
2
|
+
|
|
3
|
+
Common keywords are applicable for both freestyle job and flow job.
|
|
4
|
+
|
|
5
|
+
**artifactory**
|
|
6
|
+
|
|
7
|
+
Description: Deploy artifacts to jfrog artifactory server
|
|
8
|
+
|
|
9
|
+
Multiple: Override
|
|
10
|
+
|
|
11
|
+
Example
|
|
12
|
+
|
|
13
|
+
builder.freestyle 'hello_world-build' do
|
|
14
|
+
artifactory do
|
|
15
|
+
server 'artifactory.acme.com'
|
|
16
|
+
repository 'dev'
|
|
17
|
+
deploy 'hello_world-1.0.$BUILD_NUMBER.zip'
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
**blocked_by**
|
|
22
|
+
|
|
23
|
+
Description: Block build if certain specified jobs are running
|
|
24
|
+
|
|
25
|
+
Multiple: Add
|
|
26
|
+
|
|
27
|
+
Example
|
|
28
|
+
|
|
29
|
+
builder.freestyle 'hello_world-deploy' do
|
|
30
|
+
blocked_by 'hello_world-sevicetest'
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
**Builder**
|
|
34
|
+
|
|
35
|
+
Description: We create builder instance that will be used later to build jobs
|
|
36
|
+
|
|
37
|
+
Multiple: N/A
|
|
38
|
+
|
|
39
|
+
Example
|
|
40
|
+
|
|
41
|
+
require 'rubyjobbuilderdsl'
|
|
42
|
+
builder = JenkinsJob::Builder.new
|
|
43
|
+
|
|
44
|
+
**concurrent**
|
|
45
|
+
|
|
46
|
+
Description: Specify condition for multiple builds of the same job to run concurrently across all nodes of the same category
|
|
47
|
+
|
|
48
|
+
Multiple: Override
|
|
49
|
+
|
|
50
|
+
Example
|
|
51
|
+
|
|
52
|
+
builder.freestyle 'hello_world-servicetest' do
|
|
53
|
+
concurrent do
|
|
54
|
+
max_per_node 1
|
|
55
|
+
max_total 0
|
|
56
|
+
category 'servicetest'
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
**concurrent**
|
|
61
|
+
|
|
62
|
+
Description: Specify condition for multiple builds of the same job to run concurrently across all nodes of the same project
|
|
63
|
+
|
|
64
|
+
Multiple: Override
|
|
65
|
+
|
|
66
|
+
Example
|
|
67
|
+
|
|
68
|
+
builder.freestyle 'hello_world-build' do
|
|
69
|
+
concurrent do
|
|
70
|
+
max_per_node 2
|
|
71
|
+
max_total 0
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
**Deployer**
|
|
76
|
+
|
|
77
|
+
Description: We create deployer instance that will be used to generate/deploy jobs config
|
|
78
|
+
|
|
79
|
+
Multiple: N/A
|
|
80
|
+
|
|
81
|
+
Example
|
|
82
|
+
|
|
83
|
+
require 'rubyjobbuilderdsl'
|
|
84
|
+
check_builder = JenkinsJob::Builder.new
|
|
85
|
+
worker_builder = JenkinsJob::Builder.new
|
|
86
|
+
JenkinsJob::Deployer.new(check_builder, worker_builder).run
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
**Desc**
|
|
90
|
+
|
|
91
|
+
Description: Specify project's description
|
|
92
|
+
|
|
93
|
+
Multiple: Override
|
|
94
|
+
|
|
95
|
+
Example
|
|
96
|
+
|
|
97
|
+
builder.freestyle 'hello_world-build' do
|
|
98
|
+
desc 'this is a hello world project'
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
**flow**
|
|
102
|
+
|
|
103
|
+
Description: Add Create a flow job
|
|
104
|
+
|
|
105
|
+
Multiple: Add
|
|
106
|
+
|
|
107
|
+
Example
|
|
108
|
+
|
|
109
|
+
builder.flow 'hello_world-check' do
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
**freestyle**
|
|
113
|
+
|
|
114
|
+
Description: Add Create a freestyle job
|
|
115
|
+
|
|
116
|
+
Multiple: Add
|
|
117
|
+
|
|
118
|
+
Example
|
|
119
|
+
|
|
120
|
+
builder.freestyle 'hello_world-build' do
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
**gerrit**
|
|
124
|
+
|
|
125
|
+
Description: trigger the job on Gerrit event
|
|
126
|
+
|
|
127
|
+
Multiple: Override
|
|
128
|
+
|
|
129
|
+
Example
|
|
130
|
+
|
|
131
|
+
builder.flow 'hello_world-post' do
|
|
132
|
+
gerrit do
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
**git**
|
|
138
|
+
|
|
139
|
+
Description: Configure Git version as SCM
|
|
140
|
+
|
|
141
|
+
Multiple: Override
|
|
142
|
+
|
|
143
|
+
Example:
|
|
144
|
+
|
|
145
|
+
builder.freestyle 'hello_world-master' do
|
|
146
|
+
git do
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
**logrotate**
|
|
151
|
+
|
|
152
|
+
Description: Rotate/discard old builds
|
|
153
|
+
|
|
154
|
+
Multiple: Override
|
|
155
|
+
|
|
156
|
+
Example:
|
|
157
|
+
|
|
158
|
+
builder.freestyle 'hello_world-master' do
|
|
159
|
+
logrotate do
|
|
160
|
+
days_to_keep 14
|
|
161
|
+
num_to_keep -1
|
|
162
|
+
artifact_days_to_keep 2
|
|
163
|
+
artifact_num_to_keep -1
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
**node**
|
|
168
|
+
|
|
169
|
+
Description: Run a job on specific node or kind of nodes
|
|
170
|
+
|
|
171
|
+
Multiple: Override
|
|
172
|
+
|
|
173
|
+
Example:
|
|
174
|
+
|
|
175
|
+
builder.freestyle 'hello_world-build' do
|
|
176
|
+
node 'windows'
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
**parameter**
|
|
180
|
+
|
|
181
|
+
Description: Create parameter for a job
|
|
182
|
+
|
|
183
|
+
Multiple: Add
|
|
184
|
+
|
|
185
|
+
Example:
|
|
186
|
+
|
|
187
|
+
builder.freestyle 'hello_world-check' do
|
|
188
|
+
parameter 'GERRIT_BRANCH' do
|
|
189
|
+
default 'master'
|
|
190
|
+
end
|
|
191
|
+
parameter 'GERRIT_REFSPEC' do
|
|
192
|
+
default 'refs/heads/${GERRIT_BRANCH}'
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
**password**
|
|
197
|
+
|
|
198
|
+
Description: Specify password encrypted by jenkins, that is decrypted when being retrieved via environment variable
|
|
199
|
+
|
|
200
|
+
Multiple: Override
|
|
201
|
+
|
|
202
|
+
Example:
|
|
203
|
+
|
|
204
|
+
builder.freestyle 'hello_world-deploy' do
|
|
205
|
+
password 'ADMIN', 'PhxHFCjgSiXR2umXhALLq+RzqJBxODDJT4t9Tw5JXbI='
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
**password_parameter**
|
|
209
|
+
|
|
210
|
+
Description: Create a parameter for password for a job
|
|
211
|
+
|
|
212
|
+
Multiple: Add
|
|
213
|
+
|
|
214
|
+
Example:
|
|
215
|
+
|
|
216
|
+
builder.freestyle 'hello_world-check' do
|
|
217
|
+
password_parameter 'PASS' do
|
|
218
|
+
default 'xyz#'
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
**pollscm**
|
|
223
|
+
|
|
224
|
+
Description: Specify SCM polling frequency in crontab format
|
|
225
|
+
|
|
226
|
+
Multiple: Override
|
|
227
|
+
|
|
228
|
+
Example:
|
|
229
|
+
|
|
230
|
+
builder.freestyle 'hello_world-master' do
|
|
231
|
+
pollscm '*/5 * * * *'
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
**postbuild**
|
|
235
|
+
|
|
236
|
+
Description: Create post build actions freestyle/flow
|
|
237
|
+
|
|
238
|
+
Multiple: Merged
|
|
239
|
+
|
|
240
|
+
Example:
|
|
241
|
+
|
|
242
|
+
builder.freestyle 'hello_world-master' do
|
|
243
|
+
postbuild do
|
|
244
|
+
end
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
**quiet_period**
|
|
248
|
+
|
|
249
|
+
Description: Wait a specified period in seconds before running freestyle/flow
|
|
250
|
+
|
|
251
|
+
Multiple: Override
|
|
252
|
+
|
|
253
|
+
Example:
|
|
254
|
+
|
|
255
|
+
builder.freestyle 'hello_world-build' do
|
|
256
|
+
quiet_period 5
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
**scms**
|
|
260
|
+
|
|
261
|
+
Description: Configure multiple SCM's
|
|
262
|
+
|
|
263
|
+
Multiple: Override
|
|
264
|
+
|
|
265
|
+
Example:
|
|
266
|
+
|
|
267
|
+
builder.freestyle 'hello_world-master' do
|
|
268
|
+
scms do
|
|
269
|
+
git do
|
|
270
|
+
end
|
|
271
|
+
git do
|
|
272
|
+
end
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
**timed**
|
|
277
|
+
|
|
278
|
+
Description: Specify frequency to run a build in crontab format freestyle/flow
|
|
279
|
+
|
|
280
|
+
Multiple: Override
|
|
281
|
+
|
|
282
|
+
Example:
|
|
283
|
+
|
|
284
|
+
builder.freestyle 'hello_world-master' do
|
|
285
|
+
timed '*/5 * * * *'
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
**timeout**
|
|
289
|
+
|
|
290
|
+
Description: Specify elastic timeout as percentage of last 3 successful builds or absolute value in minutes if they are not available
|
|
291
|
+
|
|
292
|
+
Multiple: Override
|
|
293
|
+
|
|
294
|
+
Example:
|
|
295
|
+
|
|
296
|
+
builder.freestyle 'hello_world-build' do
|
|
297
|
+
timeout 'elastic' do
|
|
298
|
+
elastic_percentage 200
|
|
299
|
+
elastic_default_timeout 30
|
|
300
|
+
end
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
**timestamps**
|
|
304
|
+
|
|
305
|
+
Description: Show time stamp for build's console log
|
|
306
|
+
|
|
307
|
+
Multiple: Override
|
|
308
|
+
|
|
309
|
+
Example:
|
|
310
|
+
|
|
311
|
+
builder.freestyle 'hello_world-build' do
|
|
312
|
+
timestamps
|
|
313
|
+
end
|
data/docs/flow.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
## Create build flow style project
|
|
2
|
-
|
|
3
|
-
**dsl**
|
|
4
|
-
|
|
5
|
-
Description: Specify groovy DSL for a flow job
|
|
6
|
-
|
|
7
|
-
Multiple: Override
|
|
8
|
-
|
|
9
|
-
Example
|
|
10
|
-
|
|
11
|
-
builder.flow 'hello_world-post' do
|
|
12
|
-
dsl <<EOS
|
|
13
|
-
build("hello_worl-" + params["GERRIT_BRANCH"],
|
|
14
|
-
GERRIT_REFSPEC: "refs/heads/${params["GERRIT_BRANCH"]}",
|
|
15
|
-
GERRIT_BRANCH: params["GERRIT_BRANCH"])
|
|
16
|
-
EOS
|
|
17
|
-
|
|
1
|
+
## Create build flow style project
|
|
2
|
+
|
|
3
|
+
**dsl**
|
|
4
|
+
|
|
5
|
+
Description: Specify groovy DSL for a flow job
|
|
6
|
+
|
|
7
|
+
Multiple: Override
|
|
8
|
+
|
|
9
|
+
Example
|
|
10
|
+
|
|
11
|
+
builder.flow 'hello_world-post' do
|
|
12
|
+
dsl <<EOS
|
|
13
|
+
build("hello_worl-" + params["GERRIT_BRANCH"],
|
|
14
|
+
GERRIT_REFSPEC: "refs/heads/${params["GERRIT_BRANCH"]}",
|
|
15
|
+
GERRIT_BRANCH: params["GERRIT_BRANCH"])
|
|
16
|
+
EOS
|
|
17
|
+
|
|
18
18
|
end
|