-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathci_job.xml.template
393 lines (389 loc) · 15.5 KB
/
ci_job.xml.template
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties>
<com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github@@1.19.2">
<projectUrl>@(ci_scripts_repository)/</projectUrl>
<displayName />
</com.coravy.hudson.plugins.github.GithubProjectProperty>
<com.sonyericsson.rebuild.RebuildSettings plugin="rebuild@@1.25">
<autoRebuild>false</autoRebuild>
<rebuildDisabled>false</rebuildDisabled>
</com.sonyericsson.rebuild.RebuildSettings>
<org.jenkinsci.plugins.requeuejob.RequeueJobProperty plugin="jobrequeue@@1.0">
<requeueJob>true</requeueJob>
</org.jenkinsci.plugins.requeuejob.RequeueJobProperty>
@(SNIPPET(
'property_parameter-definition',
ci_scripts_default_branch=ci_scripts_default_branch,
use_connext_default=use_connext_default,
disable_connext_static_default=disable_connext_static_default,
disable_connext_dynamic_default=disable_connext_dynamic_default,
use_osrf_connext_debs_default=use_osrf_connext_debs_default,
use_fastrtps_default=use_fastrtps_default,
use_opensplice_default=use_opensplice_default,
cmake_build_type=cmake_build_type,
ament_build_args_default=ament_build_args_default,
ament_test_args_default=ament_test_args_default,
enable_c_coverage_default=enable_c_coverage_default,
))@
</properties>
<scm class="hudson.plugins.git.GitSCM" plugin="git@@2.5.2">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>@(ci_scripts_repository)</url>
<credentialsId>1c2004f6-2e00-425d-a421-2e1ba62ca7a7</credentialsId>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>refs/heads/${CI_SCRIPTS_BRANCH}</name>
</hudson.plugins.git.BranchSpec>
</branches>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<browser class="hudson.plugins.git.browser.GithubWeb">
<url></url>
</browser>
<submoduleCfg class="list"/>
<extensions>@
@[if os_name != 'windows']
<hudson.plugins.git.extensions.impl.SubmoduleOption>
<disableSubmodules>false</disableSubmodules>
<recursiveSubmodules>true</recursiveSubmodules>
<trackingSubmodules>false</trackingSubmodules>
<reference/>
</hudson.plugins.git.extensions.impl.SubmoduleOption>
@
@[end if]</extensions>
</scm>
<assignedNode>@(label_expression)</assignedNode>
<canRoam>false</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers>@
@[if time_trigger_spec]
<hudson.triggers.TimerTrigger>
<spec>@(time_trigger_spec)</spec>
</hudson.triggers.TimerTrigger>
@
@[end if]</triggers>
<concurrentBuild>true</concurrentBuild>
<builders>
<hudson.plugins.groovy.SystemGroovy plugin="groovy@@1.29">
<scriptSource class="hudson.plugins.groovy.StringScriptSource">
<command><![CDATA[build.setDescription("""\
branch: ${build.buildVariableResolver.resolve('CI_BRANCH_TO_TEST')}, <br/>
use_connext: ${build.buildVariableResolver.resolve('CI_USE_CONNEXT')}, <br/>
disable_connext_static: ${build.buildVariableResolver.resolve('CI_DISABLE_CONNEXT_STATIC')}, <br/>
disable_connext_dynamic: ${build.buildVariableResolver.resolve('CI_DISABLE_CONNEXT_DYNAMIC')}, <br/>
use_osrf_connext_debs: ${build.buildVariableResolver.resolve('CI_USE_OSRF_CONNEXT_DEBS')}, <br/>`
use_fastrtps: ${build.buildVariableResolver.resolve('CI_USE_FASTRTPS')}, <br/>
use_opensplice: ${build.buildVariableResolver.resolve('CI_USE_OPENSPLICE')}, <br/>
ci_branch: ${build.buildVariableResolver.resolve('CI_SCRIPTS_BRANCH')}, <br/>
repos_url: ${build.buildVariableResolver.resolve('CI_ROS2_REPOS_URL')}, <br/>
use_whitespace: ${build.buildVariableResolver.resolve('CI_USE_WHITESPACE_IN_PATHS')}, <br/>
isolated: ${build.buildVariableResolver.resolve('CI_ISOLATED')}, <br/>
cmake_build_type: ${build.buildVariableResolver.resolve('CI_CMAKE_BUILD_TYPE')}, <br/>
ament_build_args: ${build.buildVariableResolver.resolve('CI_AMENT_BUILD_ARGS')}, <br/>
ament_test_args: ${build.buildVariableResolver.resolve('CI_AMENT_TEST_ARGS')}, <br/>
coverage: ${build.buildVariableResolver.resolve('CI_ENABLE_C_COVERAGE')}\
""");]]>
</command>
</scriptSource>
<bindings/>
<classpath/>
</hudson.plugins.groovy.SystemGroovy>
<hudson.tasks.@(shell_type)>
<command>@
@[if os_name in ['linux', 'osx', 'linux-armhf', 'linux-aarch64']]@
rm -rf ws workspace "work space"
echo "# BEGIN SECTION: Determine arguments"
export CI_ARGS="--do-venv --force-ansi-color --workspace-path $WORKSPACE"
if [ -n "${CI_BRANCH_TO_TEST+x}" ]; then
export CI_ARGS="$CI_ARGS --test-branch $CI_BRANCH_TO_TEST"
fi
if [ "$CI_USE_WHITESPACE_IN_PATHS" = "true" ]; then
export CI_ARGS="$CI_ARGS --white-space-in sourcespace buildspace installspace workspace"
fi
if [ "$CI_USE_CONNEXT" = "true" ]; then
export CI_ARGS="$CI_ARGS --connext"
fi
if [ "$CI_DISABLE_CONNEXT_STATIC" = "true" ]; then
export CI_ARGS="$CI_ARGS --disable-connext-static"
fi
if [ "$CI_DISABLE_CONNEXT_DYNAMIC" = "true" ]; then
export CI_ARGS="$CI_ARGS --disable-connext-dynamic"
fi
if [ "$CI_USE_OSRF_CONNEXT_DEBS" = "true" ]; then
export CI_ARGS="$CI_ARGS --osrf-connext-debs"
fi
if [ "$CI_USE_FASTRTPS" = "true" ]; then
export CI_ARGS="$CI_ARGS --fastrtps"
fi
if [ "$CI_USE_OPENSPLICE" = "true" ]; then
export CI_ARGS="$CI_ARGS --opensplice"
fi
if [ -n "${CI_ROS2_REPOS_URL+x}" ]; then
export CI_ARGS="$CI_ARGS --repo-file-url $CI_ROS2_REPOS_URL"
fi
if [ "$CI_ISOLATED" = "true" ]; then
export CI_ARGS="$CI_ARGS --isolated"
fi
if [ "${CI_CMAKE_BUILD_TYPE}" != "None" ]; then
export CI_ARGS="$CI_ARGS --cmake-build-type $CI_CMAKE_BUILD_TYPE"
fi
if [ "$CI_ENABLE_C_COVERAGE" = "true" ]; then
export CI_ARGS="$CI_ARGS --coverage"
fi
if [ -n "${CI_AMENT_BUILD_ARGS+x}" ]; then
export CI_ARGS="$CI_ARGS --ament-build-args $CI_AMENT_BUILD_ARGS --"
fi
if [ -n "${CI_AMENT_TEST_ARGS+x}" ]; then
export CI_ARGS="$CI_ARGS --ament-test-args $CI_AMENT_TEST_ARGS --"
fi
echo "Using args: $CI_ARGS"
echo "# END SECTION"
@[if os_name in ['linux', 'linux-armhf', 'linux-aarch64']]@
mkdir -p $HOME/.ccache
echo "# BEGIN SECTION: docker version"
docker version
echo "# END SECTION"
echo "# BEGIN SECTION: docker info"
docker info
echo "# END SECTION"
echo "# BEGIN SECTION: Build Dockerfile"
@[if os_name == 'linux-armhf']@
sed -i 's+^FROM.*$+FROM osrf/ubuntu_armhf:xenial+' linux_docker_resources/Dockerfile
docker build --build-arg PLATFORM=arm -t ros2_batch_ci_armhf linux_docker_resources
@[elif os_name == 'linux-aarch64']@
sed -i 's+^FROM.*$+FROM osrf/ubuntu_arm64:xenial+' linux_docker_resources/Dockerfile
docker build --build-arg PLATFORM=arm -t ros2_batch_ci_aarch64 linux_docker_resources
@[elif os_name == 'linux']@
docker build -t ros2_batch_ci linux_docker_resources
@[else]@
@{ assert 'Unknown os_name: ' + os_name }@
@[end if]@
echo "# END SECTION"
echo "# BEGIN SECTION: Run Dockerfile"
export EXTRA_MOUNT=""
@[if os_name in ['linux-armhf', 'linux-aarch64']]@
tmpd=`mktemp -d`
mkdir $tmpd/src
curl -sk https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos -o $tmpd/ros2.repos
vcs import $tmpd/src --input $tmpd/ros2.repos
export CI_ARGS="$CI_ARGS --src-mounted --workspace-path $tmpd"
export EXTRA_MOUNT="-v $tmpd/src:/home/rosbuild/ci_scripts/ws/src"
@[end if]@
@[if os_name == 'linux']@
export CONTAINER_NAME=ros2_batch_ci
@[elif os_name == 'linux-armhf']@
export CONTAINER_NAME=ros2_batch_ci_armhf
@[elif os_name == 'linux-aarch64']@
export CONTAINER_NAME=ros2_batch_ci_aarch64
@[else]@
@{ assert 'Unknown os_name: ' + os_name }@
@[end if]@
docker run --privileged -e UID=`id -u` -e GID=`id -g` -e CI_ARGS="$CI_ARGS" -e CCACHE_DIR=/home/rosbuild/.ccache -i -v `pwd`:/home/rosbuild/ci_scripts -v $HOME/.ccache:/home/rosbuild/.ccache $EXTRA_MOUNT $CONTAINER_NAME
@[if os_name in ['linux-armhf', 'linux-aarch64']]@
rm -rf $tmpd
@[end if]@
echo "# END SECTION"
@[else]@
echo "# BEGIN SECTION: Run script"
/usr/local/bin/python3 -u run_ros2_batch.py $CI_ARGS
echo "# END SECTION"
@[end if]@
@[elif os_name == 'windows']@
rmdir /S /Q ws workspace "work space"
echo "# BEGIN SECTION: Determine arguments"
set "PATH=%PATH:"=%"
set "CI_ARGS=--force-ansi-color --workspace-path %WORKSPACE%"
if "%CI_BRANCH_TO_TEST%" NEQ "" (
set "CI_ARGS=%CI_ARGS% --test-branch %CI_BRANCH_TO_TEST%"
)
if "%CI_USE_WHITESPACE_IN_PATHS%" == "true" (
set "CI_ARGS=%CI_ARGS% --white-space-in sourcespace buildspace installspace workspace"
)
if "%CI_USE_CONNEXT%" == "true" (
set "CI_ARGS=%CI_ARGS% --connext"
)
if "%CI_DISABLE_CONNEXT_STATIC%" == "true" (
set "CI_ARGS=%CI_ARGS% --disable-connext-static"
)
if "%CI_DISABLE_CONNEXT_DYNAMIC%" == "true" (
set "CI_ARGS=%CI_ARGS% --disable-connext-dynamic"
)
if "%CI_USE_OSRF_CONNEXT_DEBS%" == "true" (
set "CI_ARGS=%CI_ARGS% --osrf-connext-debs"
)
if "%CI_USE_FASTRTPS%" == "true" (
set "CI_ARGS=%CI_ARGS% --fastrtps"
)
if "%CI_USE_OPENSPLICE%" == "true" (
set "CI_ARGS=%CI_ARGS% --opensplice"
)
if "%CI_ROS2_REPOS_URL%" NEQ "" (
set "CI_ARGS=%CI_ARGS% --repo-file-url %CI_ROS2_REPOS_URL%"
)
if "%CI_ISOLATED%" == "true" (
set "CI_ARGS=%CI_ARGS% --isolated"
)
if "%CI_CMAKE_BUILD_TYPE%" NEQ "None" (
set "CI_ARGS=%CI_ARGS% --cmake-build-type %CI_CMAKE_BUILD_TYPE%"
)
if "%CI_ENABLE_C_COVERAGE%" == "true" (
set "CI_ARGS=%CI_ARGS% --coverage"
)
if "%CI_AMENT_BUILD_ARGS%" NEQ "" (
set "CI_ARGS=%CI_ARGS% --ament-build-args %CI_AMENT_BUILD_ARGS% --"
)
if "%CI_AMENT_TEST_ARGS%" NEQ "" (
set "CI_ARGS=%CI_ARGS% --ament-test-args %CI_AMENT_TEST_ARGS% --"
)
echo Using args: %CI_ARGS%
echo "# END SECTION"
echo "# BEGIN SECTION: Run script"
python -u run_ros2_batch.py %CI_ARGS%
echo "# END SECTION"
@[else]@
@{ assert 'Unknown os_name: ' + os_name }@
@[end if]</command>
</hudson.tasks.@(shell_type)>
</builders>
<publishers>
@(SNIPPET(
'publisher_warnings',
os_name=os_name,
))@
<hudson.plugins.cobertura.CoberturaPublisher plugin="cobertura@@1.9.8">
<coberturaReportFile>ws/build*/**/*coverage.xml</coberturaReportFile>
<onlyStable>false</onlyStable>
<failUnhealthy>false</failUnhealthy>
<failUnstable>false</failUnstable>
<autoUpdateHealth>false</autoUpdateHealth>
<autoUpdateStability>false</autoUpdateStability>
<zoomCoverageChart>false</zoomCoverageChart>
<maxNumberOfBuilds>0</maxNumberOfBuilds>
<failNoReports>false</failNoReports>
<healthyTarget>
<targets class="enum-map" enum-type="hudson.plugins.cobertura.targets.CoverageMetric">
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>METHOD</hudson.plugins.cobertura.targets.CoverageMetric>
<int>8000000</int>
</entry>
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>LINE</hudson.plugins.cobertura.targets.CoverageMetric>
<int>8000000</int>
</entry>
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>CONDITIONAL</hudson.plugins.cobertura.targets.CoverageMetric>
<int>7000000</int>
</entry>
</targets>
</healthyTarget>
<unhealthyTarget>
<targets class="enum-map" enum-type="hudson.plugins.cobertura.targets.CoverageMetric">
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>METHOD</hudson.plugins.cobertura.targets.CoverageMetric>
<int>0</int>
</entry>
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>LINE</hudson.plugins.cobertura.targets.CoverageMetric>
<int>0</int>
</entry>
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>CONDITIONAL</hudson.plugins.cobertura.targets.CoverageMetric>
<int>0</int>
</entry>
</targets>
</unhealthyTarget>
<failingTarget>
<targets class="enum-map" enum-type="hudson.plugins.cobertura.targets.CoverageMetric">
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>METHOD</hudson.plugins.cobertura.targets.CoverageMetric>
<int>0</int>
</entry>
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>LINE</hudson.plugins.cobertura.targets.CoverageMetric>
<int>0</int>
</entry>
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>CONDITIONAL</hudson.plugins.cobertura.targets.CoverageMetric>
<int>0</int>
</entry>
</targets>
</failingTarget>
<sourceEncoding>ASCII</sourceEncoding>
</hudson.plugins.cobertura.CoberturaPublisher>
<xunit plugin="xunit@@1.102">
<types>
@[for prefix in ['ws/build', 'work space/build space']]@
<CTestType>
<pattern>@(prefix)/*/Testing/*/Test.xml</pattern>
<skipNoTestFiles>true</skipNoTestFiles>
<failIfNotNew>true</failIfNotNew>
<deleteOutputFiles>true</deleteOutputFiles>
<stopProcessingIfError>true</stopProcessingIfError>
</CTestType>
<GoogleTestType>
<pattern>@(prefix)/*/test_results/**/*.gtest.xml</pattern>
<skipNoTestFiles>true</skipNoTestFiles>
<failIfNotNew>true</failIfNotNew>
<deleteOutputFiles>true</deleteOutputFiles>
<stopProcessingIfError>true</stopProcessingIfError>
</GoogleTestType>
<JUnitType>
<pattern>@(prefix)/*/test_results/**/*.xunit.xml</pattern>
<skipNoTestFiles>true</skipNoTestFiles>
<failIfNotNew>true</failIfNotNew>
<deleteOutputFiles>true</deleteOutputFiles>
<stopProcessingIfError>true</stopProcessingIfError>
</JUnitType>
@[end for]@
</types>
<thresholds>
<org.jenkinsci.plugins.xunit.threshold.FailedThreshold>
<unstableThreshold>0</unstableThreshold>
<unstableNewThreshold></unstableNewThreshold>
<failureThreshold></failureThreshold>
<failureNewThreshold></failureNewThreshold>
</org.jenkinsci.plugins.xunit.threshold.FailedThreshold>
<org.jenkinsci.plugins.xunit.threshold.SkippedThreshold>
<unstableThreshold></unstableThreshold>
<unstableNewThreshold></unstableNewThreshold>
<failureThreshold></failureThreshold>
<failureNewThreshold></failureNewThreshold>
</org.jenkinsci.plugins.xunit.threshold.SkippedThreshold>
</thresholds>
<thresholdMode>1</thresholdMode>
<extraConfiguration>
<testTimeMargin>3000</testTimeMargin>
</extraConfiguration>
</xunit>
@[if mailer_recipients]@
<hudson.tasks.Mailer plugin="mailer@@1.17">
<recipients>@(mailer_recipients)</recipients>
<dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
<sendToIndividuals>false</sendToIndividuals>
</hudson.tasks.Mailer>
@[end if]@
</publishers>
<buildWrappers>
<hudson.plugins.timestamper.TimestamperBuildWrapper plugin="timestamper@@1.8.4" />
<hudson.plugins.ansicolor.AnsiColorBuildWrapper plugin="ansicolor@@0.4.2">
<colorMapName>xterm</colorMapName>
</hudson.plugins.ansicolor.AnsiColorBuildWrapper>
@[if os_name != 'windows']@
<com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper plugin="ssh-agent@@1.13">
<credentialIds>
<string>1c2004f6-2e00-425d-a421-2e1ba62ca7a7</string>
</credentialIds>
<ignoreMissing>false</ignoreMissing>
</com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
@[end if]@
</buildWrappers>
</project>