rubyjobbuilderdsl 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- 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.rb +2 -2
- 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.rb +140 -140
- 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/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.rb +160 -160
- 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/view.rb +14 -14
- data/lib/rubyjobbuilderdsl/xml_generator.rb +1 -1
- data/rubyjobbuilderdsl.gemspec +2 -2
- data/rubyjobbuilderdsl.sublime-project +14 -14
- data/run_tests.sh +7 -7
- data/sample/hello_mars.rb +27 -27
- data/sample/hello_mars.xml +18 -0
- data/sample/hello_world-post.xml +40 -0
- data/sample/local.ini +4 -4
- data/sample/test.xml +21 -0
- 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 +11 -10
- data/rubyjobbuilderdsl-0.0.3.gem +0 -0
- data/sample/Schedule-sample-pipeline.xml +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YmYzOGU5ZjA1NDBhOWFkMjEzMTgwZjUzN2ZmODhkMDJiNGFkZjJhYQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MzY1ZjdlMDJjNDU3MjY1Nzc5MzI3OTVkMDEzY2Q5Y2NhYjE1NDc2OA==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
OTExNjhkMDUwZjRlMTkzOTRlM2VkMTljMGE5YTA1ZWY0NDljOGZkOTk1NjY4
|
10
|
+
MWM2NjQ5OGE3YWU2MWJiZWI5ZmQxZjhjYjBlZTI2NjIzNTJiZTIwN2ZlODUx
|
11
|
+
NWFjNWQxYmQ5ZDVmYmNiODYwZmU0MWY5YzY3ZDlhNGNlYmJiZWE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
N2NkNzcwZDg4OGMyNDI0MmNhZmU3OTA5MTdjY2M3ZDdlMDg5NjBmYWYzZDQ0
|
14
|
+
NzE0MTU4NjdmZGRlNzc2ZTY3NGIzMjczZDg3Y2ExMTFiNDQ5NjcyNWIwZWJk
|
15
|
+
N2UzYzJlODIzODJmZmM5Yzg5NGE0OTM4ZjM0YzNmMmJlMTk1NmI=
|
data/Gemfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
source 'http://rubygems.org'
|
2
|
-
|
3
|
-
gem 'rubocop'
|
4
|
-
gem 'builder'
|
5
|
-
gem 'nokogiri'
|
6
|
-
gem 'rake'
|
1
|
+
source 'http://rubygems.org'
|
2
|
+
|
3
|
+
gem 'rubocop'
|
4
|
+
gem 'builder'
|
5
|
+
gem 'nokogiri'
|
6
|
+
gem 'rake'
|
data/Gemfile.lock
CHANGED
@@ -1,41 +1,41 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
ast (2.0.0)
|
5
|
-
astrolabe (1.3.0)
|
6
|
-
parser (>= 2.2.0.pre.3, < 3.0)
|
7
|
-
builder (3.2.2)
|
8
|
-
mini_portile (0.6.0)
|
9
|
-
nokogiri (1.6.3.1)
|
10
|
-
mini_portile (= 0.6.0)
|
11
|
-
nokogiri (1.6.3.1-x64-mingw32)
|
12
|
-
mini_portile (= 0.6.0)
|
13
|
-
nokogiri (1.6.3.1-x86-mingw32)
|
14
|
-
mini_portile (= 0.6.0)
|
15
|
-
parser (2.2.0.pre.4)
|
16
|
-
ast (>= 1.1, < 3.0)
|
17
|
-
slop (~> 3.4, >= 3.4.5)
|
18
|
-
powerpack (0.0.9)
|
19
|
-
rainbow (2.0.0)
|
20
|
-
rake (0.9.6)
|
21
|
-
rubocop (0.26.0)
|
22
|
-
astrolabe (~> 1.3)
|
23
|
-
parser (>= 2.2.0.pre.4, < 3.0)
|
24
|
-
powerpack (~> 0.0.6)
|
25
|
-
rainbow (>= 1.99.1, < 3.0)
|
26
|
-
ruby-progressbar (~> 1.4)
|
27
|
-
ruby-progressbar (1.5.1)
|
28
|
-
slop (3.6.0)
|
29
|
-
|
30
|
-
PLATFORMS
|
31
|
-
x64-mingw32
|
32
|
-
x86-mingw32
|
33
|
-
|
34
|
-
DEPENDENCIES
|
35
|
-
builder
|
36
|
-
nokogiri
|
37
|
-
rake
|
38
|
-
rubocop
|
39
|
-
|
40
|
-
BUNDLED WITH
|
41
|
-
1.10.6
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
ast (2.0.0)
|
5
|
+
astrolabe (1.3.0)
|
6
|
+
parser (>= 2.2.0.pre.3, < 3.0)
|
7
|
+
builder (3.2.2)
|
8
|
+
mini_portile (0.6.0)
|
9
|
+
nokogiri (1.6.3.1)
|
10
|
+
mini_portile (= 0.6.0)
|
11
|
+
nokogiri (1.6.3.1-x64-mingw32)
|
12
|
+
mini_portile (= 0.6.0)
|
13
|
+
nokogiri (1.6.3.1-x86-mingw32)
|
14
|
+
mini_portile (= 0.6.0)
|
15
|
+
parser (2.2.0.pre.4)
|
16
|
+
ast (>= 1.1, < 3.0)
|
17
|
+
slop (~> 3.4, >= 3.4.5)
|
18
|
+
powerpack (0.0.9)
|
19
|
+
rainbow (2.0.0)
|
20
|
+
rake (0.9.6)
|
21
|
+
rubocop (0.26.0)
|
22
|
+
astrolabe (~> 1.3)
|
23
|
+
parser (>= 2.2.0.pre.4, < 3.0)
|
24
|
+
powerpack (~> 0.0.6)
|
25
|
+
rainbow (>= 1.99.1, < 3.0)
|
26
|
+
ruby-progressbar (~> 1.4)
|
27
|
+
ruby-progressbar (1.5.1)
|
28
|
+
slop (3.6.0)
|
29
|
+
|
30
|
+
PLATFORMS
|
31
|
+
x64-mingw32
|
32
|
+
x86-mingw32
|
33
|
+
|
34
|
+
DEPENDENCIES
|
35
|
+
builder
|
36
|
+
nokogiri
|
37
|
+
rake
|
38
|
+
rubocop
|
39
|
+
|
40
|
+
BUNDLED WITH
|
41
|
+
1.10.6
|
data/LICENSE
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
Copyright (C) 2014 Wonga
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
of this software and associated documentation files (the "Software"), to deal
|
5
|
-
in the Software without restriction, including without limitation the rights
|
6
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
copies of the Software, and to permit persons to whom the Software is
|
8
|
-
furnished to do so, subject to the following conditions:
|
9
|
-
|
10
|
-
The above copyright notice and this permission notice shall be included in
|
11
|
-
all copies or substantial portions of the Software.
|
12
|
-
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
1
|
+
Copyright (C) 2014 Wonga
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
19
|
THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
require 'rake/testtask'
|
2
|
-
require 'rubocop/rake_task'
|
3
|
-
|
4
|
-
Rake::TestTask.new do |t|
|
5
|
-
t.libs << 'test'
|
6
|
-
t.test_files = FileList['test/test*.rb']
|
7
|
-
t.verbose = true
|
8
|
-
end
|
9
|
-
|
10
|
-
RuboCop::RakeTask.new
|
11
|
-
|
12
|
-
task :default => [:rubocop, :test]
|
1
|
+
require 'rake/testtask'
|
2
|
+
require 'rubocop/rake_task'
|
3
|
+
|
4
|
+
Rake::TestTask.new do |t|
|
5
|
+
t.libs << 'test'
|
6
|
+
t.test_files = FileList['test/test*.rb']
|
7
|
+
t.verbose = true
|
8
|
+
end
|
9
|
+
|
10
|
+
RuboCop::RakeTask.new
|
11
|
+
|
12
|
+
task :default => [:rubocop, :test]
|
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
|