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/overview.md
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
## Overview
|
|
2
|
-
|
|
3
|
-
The Openstack Job Builder python project use YAML as input for job creation. It is huge step from creating job using XML or even worse UI.
|
|
4
|
-
However YAML has limitation lacking of both composition and abstraction causing repetitive work and maintenance issue . It may well suit for
|
|
5
|
-
creating of dozen of jobs but not hundreds similar jobs. This is driving factor for creation of Ruby Job Builder DSL.
|
|
6
|
-
|
|
7
|
-
Ruby Jobs Builder DSL is ruby internal DSL, so it offers full fledged programming experience at the same time concise, focused vocabulary
|
|
8
|
-
for job creation.
|
|
9
|
-
|
|
10
|
-
Ruby Jobs Builder DSL can
|
|
11
|
-
|
|
12
|
-
* generate Jenkins XML job configuration files
|
|
13
|
-
* deploy jobs directly into Jenkins Server
|
|
14
|
-
|
|
15
|
-
## Example
|
|
16
|
-
|
|
17
|
-
Step 1 - Create a ruby file e.g. hello-world.rb with the following content
|
|
18
|
-
|
|
19
|
-
# hello-world.rb
|
|
20
|
-
require 'rubyjobbuilderdsl'
|
|
21
|
-
builder = JenkinsJob::Builder.new
|
|
22
|
-
builder.freestyle 'hello-world' do
|
|
23
|
-
shell 'echo hello world'
|
|
24
|
-
end
|
|
25
|
-
JenkinsJob::Deployer.new(builder).run
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Step 2 - Run it
|
|
29
|
-
|
|
30
|
-
$bundle exec ruby hello-world.rb
|
|
31
|
-
Usage:
|
|
32
|
-
hello-world.rb [--xml --output-dir=.|--deploy --config-file=localhost.ini]
|
|
33
|
-
|
|
34
|
-
Step 3 - Create XML
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
sh-3.1$ bundle exec ruby hello-world.rb --xml --output-dir=.
|
|
38
|
-
creating hello-world
|
|
39
|
-
sh-3.1$ cat hello-world.xml
|
|
40
|
-
<project>
|
|
41
|
-
<actions/>
|
|
42
|
-
<description><!-- Managed by Jenkins Job Builder --></description>
|
|
43
|
-
<keepDependencies>false</keepDependencies>
|
|
44
|
-
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
|
45
|
-
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
|
46
|
-
<concurrentBuild>false</concurrentBuild>
|
|
47
|
-
<canRoam>true</canRoam>
|
|
48
|
-
<properties/>
|
|
49
|
-
<scm class="hudson.scm.NullSCM"/>
|
|
50
|
-
<publishers/>
|
|
51
|
-
<buildWrappers/>
|
|
52
|
-
<builders>
|
|
53
|
-
<hudson.tasks.Shell>
|
|
54
|
-
<command>echo hello world</command>
|
|
55
|
-
</hudson.tasks.Shell>
|
|
56
|
-
</builders>
|
|
57
|
-
</project>
|
|
58
|
-
|
|
59
|
-
Step 4 - Upload the created job to your Jenkins server
|
|
60
|
-
|
|
61
|
-
sh-3.1$ cat localhost.ini
|
|
62
|
-
[jenkins]
|
|
63
|
-
url=http://localhost:8080/
|
|
64
|
-
user=jenkins-jobs
|
|
65
|
-
password=7bb352e4f3da683c17247f3abf88f47c
|
|
66
|
-
|
|
67
|
-
sh-3.1$ bundle exec ruby hello-world.rb --deploy ----config-file=localhost.ini
|
|
68
|
-
deploying hello-world
|
|
69
|
-
|
|
70
|
-
## References
|
|
71
|
-
|
|
72
|
-
* http://ci.openstack.org/jenkins-job-builder/
|
|
73
|
-
* https://github.com/jenkinsci/jenkins.rb
|
|
74
|
-
* https://github.com/jenkinsci/job-dsl-plugin/wiki/Job-DSL-Commands
|
|
1
|
+
## Overview
|
|
2
|
+
|
|
3
|
+
The Openstack Job Builder python project use YAML as input for job creation. It is huge step from creating job using XML or even worse UI.
|
|
4
|
+
However YAML has limitation lacking of both composition and abstraction causing repetitive work and maintenance issue . It may well suit for
|
|
5
|
+
creating of dozen of jobs but not hundreds similar jobs. This is driving factor for creation of Ruby Job Builder DSL.
|
|
6
|
+
|
|
7
|
+
Ruby Jobs Builder DSL is ruby internal DSL, so it offers full fledged programming experience at the same time concise, focused vocabulary
|
|
8
|
+
for job creation.
|
|
9
|
+
|
|
10
|
+
Ruby Jobs Builder DSL can
|
|
11
|
+
|
|
12
|
+
* generate Jenkins XML job configuration files
|
|
13
|
+
* deploy jobs directly into Jenkins Server
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
Step 1 - Create a ruby file e.g. hello-world.rb with the following content
|
|
18
|
+
|
|
19
|
+
# hello-world.rb
|
|
20
|
+
require 'rubyjobbuilderdsl'
|
|
21
|
+
builder = JenkinsJob::Builder.new
|
|
22
|
+
builder.freestyle 'hello-world' do
|
|
23
|
+
shell 'echo hello world'
|
|
24
|
+
end
|
|
25
|
+
JenkinsJob::Deployer.new(builder).run
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
Step 2 - Run it
|
|
29
|
+
|
|
30
|
+
$bundle exec ruby hello-world.rb
|
|
31
|
+
Usage:
|
|
32
|
+
hello-world.rb [--xml --output-dir=.|--deploy --config-file=localhost.ini]
|
|
33
|
+
|
|
34
|
+
Step 3 - Create XML
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
sh-3.1$ bundle exec ruby hello-world.rb --xml --output-dir=.
|
|
38
|
+
creating hello-world
|
|
39
|
+
sh-3.1$ cat hello-world.xml
|
|
40
|
+
<project>
|
|
41
|
+
<actions/>
|
|
42
|
+
<description><!-- Managed by Jenkins Job Builder --></description>
|
|
43
|
+
<keepDependencies>false</keepDependencies>
|
|
44
|
+
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
|
45
|
+
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
|
46
|
+
<concurrentBuild>false</concurrentBuild>
|
|
47
|
+
<canRoam>true</canRoam>
|
|
48
|
+
<properties/>
|
|
49
|
+
<scm class="hudson.scm.NullSCM"/>
|
|
50
|
+
<publishers/>
|
|
51
|
+
<buildWrappers/>
|
|
52
|
+
<builders>
|
|
53
|
+
<hudson.tasks.Shell>
|
|
54
|
+
<command>echo hello world</command>
|
|
55
|
+
</hudson.tasks.Shell>
|
|
56
|
+
</builders>
|
|
57
|
+
</project>
|
|
58
|
+
|
|
59
|
+
Step 4 - Upload the created job to your Jenkins server
|
|
60
|
+
|
|
61
|
+
sh-3.1$ cat localhost.ini
|
|
62
|
+
[jenkins]
|
|
63
|
+
url=http://localhost:8080/
|
|
64
|
+
user=jenkins-jobs
|
|
65
|
+
password=7bb352e4f3da683c17247f3abf88f47c
|
|
66
|
+
|
|
67
|
+
sh-3.1$ bundle exec ruby hello-world.rb --deploy ----config-file=localhost.ini
|
|
68
|
+
deploying hello-world
|
|
69
|
+
|
|
70
|
+
## References
|
|
71
|
+
|
|
72
|
+
* http://ci.openstack.org/jenkins-job-builder/
|
|
73
|
+
* https://github.com/jenkinsci/jenkins.rb
|
|
74
|
+
* https://github.com/jenkinsci/job-dsl-plugin/wiki/Job-DSL-Commands
|
data/docs/postbuild.md
CHANGED
|
@@ -1,266 +1,266 @@
|
|
|
1
|
-
## Configure post build activities
|
|
2
|
-
|
|
3
|
-
**allow_broken_build_claiming**
|
|
4
|
-
|
|
5
|
-
Description: Allow developer to claim for broken build
|
|
6
|
-
|
|
7
|
-
Multiple: Override
|
|
8
|
-
|
|
9
|
-
Example
|
|
10
|
-
|
|
11
|
-
builder.freestyle 'hello_world-build' do
|
|
12
|
-
postbuild do
|
|
13
|
-
allow_broken_build_claiming
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
**archive**
|
|
18
|
-
|
|
19
|
-
Description: Archive artifacts
|
|
20
|
-
|
|
21
|
-
Multiple: Override
|
|
22
|
-
|
|
23
|
-
Example
|
|
24
|
-
|
|
25
|
-
builder.freestyle 'hello_world-master' do
|
|
26
|
-
postbuild do
|
|
27
|
-
archive do
|
|
28
|
-
file 'package/**',
|
|
29
|
-
'output/**',
|
|
30
|
-
'dependencies/lib/**'
|
|
31
|
-
latest_only true
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
**chucknorris**
|
|
37
|
-
|
|
38
|
-
Description: Show Chuck Norris Image
|
|
39
|
-
|
|
40
|
-
Multiple: Override
|
|
41
|
-
|
|
42
|
-
Example
|
|
43
|
-
|
|
44
|
-
builder.freestyle 'hello_world-build' do
|
|
45
|
-
postbuild do
|
|
46
|
-
chucknorris
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
**game**
|
|
51
|
-
|
|
52
|
-
Description: Enable CI Game
|
|
53
|
-
|
|
54
|
-
Multiple: Override
|
|
55
|
-
|
|
56
|
-
Example
|
|
57
|
-
|
|
58
|
-
builder.freestyle 'hello_world-build' do
|
|
59
|
-
postbuild do
|
|
60
|
-
game
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
**groovy**
|
|
65
|
-
|
|
66
|
-
Description: Run groovy script
|
|
67
|
-
|
|
68
|
-
Multiple: Override
|
|
69
|
-
|
|
70
|
-
Example
|
|
71
|
-
|
|
72
|
-
builder.freestyle 'hello_world-build' do
|
|
73
|
-
postbuild do
|
|
74
|
-
groovy <<EOS
|
|
75
|
-
def logger = manager.listener.logger
|
|
76
|
-
logger.println("--- Hello World")
|
|
77
|
-
EOS
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
**logparser**
|
|
82
|
-
|
|
83
|
-
Description: Parse console log to highlight errors
|
|
84
|
-
|
|
85
|
-
Multiple: Override
|
|
86
|
-
|
|
87
|
-
Example
|
|
88
|
-
|
|
89
|
-
builder.freestyle 'hello_world-build' do
|
|
90
|
-
postbuild do
|
|
91
|
-
logparser '/var/lib/jenkins/build_parsing_rules' do
|
|
92
|
-
fail_on_error
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
**pubish_pmd**
|
|
98
|
-
|
|
99
|
-
Description: Publish PMD analysis
|
|
100
|
-
|
|
101
|
-
Multiple: Override
|
|
102
|
-
|
|
103
|
-
Example
|
|
104
|
-
|
|
105
|
-
builder.freestyle 'hello_world' do
|
|
106
|
-
postbuild do
|
|
107
|
-
publish_pmd do
|
|
108
|
-
pmd_results 'build/phppmd.txt'
|
|
109
|
-
end
|
|
110
|
-
end
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
**publish_cloverphp**
|
|
114
|
-
|
|
115
|
-
Description: Publish clover php analysis
|
|
116
|
-
|
|
117
|
-
Multiple: Override
|
|
118
|
-
|
|
119
|
-
Example
|
|
120
|
-
|
|
121
|
-
builder.freestyle 'hello_world' do
|
|
122
|
-
postbuild do
|
|
123
|
-
publish_cloverphp do
|
|
124
|
-
xml_location 'build/coverage_clover.xml'
|
|
125
|
-
html_report_dir 'build/coverage'
|
|
126
|
-
healthy_target :method => 70, :statement => 80
|
|
127
|
-
end
|
|
128
|
-
end
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
**publish_html**
|
|
132
|
-
|
|
133
|
-
Description: Publish html report
|
|
134
|
-
|
|
135
|
-
Multiple: Override
|
|
136
|
-
|
|
137
|
-
Example
|
|
138
|
-
|
|
139
|
-
builder.freestyle 'hello_world-servicetest' do
|
|
140
|
-
postbuild do
|
|
141
|
-
publish_html 'Test Report' do
|
|
142
|
-
dir '$BUILD_NUMBER\\Reports'
|
|
143
|
-
file 'test-report.html'
|
|
144
|
-
keep_all false
|
|
145
|
-
allow_missing true
|
|
146
|
-
end
|
|
147
|
-
end
|
|
148
|
-
end
|
|
149
|
-
|
|
150
|
-
**publish_javadoc**
|
|
151
|
-
|
|
152
|
-
Description: Publish javadoc
|
|
153
|
-
|
|
154
|
-
Multiple: Override
|
|
155
|
-
|
|
156
|
-
Example
|
|
157
|
-
|
|
158
|
-
builder.freestyle 'hello_world-build' do
|
|
159
|
-
postbuild do
|
|
160
|
-
publish_javadoc do
|
|
161
|
-
doc_dir 'build/doc'
|
|
162
|
-
keep_all
|
|
163
|
-
end
|
|
164
|
-
end
|
|
165
|
-
end
|
|
166
|
-
|
|
167
|
-
**publish_nunit_report**
|
|
168
|
-
|
|
169
|
-
Description: Publish NUnit test results.
|
|
170
|
-
|
|
171
|
-
Multiple: Override
|
|
172
|
-
|
|
173
|
-
Example
|
|
174
|
-
|
|
175
|
-
builder.freestyle 'hello_world-build' do
|
|
176
|
-
postbuild do
|
|
177
|
-
publish_nunit_report 'foo\\bar\\*.xml'
|
|
178
|
-
end
|
|
179
|
-
end
|
|
180
|
-
|
|
181
|
-
**publish_tap**
|
|
182
|
-
|
|
183
|
-
Description: Publish TAP test result
|
|
184
|
-
|
|
185
|
-
Multiple: Override
|
|
186
|
-
|
|
187
|
-
Example
|
|
188
|
-
|
|
189
|
-
builder.freestyle 'hello_world-build' do
|
|
190
|
-
postbuild do
|
|
191
|
-
publish_tap 'TestResultsInTapFormat.tap' do
|
|
192
|
-
verbose true
|
|
193
|
-
require_plan true
|
|
194
|
-
end
|
|
195
|
-
end
|
|
196
|
-
end
|
|
197
|
-
|
|
198
|
-
**publish_xunit_report**
|
|
199
|
-
|
|
200
|
-
Description: Publish XUnit test results
|
|
201
|
-
|
|
202
|
-
Multiple: Override
|
|
203
|
-
|
|
204
|
-
Example
|
|
205
|
-
|
|
206
|
-
builder.freestyle 'hello_world-build' do
|
|
207
|
-
postbuild do
|
|
208
|
-
publish_xunit_report 'foo\\bar\\*.xml' do
|
|
209
|
-
failed_threshold :total_failed_tests => 0, :new_failed_tests => 0
|
|
210
|
-
unstable_threshold :total_skipped_tests => 0, :new_skipped_tests => 0
|
|
211
|
-
end
|
|
212
|
-
end
|
|
213
|
-
end
|
|
214
|
-
|
|
215
|
-
**send_email**
|
|
216
|
-
|
|
217
|
-
Description: Send notification via email
|
|
218
|
-
|
|
219
|
-
Multiple: Override
|
|
220
|
-
|
|
221
|
-
Example
|
|
222
|
-
|
|
223
|
-
builder.freestyle 'hello_world-build' do
|
|
224
|
-
postbuild do
|
|
225
|
-
send_email 'test@example.com' do
|
|
226
|
-
notify_every_unstable_build false
|
|
227
|
-
send_to_individuals true
|
|
228
|
-
end
|
|
229
|
-
end
|
|
230
|
-
end
|
|
231
|
-
|
|
232
|
-
**shell**
|
|
233
|
-
|
|
234
|
-
Description: Run shell command in as a post build action
|
|
235
|
-
|
|
236
|
-
Multiple: Override
|
|
237
|
-
|
|
238
|
-
Example
|
|
239
|
-
|
|
240
|
-
builder.freestyle 'hello_world-build' do
|
|
241
|
-
postbuild do
|
|
242
|
-
shell 'cd Reports && mv $(ls *.xml) merge.xml'
|
|
243
|
-
end
|
|
244
|
-
end
|
|
245
|
-
|
|
246
|
-
**trigger**
|
|
247
|
-
|
|
248
|
-
Description: Trigger other job when this build succeeds
|
|
249
|
-
|
|
250
|
-
Multiple: Override
|
|
251
|
-
|
|
252
|
-
Example
|
|
253
|
-
|
|
254
|
-
builder.freestyle 'hello_world-build' do
|
|
255
|
-
postbuild do
|
|
256
|
-
trigger 'foo-build', 'bar-build' do
|
|
257
|
-
fail_on_missing true
|
|
258
|
-
current_parameters true
|
|
259
|
-
file 'env.properties'
|
|
260
|
-
predefined_parameters 'BUILD_NUM' => '${BUILD_NUMBER}',
|
|
261
|
-
'PACKAGE_VERSION' => '${PACKAGE_VERSION}'
|
|
262
|
-
end
|
|
263
|
-
end
|
|
264
|
-
end
|
|
265
|
-
|
|
266
|
-
|
|
1
|
+
## Configure post build activities
|
|
2
|
+
|
|
3
|
+
**allow_broken_build_claiming**
|
|
4
|
+
|
|
5
|
+
Description: Allow developer to claim for broken build
|
|
6
|
+
|
|
7
|
+
Multiple: Override
|
|
8
|
+
|
|
9
|
+
Example
|
|
10
|
+
|
|
11
|
+
builder.freestyle 'hello_world-build' do
|
|
12
|
+
postbuild do
|
|
13
|
+
allow_broken_build_claiming
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
**archive**
|
|
18
|
+
|
|
19
|
+
Description: Archive artifacts
|
|
20
|
+
|
|
21
|
+
Multiple: Override
|
|
22
|
+
|
|
23
|
+
Example
|
|
24
|
+
|
|
25
|
+
builder.freestyle 'hello_world-master' do
|
|
26
|
+
postbuild do
|
|
27
|
+
archive do
|
|
28
|
+
file 'package/**',
|
|
29
|
+
'output/**',
|
|
30
|
+
'dependencies/lib/**'
|
|
31
|
+
latest_only true
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
**chucknorris**
|
|
37
|
+
|
|
38
|
+
Description: Show Chuck Norris Image
|
|
39
|
+
|
|
40
|
+
Multiple: Override
|
|
41
|
+
|
|
42
|
+
Example
|
|
43
|
+
|
|
44
|
+
builder.freestyle 'hello_world-build' do
|
|
45
|
+
postbuild do
|
|
46
|
+
chucknorris
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
**game**
|
|
51
|
+
|
|
52
|
+
Description: Enable CI Game
|
|
53
|
+
|
|
54
|
+
Multiple: Override
|
|
55
|
+
|
|
56
|
+
Example
|
|
57
|
+
|
|
58
|
+
builder.freestyle 'hello_world-build' do
|
|
59
|
+
postbuild do
|
|
60
|
+
game
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
**groovy**
|
|
65
|
+
|
|
66
|
+
Description: Run groovy script
|
|
67
|
+
|
|
68
|
+
Multiple: Override
|
|
69
|
+
|
|
70
|
+
Example
|
|
71
|
+
|
|
72
|
+
builder.freestyle 'hello_world-build' do
|
|
73
|
+
postbuild do
|
|
74
|
+
groovy <<EOS
|
|
75
|
+
def logger = manager.listener.logger
|
|
76
|
+
logger.println("--- Hello World")
|
|
77
|
+
EOS
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
**logparser**
|
|
82
|
+
|
|
83
|
+
Description: Parse console log to highlight errors
|
|
84
|
+
|
|
85
|
+
Multiple: Override
|
|
86
|
+
|
|
87
|
+
Example
|
|
88
|
+
|
|
89
|
+
builder.freestyle 'hello_world-build' do
|
|
90
|
+
postbuild do
|
|
91
|
+
logparser '/var/lib/jenkins/build_parsing_rules' do
|
|
92
|
+
fail_on_error
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
**pubish_pmd**
|
|
98
|
+
|
|
99
|
+
Description: Publish PMD analysis
|
|
100
|
+
|
|
101
|
+
Multiple: Override
|
|
102
|
+
|
|
103
|
+
Example
|
|
104
|
+
|
|
105
|
+
builder.freestyle 'hello_world' do
|
|
106
|
+
postbuild do
|
|
107
|
+
publish_pmd do
|
|
108
|
+
pmd_results 'build/phppmd.txt'
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
**publish_cloverphp**
|
|
114
|
+
|
|
115
|
+
Description: Publish clover php analysis
|
|
116
|
+
|
|
117
|
+
Multiple: Override
|
|
118
|
+
|
|
119
|
+
Example
|
|
120
|
+
|
|
121
|
+
builder.freestyle 'hello_world' do
|
|
122
|
+
postbuild do
|
|
123
|
+
publish_cloverphp do
|
|
124
|
+
xml_location 'build/coverage_clover.xml'
|
|
125
|
+
html_report_dir 'build/coverage'
|
|
126
|
+
healthy_target :method => 70, :statement => 80
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
**publish_html**
|
|
132
|
+
|
|
133
|
+
Description: Publish html report
|
|
134
|
+
|
|
135
|
+
Multiple: Override
|
|
136
|
+
|
|
137
|
+
Example
|
|
138
|
+
|
|
139
|
+
builder.freestyle 'hello_world-servicetest' do
|
|
140
|
+
postbuild do
|
|
141
|
+
publish_html 'Test Report' do
|
|
142
|
+
dir '$BUILD_NUMBER\\Reports'
|
|
143
|
+
file 'test-report.html'
|
|
144
|
+
keep_all false
|
|
145
|
+
allow_missing true
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
**publish_javadoc**
|
|
151
|
+
|
|
152
|
+
Description: Publish javadoc
|
|
153
|
+
|
|
154
|
+
Multiple: Override
|
|
155
|
+
|
|
156
|
+
Example
|
|
157
|
+
|
|
158
|
+
builder.freestyle 'hello_world-build' do
|
|
159
|
+
postbuild do
|
|
160
|
+
publish_javadoc do
|
|
161
|
+
doc_dir 'build/doc'
|
|
162
|
+
keep_all
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
**publish_nunit_report**
|
|
168
|
+
|
|
169
|
+
Description: Publish NUnit test results.
|
|
170
|
+
|
|
171
|
+
Multiple: Override
|
|
172
|
+
|
|
173
|
+
Example
|
|
174
|
+
|
|
175
|
+
builder.freestyle 'hello_world-build' do
|
|
176
|
+
postbuild do
|
|
177
|
+
publish_nunit_report 'foo\\bar\\*.xml'
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
**publish_tap**
|
|
182
|
+
|
|
183
|
+
Description: Publish TAP test result
|
|
184
|
+
|
|
185
|
+
Multiple: Override
|
|
186
|
+
|
|
187
|
+
Example
|
|
188
|
+
|
|
189
|
+
builder.freestyle 'hello_world-build' do
|
|
190
|
+
postbuild do
|
|
191
|
+
publish_tap 'TestResultsInTapFormat.tap' do
|
|
192
|
+
verbose true
|
|
193
|
+
require_plan true
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
**publish_xunit_report**
|
|
199
|
+
|
|
200
|
+
Description: Publish XUnit test results
|
|
201
|
+
|
|
202
|
+
Multiple: Override
|
|
203
|
+
|
|
204
|
+
Example
|
|
205
|
+
|
|
206
|
+
builder.freestyle 'hello_world-build' do
|
|
207
|
+
postbuild do
|
|
208
|
+
publish_xunit_report 'foo\\bar\\*.xml' do
|
|
209
|
+
failed_threshold :total_failed_tests => 0, :new_failed_tests => 0
|
|
210
|
+
unstable_threshold :total_skipped_tests => 0, :new_skipped_tests => 0
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
**send_email**
|
|
216
|
+
|
|
217
|
+
Description: Send notification via email
|
|
218
|
+
|
|
219
|
+
Multiple: Override
|
|
220
|
+
|
|
221
|
+
Example
|
|
222
|
+
|
|
223
|
+
builder.freestyle 'hello_world-build' do
|
|
224
|
+
postbuild do
|
|
225
|
+
send_email 'test@example.com' do
|
|
226
|
+
notify_every_unstable_build false
|
|
227
|
+
send_to_individuals true
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
**shell**
|
|
233
|
+
|
|
234
|
+
Description: Run shell command in as a post build action
|
|
235
|
+
|
|
236
|
+
Multiple: Override
|
|
237
|
+
|
|
238
|
+
Example
|
|
239
|
+
|
|
240
|
+
builder.freestyle 'hello_world-build' do
|
|
241
|
+
postbuild do
|
|
242
|
+
shell 'cd Reports && mv $(ls *.xml) merge.xml'
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
**trigger**
|
|
247
|
+
|
|
248
|
+
Description: Trigger other job when this build succeeds
|
|
249
|
+
|
|
250
|
+
Multiple: Override
|
|
251
|
+
|
|
252
|
+
Example
|
|
253
|
+
|
|
254
|
+
builder.freestyle 'hello_world-build' do
|
|
255
|
+
postbuild do
|
|
256
|
+
trigger 'foo-build', 'bar-build' do
|
|
257
|
+
fail_on_missing true
|
|
258
|
+
current_parameters true
|
|
259
|
+
file 'env.properties'
|
|
260
|
+
predefined_parameters 'BUILD_NUM' => '${BUILD_NUMBER}',
|
|
261
|
+
'PACKAGE_VERSION' => '${PACKAGE_VERSION}'
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
|