Update expected xml to JJB 2.0 format
[releng/global-jjb.git] / .jjb-test / expected-xml / gerrit-maven-maven-verify-deps-master-mvn33-openjdk8
1 <?xml version="1.0" encoding="utf-8"?>
2 <project>
3   <jdk>openjdk8</jdk>
4   <actions/>
5   <description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
6   <keepDependencies>false</keepDependencies>
7   <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
8   <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
9   <concurrentBuild>true</concurrentBuild>
10   <assignedNode>build-vm</assignedNode>
11   <canRoam>false</canRoam>
12   <properties>
13     <jenkins.model.BuildDiscarderProperty>
14       <strategy class="hudson.tasks.LogRotator">
15         <daysToKeep>7</daysToKeep>
16         <numToKeep>-1</numToKeep>
17         <artifactDaysToKeep>-1</artifactDaysToKeep>
18         <artifactNumToKeep>0</artifactNumToKeep>
19       </strategy>
20     </jenkins.model.BuildDiscarderProperty>
21     <hudson.model.ParametersDefinitionProperty>
22       <parameterDefinitions>
23         <hudson.model.StringParameterDefinition>
24           <name>PROJECT</name>
25           <description>Parameter to identify a Gerrit project. This is typically the
26 project repo path as exists in Gerrit.
27 For example: ofextensions/circuitsw
28 </description>
29           <defaultValue>releng/ciman</defaultValue>
30         </hudson.model.StringParameterDefinition>
31         <hudson.model.StringParameterDefinition>
32           <name>STREAM</name>
33           <description>Stream is often set to the same name as 'branch' but can
34 sometimes be used as a name representing a project's release code
35 name.
36 </description>
37           <defaultValue>master</defaultValue>
38         </hudson.model.StringParameterDefinition>
39         <hudson.model.StringParameterDefinition>
40           <name>GERRIT_PROJECT</name>
41           <description>Parameter to identify Gerrit project. This is typically the
42 project repo path as exists in Gerrit.
43 For example: ofextensions/circuitsw
44
45 Note that Gerrit will override this parameter automatically if a
46 job is triggered by Gerrit.
47 </description>
48           <defaultValue>releng/ciman</defaultValue>
49         </hudson.model.StringParameterDefinition>
50         <hudson.model.StringParameterDefinition>
51           <name>GERRIT_BRANCH</name>
52           <description>Parameter to identify a Gerrit branch.
53
54 Note that Gerrit will override this parameter automatically if a
55 job is triggered by Gerrit.
56 </description>
57           <defaultValue>master</defaultValue>
58         </hudson.model.StringParameterDefinition>
59         <hudson.model.StringParameterDefinition>
60           <name>GERRIT_REFSPEC</name>
61           <description>Parameter to identify a refspec when pulling from Gerrit.
62
63 Note that Gerrit will override this parameter automatically if a
64 job is triggered by Gerrit.
65 </description>
66           <defaultValue>refs/heads/master</defaultValue>
67         </hudson.model.StringParameterDefinition>
68         <hudson.model.StringParameterDefinition>
69           <name>LFTOOLS_VERSION</name>
70           <description>Version of lftools to install. Can be a specific version like
71 '0.6.0' or a PEP-440 definition.
72 https://www.python.org/dev/peps/pep-0440/
73 For example '&lt;1.0.0' or '&gt;=1.0.0,&lt;2.0.0'.
74 </description>
75           <defaultValue>&lt;1.0.0</defaultValue>
76         </hudson.model.StringParameterDefinition>
77         <hudson.model.StringParameterDefinition>
78           <name>M2_HOME</name>
79           <description>Maven selector to be used by shell scripts</description>
80           <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
81         </hudson.model.StringParameterDefinition>
82         <hudson.model.StringParameterDefinition>
83           <name>MAVEN_OPTS</name>
84           <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
85 </description>
86           <defaultValue/>
87         </hudson.model.StringParameterDefinition>
88         <hudson.model.StringParameterDefinition>
89           <name>MAVEN_PARAMS</name>
90           <description>Maven parameters to pass to the mvn command.
91 </description>
92           <defaultValue>-Dstream=$STREAM</defaultValue>
93         </hudson.model.StringParameterDefinition>
94         <hudson.model.StringParameterDefinition>
95           <name>MVN</name>
96           <description>Maven selector to be used by shell scripts</description>
97           <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
98         </hudson.model.StringParameterDefinition>
99         <hudson.model.StringParameterDefinition>
100           <name>STAGING_PROFILE_ID</name>
101           <description>Nexus staging profile ID.
102 </description>
103           <defaultValue>uuddlrlrba</defaultValue>
104         </hudson.model.StringParameterDefinition>
105         <hudson.model.StringParameterDefinition>
106           <name>ARCHIVE_ARTIFACTS</name>
107           <description>Artifacts to archive to the logs server.</description>
108           <defaultValue/>
109         </hudson.model.StringParameterDefinition>
110       </parameterDefinitions>
111     </hudson.model.ParametersDefinitionProperty>
112   </properties>
113   <scm class="hudson.plugins.git.GitSCM">
114     <configVersion>2</configVersion>
115     <userRemoteConfigs>
116       <hudson.plugins.git.UserRemoteConfig>
117         <name>origin</name>
118         <refspec>$GERRIT_REFSPEC</refspec>
119         <url>$GIT_URL/$PROJECT</url>
120         <credentialsId>test-credential</credentialsId>
121       </hudson.plugins.git.UserRemoteConfig>
122     </userRemoteConfigs>
123     <branches>
124       <hudson.plugins.git.BranchSpec>
125         <name>refs/heads/$GERRIT_BRANCH</name>
126       </hudson.plugins.git.BranchSpec>
127     </branches>
128     <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
129     <remotePoll>false</remotePoll>
130     <gitTool>Default</gitTool>
131     <submoduleCfg class="list"/>
132     <reference/>
133     <gitConfigName/>
134     <gitConfigEmail/>
135     <extensions>
136       <hudson.plugins.git.extensions.impl.BuildChooserSetting>
137         <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
138       </hudson.plugins.git.extensions.impl.BuildChooserSetting>
139       <hudson.plugins.git.extensions.impl.SubmoduleOption>
140         <disableSubmodules>false</disableSubmodules>
141         <recursiveSubmodules>true</recursiveSubmodules>
142         <trackingSubmodules>false</trackingSubmodules>
143         <parentCredentials>false</parentCredentials>
144         <reference/>
145         <timeout>10</timeout>
146       </hudson.plugins.git.extensions.impl.SubmoduleOption>
147       <hudson.plugins.git.extensions.impl.WipeWorkspace/>
148     </extensions>
149   </scm>
150   <triggers class="vector">
151     <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
152       <spec/>
153       <gerritProjects>
154         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
155           <compareType>ANT</compareType>
156           <pattern>releng/ciman</pattern>
157           <branches>
158             <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
159               <compareType>ANT</compareType>
160               <pattern>**/master</pattern>
161             </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
162           </branches>
163           <filePaths>
164             <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
165               <compareType>ANT</compareType>
166               <pattern>**</pattern>
167             </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
168           </filePaths>
169           <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
170         </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
171       </gerritProjects>
172       <skipVote>
173         <onSuccessful>false</onSuccessful>
174         <onFailed>false</onFailed>
175         <onUnstable>false</onUnstable>
176         <onNotBuilt>false</onNotBuilt>
177       </skipVote>
178       <silentMode>false</silentMode>
179       <silentStartMode>false</silentStartMode>
180       <escapeQuotes>true</escapeQuotes>
181       <noNameAndEmailParameters>false</noNameAndEmailParameters>
182       <readableMessage>false</readableMessage>
183       <dependencyJobsNames/>
184       <notificationLevel/>
185       <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
186       <triggerConfigURL/>
187       <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
188       <triggerOnEvents>
189         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
190           <commentAddedCommentContains>recheck: [0-9 ]+</commentAddedCommentContains>
191         </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
192       </triggerOnEvents>
193       <buildStartMessage/>
194       <buildFailureMessage/>
195       <buildSuccessfulMessage/>
196       <buildUnstableMessage/>
197       <buildNotBuiltMessage/>
198       <buildUnsuccessfulFilepath/>
199       <customUrl/>
200       <serverName>test-server</serverName>
201     </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
202   </triggers>
203   <builders>
204     <hudson.tasks.Shell>
205       <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
206     </hudson.tasks.Shell>
207     <hudson.tasks.Shell>
208       <command>echo &quot;quiet=on&quot; &gt; &quot;$HOME/.wgetrc&quot;</command>
209     </hudson.tasks.Shell>
210     <hudson.tasks.Maven>
211       <targets>--version</targets>
212       <properties/>
213       <mavenName>mvn33</mavenName>
214       <usePrivateRepository>false</usePrivateRepository>
215       <settings class="jenkins.mvn.DefaultSettingsProvider"/>
216       <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
217     </hudson.tasks.Maven>
218     <hudson.tasks.Shell>
219       <command>rm &quot;$HOME/.wgetrc&quot;</command>
220     </hudson.tasks.Shell>
221     <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
222       <managedFiles>
223         <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
224           <fileId>global-settings</fileId>
225           <targetLocation/>
226           <variable>GLOBAL_SETTINGS_FILE</variable>
227         </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
228         <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
229           <fileId>gerrit-maven-project-settings</fileId>
230           <targetLocation/>
231           <variable>SETTINGS_FILE</variable>
232         </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
233       </managedFiles>
234     </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
235     <hudson.tasks.Shell>
236       <command>#!/bin/bash
237 # SPDX-License-Identifier: EPL-1.0
238 ##############################################################################
239 # Copyright (c) 2017 The Linux Foundation and others.
240 #
241 # All rights reserved. This program and the accompanying materials
242 # are made available under the terms of the Eclipse Public License v1.0
243 # which accompanies this distribution, and is available at
244 # http://www.eclipse.org/legal/epl-v10.html
245 ##############################################################################
246 # Fetches patches all projects provided by comment trigger
247 #
248 # Takes a list of Gerrit patches and fetches all projects and cherry-pick
249 # patches for projects. The trigger is
250 #     'recheck: SPACE_SEPERATED_LIST_OF_PATCHES'
251 #
252 # NOTE: This script assumes the user will provide the correct dependency order
253 #       via the PATCHES list.
254
255 # Ensure we fail the job if any steps fail.
256 set -eu -o pipefail
257
258 REPOS_DIR=&quot;$WORKSPACE/.repos&quot;
259
260 IFS=&quot; &quot; read -r -a PATCHES &lt;&lt;&lt; &quot;$(echo &quot;$GERRIT_EVENT_COMMENT_TEXT&quot; | grep 'recheck:' | awk -F: '{print $2}')&quot;
261
262 # Workaround for git-review bug in v1.24
263 # https://storyboard.openstack.org/#!/story/2001081
264 set +u  # Allow unbound variables for virtualenv
265 virtualenv --quiet &quot;/tmp/v/git-review&quot;
266 # shellcheck source=/tmp/v/git-review/bin/activate disable=SC1091
267 source &quot;/tmp/v/git-review/bin/activate&quot;
268 pip install --quiet --upgrade pip
269 pip install --quiet --upgrade git-review
270 set -u
271 # End git-review workaround
272
273 projects=()
274 for patch in $(echo &quot;${PATCHES[@]}&quot;); do
275     json=$(curl -s &quot;$GERRIT_URL/changes/$patch&quot; | sed -e &quot;s/)]}'//&quot;)
276     project=$(echo &quot;$json&quot; | jq -r '.project')
277     branch=$(echo &quot;$json&quot; | jq -r '.branch')
278
279     if [ ! -d &quot;$REPOS_DIR/$project&quot; ]; then
280         git clone -q --depth 1 -b &quot;$branch&quot; &quot;$GIT_URL/$project&quot; &quot;$REPOS_DIR/$project&quot;
281
282         # This array will be used later to determine project build order.
283         projects+=(&quot;$project&quot;)
284     fi
285
286     pushd &quot;$REPOS_DIR/$project&quot;
287     # If remote gerrit already exists just make sure path is expected
288     if ! git remote add gerrit &quot;$GERRIT_URL/$project&quot; &gt; /dev/null 2&gt;&amp;1; then
289         git remote set-url gerrit &quot;$GERRIT_URL/$project&quot;
290     fi
291     git review --cherrypick=&quot;$patch&quot;
292     popd
293 done
294
295 # This script should be a macro which re-inject's the projects variable back
296 # into the build so a script later on can use it.
297 echo &quot;DEPENDENCY_BUILD_ORDER=${projects[*]}&quot; &gt; &quot;$WORKSPACE/.dependency.properties&quot;
298 </command>
299     </hudson.tasks.Shell>
300     <EnvInjectBuilder>
301       <info>
302         <propertiesFilePath>$WORKSPACE/.dependency.properties</propertiesFilePath>
303       </info>
304     </EnvInjectBuilder>
305     <hudson.tasks.Shell>
306       <command>#!/bin/bash
307 # SPDX-License-Identifier: EPL-1.0
308 ##############################################################################
309 # Copyright (c) 2017 The Linux Foundation and others.
310 #
311 # All rights reserved. This program and the accompanying materials
312 # are made available under the terms of the Eclipse Public License v1.0
313 # which accompanies this distribution, and is available at
314 # http://www.eclipse.org/legal/epl-v10.html
315 ##############################################################################
316
317 # This file contains a list of variables that are generally useful in many
318 # scripts. It is meant to be sourced in other scripts so that the variables can
319 # be called.
320
321 MAVEN_OPTIONS=&quot;$(echo --show-version \
322     --batch-mode \
323     -Djenkins \
324     -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
325     -Dmaven.repo.local=/tmp/r \
326     -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)&quot;
327 echo &quot;$MAVEN_OPTIONS&quot;
328
329 #!/bin/bash
330 # SPDX-License-Identifier: EPL-1.0
331 ##############################################################################
332 # Copyright (c) 2017 The Linux Foundation and others.
333 #
334 # All rights reserved. This program and the accompanying materials
335 # are made available under the terms of the Eclipse Public License v1.0
336 # which accompanies this distribution, and is available at
337 # http://www.eclipse.org/legal/epl-v10.html
338 ##############################################################################
339
340 # Builds projects provided via $DEPENDENCY_BUILD_ORDER list
341 #
342 # This runs a `mvn clean install` against all projects provided by a list. This
343 # script is a companion script for the gerrit-fetch-dependencies script which
344 # clones project repos to &quot;$WORKSPACE/.repos&quot;.
345
346 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
347 # Ensure we fail the job if any steps fail.
348 set -e -o pipefail
349 set +u
350
351 IFS=&quot; &quot; read -r -a PROJECTS &lt;&lt;&lt; &quot;$DEPENDENCY_BUILD_ORDER&quot;
352 REPOS_DIR=&quot;$WORKSPACE/.repos&quot;
353
354 export MAVEN_OPTS
355
356 for project in &quot;${PROJECTS[@]}&quot;; do
357     pushd &quot;$REPOS_DIR/$project&quot;
358     # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
359     # shellcheck disable=SC2086
360     $MVN clean install \
361         -Pq \
362         -DskipTests=true \
363         --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
364         --settings &quot;$SETTINGS_FILE&quot; \
365         $MAVEN_OPTIONS $MAVEN_PARAMS
366     popd
367 done
368 </command>
369     </hudson.tasks.Shell>
370     <hudson.tasks.Shell>
371       <command>#!/bin/bash
372 # SPDX-License-Identifier: EPL-1.0
373 ##############################################################################
374 # Copyright (c) 2017 The Linux Foundation and others.
375 #
376 # All rights reserved. This program and the accompanying materials
377 # are made available under the terms of the Eclipse Public License v1.0
378 # which accompanies this distribution, and is available at
379 # http://www.eclipse.org/legal/epl-v10.html
380 ##############################################################################
381
382 # This file contains a list of variables that are generally useful in many
383 # scripts. It is meant to be sourced in other scripts so that the variables can
384 # be called.
385
386 MAVEN_OPTIONS=&quot;$(echo --show-version \
387     --batch-mode \
388     -Djenkins \
389     -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
390     -Dmaven.repo.local=/tmp/r \
391     -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)&quot;
392 echo &quot;$MAVEN_OPTIONS&quot;
393
394 #!/bin/bash
395 # SPDX-License-Identifier: EPL-1.0
396 ##############################################################################
397 # Copyright (c) 2017 The Linux Foundation and others.
398 #
399 # All rights reserved. This program and the accompanying materials
400 # are made available under the terms of the Eclipse Public License v1.0
401 # which accompanies this distribution, and is available at
402 # http://www.eclipse.org/legal/epl-v10.html
403 ##############################################################################
404
405 # This script builds a Maven project and deploys it into a staging repo which
406 # can be used to deploy elsewhere later eg. Nexus staging / snapshot repos.
407
408 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
409 # Ensure we fail the job if any steps fail.
410 set -e -o pipefail
411 set +u
412
413 export MAVEN_OPTS
414
415 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
416 # shellcheck disable=SC2086
417 $MVN clean deploy \
418     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
419     --settings &quot;$SETTINGS_FILE&quot; \
420     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
421     $MAVEN_OPTIONS $MAVEN_PARAMS
422 </command>
423     </hudson.tasks.Shell>
424     <hudson.tasks.Shell>
425       <command>#!/bin/bash
426 set +e  # DO NOT cause build failure if any of the rm calls fail.
427
428 rm &quot;$GLOBAL_SETTINGS_FILE&quot; &quot;$SETTINGS_FILE&quot;
429
430 # In some cases we use the lf-provide-maven-settings macro to produce
431 # a &quot;$HOME/.netrc&quot; file containing credentials. Remove that file here
432 # too if it exists.
433 rm &quot;$HOME/.netrc&quot;
434
435 # DO NOT fail build if any of the above lines fail.
436 exit 0
437 </command>
438     </hudson.tasks.Shell>
439   </builders>
440   <publishers>
441     <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs">
442       <isRankActivated>false</isRankActivated>
443       <includePattern/>
444       <excludePattern/>
445       <healthy/>
446       <unHealthy/>
447       <thresholdLimit>low</thresholdLimit>
448       <pluginName>[FINDBUGS] </pluginName>
449       <defaultEncoding/>
450       <canRunOnFailed>false</canRunOnFailed>
451       <useStableBuildAsReference>false</useStableBuildAsReference>
452       <usePreviousBuildAsReference>false</usePreviousBuildAsReference>
453       <useDeltaValues>false</useDeltaValues>
454       <thresholds>
455         <unstableTotalAll/>
456         <unstableTotalHigh/>
457         <unstableTotalNormal/>
458         <unstableTotalLow/>
459         <failedTotalAll/>
460         <failedTotalHigh/>
461         <failedTotalNormal/>
462         <failedTotalLow/>
463       </thresholds>
464       <shouldDetectModules>false</shouldDetectModules>
465       <dontComputeNew>true</dontComputeNew>
466       <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
467       <pattern/>
468     </hudson.plugins.findbugs.FindBugsPublisher>
469     <hudson.plugins.jacoco.JacocoPublisher plugin="jacoco">
470       <execPattern>**/**.exec</execPattern>
471       <classPattern>**/classes</classPattern>
472       <sourcePattern>**/src/main/java</sourcePattern>
473       <changeBuildStatus>false</changeBuildStatus>
474       <inclusionPattern/>
475       <exclusionPattern>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</exclusionPattern>
476       <maximumBranchCoverage>10</maximumBranchCoverage>
477       <minimumBranchCoverage>20</minimumBranchCoverage>
478       <maximumMethodCoverage>50</maximumMethodCoverage>
479       <minimumMethodCoverage>40</minimumMethodCoverage>
480     </hudson.plugins.jacoco.JacocoPublisher>
481     <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
482       <buildSteps>
483         <hudson.tasks.Shell>
484           <command>#!/bin/bash
485 # SPDX-License-Identifier: EPL-1.0
486 ##############################################################################
487 # Copyright (c) 2017 The Linux Foundation and others.
488 #
489 # All rights reserved. This program and the accompanying materials
490 # are made available under the terms of the Eclipse Public License v1.0
491 # which accompanies this distribution, and is available at
492 # http://www.eclipse.org/legal/epl-v10.html
493 ##############################################################################
494 echo &quot;---&gt; sysstat.sh&quot;
495 set +e  # DON'T fail build if script fails.
496
497 OS=$(facter operatingsystem)
498 case &quot;$OS&quot; in
499     Ubuntu)
500         SYSSTAT_PATH=&quot;/var/log/sysstat&quot;
501
502         # Dont run the script when systat is not enabled by default
503         if ! grep --quiet 'ENABLED=&quot;true&quot;' &quot;/etc/default/sysstat&quot;; then
504             exit 0
505         fi
506     ;;
507     CentOS|RedHat)
508         SYSSTAT_PATH=&quot;/var/log/sa&quot;
509     ;;
510     *)
511         # nothing to do
512         exit 0
513     ;;
514 esac
515
516 SAR_DIR=&quot;$WORKSPACE/archives/sar-reports&quot;
517 mkdir -p &quot;$SAR_DIR&quot;
518 cp &quot;$SYSSTAT_PATH/&quot;* &quot;$_&quot;
519 # convert sar data to ascii format
520 while IFS=&quot;&quot; read -r sarfilenum
521 do
522     [ -f &quot;$sarfilenum&quot; ] &amp;&amp; LC_TIME=POSIX sar -A -f &quot;$sarfilenum&quot; &gt; &quot;$SAR_DIR/sar${sarfilenum//[!0-9]/}&quot;
523 done &lt; &lt;(find &quot;$SYSSTAT_PATH&quot; -name &quot;sa[0-9]*&quot; || true)
524
525 # DON'T fail build if script fails.
526 exit 0
527 </command>
528         </hudson.tasks.Shell>
529         <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
530           <managedFiles>
531             <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
532               <fileId>jenkins-log-archives-settings</fileId>
533               <targetLocation/>
534               <variable>SETTINGS_FILE</variable>
535             </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
536           </managedFiles>
537         </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
538         <EnvInjectBuilder>
539           <info>
540             <propertiesContent>SERVER_ID=logs</propertiesContent>
541           </info>
542         </EnvInjectBuilder>
543         <hudson.tasks.Shell>
544           <command>#!/bin/bash
545 # SPDX-License-Identifier: EPL-1.0
546 ##############################################################################
547 # Copyright (c) 2017 The Linux Foundation and others.
548 #
549 # All rights reserved. This program and the accompanying materials
550 # are made available under the terms of the Eclipse Public License v1.0
551 # which accompanies this distribution, and is available at
552 # http://www.eclipse.org/legal/epl-v10.html
553 ##############################################################################
554 echo &quot;---&gt; create-netrc.sh&quot;
555
556 # Ensure we fail the job if any steps fail.
557 set -eu -o pipefail
558
559 NEXUS_URL=&quot;${NEXUSPROXY:-$NEXUS_URL}&quot;
560 CREDENTIAL=$(xmlstarlet sel -N &quot;x=http://maven.apache.org/SETTINGS/1.0.0&quot; \
561     -t -m &quot;/x:settings/x:servers/x:server[x:id='${SERVER_ID}']&quot; \
562     -v x:username -o &quot;:&quot; -v x:password \
563     &quot;$SETTINGS_FILE&quot;)
564
565 machine=$(echo &quot;$NEXUS_URL&quot; | awk -F/ '{print $3}')
566 user=$(echo &quot;$CREDENTIAL&quot; | cut -f1 -d:)
567 pass=$(echo &quot;$CREDENTIAL&quot; | cut -f2 -d:)
568
569 echo &quot;machine ${machine%:*} login $user password $pass&quot; &gt; ~/.netrc
570 </command>
571         </hudson.tasks.Shell>
572         <hudson.tasks.Shell>
573           <command>#!/bin/bash
574 # SPDX-License-Identifier: EPL-1.0
575 ##############################################################################
576 # Copyright (c) 2017 The Linux Foundation and others.
577 #
578 # All rights reserved. This program and the accompanying materials
579 # are made available under the terms of the Eclipse Public License v1.0
580 # which accompanies this distribution, and is available at
581 # http://www.eclipse.org/legal/epl-v10.html
582 ##############################################################################
583 echo &quot;---&gt; lftools-install.sh&quot;
584
585 # Script to install lftools via a version passed in via lf-infra-parameters
586 #
587 # Required parameters:
588 #
589 #     LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
590 #                      set to a strict version number like '1.2.3' or using
591 #                      PEP-440 definitions.
592 #
593 #                      Examples:
594 #                          &lt;1.0.0
595 #                          &gt;=1.0.0,&lt;2.0.0
596 #
597 # By default a released version of lftools should always be used.
598 # The purpose of the 2 variables below is so that lftools devs can test
599 # unreleased versions of lftools. There are 2 methods to install a dev version
600 # of lftools:
601 #
602 #     1) gerrit patch: Used to test a patch that has not yet been merged.
603 #                      To do this set something like this:
604 #                          LFTOOLS_MODE=gerrit
605 #                          LFTOOLS_REFSPEC=refs/changes/96/5296/7
606 #
607 #     2) git branch: Used to install an lftools version from a specific branch.
608 #                    To use this set the variables as follows:
609 #                          LFTOOLS_MODE=git
610 #                          LFTOOLS_REFSPEC=master
611 #
612 #     3) release : The intended use case and default setting.
613 #                  Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
614
615 LFTOOLS_MODE=release  # release | git | gerrit
616 LFTOOLS_REFSPEC=master
617
618 # Ensure we fail the job if any steps fail.
619 # DO NOT set -u as virtualenv's activate script has unbound variables
620 set -e -o pipefail
621
622 virtualenv --quiet &quot;/tmp/v/lftools&quot;
623 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
624 source &quot;/tmp/v/lftools/bin/activate&quot;
625 pip install --quiet --upgrade pip
626
627 case $LFTOOLS_MODE in
628     gerrit)
629         git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
630         pushd /tmp/lftools
631         git fetch origin &quot;$LFTOOLS_REFSPEC&quot;
632         git checkout FETCH_HEAD
633         pip install --quiet --upgrade -r requirements.txt
634         pip install --quiet --upgrade -e .
635         popd
636         ;;
637
638     git)
639         pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@&quot;$BRANCH&quot;
640         ;;
641
642     release)
643         if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
644             LFTOOLS_VERSION=&quot;==$LFTOOLS_VERSION&quot;
645         fi
646
647         pip install --quiet --upgrade &quot;lftools${LFTOOLS_VERSION}&quot;
648         ;;
649 esac
650
651 lftools --version
652
653 # pipdeptree prints out a lot of information because lftools pulls in many
654 # dependencies. Let's only print it if we want to debug.
655 # echo &quot;----&gt; Pip Dependency Tree&quot;
656 # pip install --quiet --upgrade pipdeptree
657 # pipdeptree
658
659 #!/bin/bash
660 # SPDX-License-Identifier: EPL-1.0
661 ##############################################################################
662 # Copyright (c) 2017 The Linux Foundation and others.
663 #
664 # All rights reserved. This program and the accompanying materials
665 # are made available under the terms of the Eclipse Public License v1.0
666 # which accompanies this distribution, and is available at
667 # http://www.eclipse.org/legal/epl-v10.html
668 ##############################################################################
669 echo &quot;---&gt; logs-deploy.sh&quot;
670
671 # Ensure we fail the job if any steps fail.
672 set -eu -o pipefail
673
674 set -x  # Trace commands for this script to make debugging easier.
675
676 ARCHIVE_ARTIFACTS=&quot;${ARCHIVE_ARTIFACTS:-}&quot;
677 LOGS_SERVER=&quot;${LOGS_SERVER:-None}&quot;
678
679 if [ &quot;${LOGS_SERVER}&quot; == 'None' ]
680 then
681     set +x # Disable trace since we no longer need it
682
683     echo &quot;WARNING: Logging server not set&quot;
684 else
685     NEXUS_URL=&quot;${NEXUSPROXY:-$NEXUS_URL}&quot;
686     NEXUS_PATH=&quot;${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}&quot;
687     BUILD_URL=&quot;${BUILD_URL}&quot;
688
689     lftools deploy archives -p &quot;$ARCHIVE_ARTIFACTS&quot; &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$WORKSPACE&quot;
690     lftools deploy logs &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$BUILD_URL&quot;
691
692     set +x  # Disable trace since we no longer need it.
693
694     echo &quot;Build logs: &lt;a href=\&quot;$LOGS_SERVER/$NEXUS_PATH\&quot;&gt;$LOGS_SERVER/$NEXUS_PATH&lt;/a&gt;&quot;
695 fi
696 </command>
697         </hudson.tasks.Shell>
698         <hudson.tasks.Shell>
699           <command>#!/bin/bash
700 # SPDX-License-Identifier: EPL-1.0
701 ##############################################################################
702 # Copyright (c) 2017 The Linux Foundation and others.
703 #
704 # All rights reserved. This program and the accompanying materials
705 # are made available under the terms of the Eclipse Public License v1.0
706 # which accompanies this distribution, and is available at
707 # http://www.eclipse.org/legal/epl-v10.html
708 ##############################################################################
709
710 # Clear log credential files
711 rm &quot;$SETTINGS_FILE&quot;
712 rm ~/.netrc
713 </command>
714         </hudson.tasks.Shell>
715         <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
716           <regexp>^Build logs: .*</regexp>
717         </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
718       </buildSteps>
719       <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
720       <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
721       <markBuildUnstable>false</markBuildUnstable>
722     </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
723     <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
724       <patterns>
725         <hudson.plugins.ws__cleanup.Pattern>
726           <pattern>**/*.jenkins-trigger</pattern>
727           <type>EXCLUDE</type>
728         </hudson.plugins.ws__cleanup.Pattern>
729       </patterns>
730       <deleteDirs>false</deleteDirs>
731       <cleanupMatrixParent>false</cleanupMatrixParent>
732       <externalDelete/>
733       <cleanWhenSuccess>true</cleanWhenSuccess>
734       <cleanWhenUnstable>true</cleanWhenUnstable>
735       <cleanWhenFailure>true</cleanWhenFailure>
736       <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
737       <cleanWhenAborted>true</cleanWhenAborted>
738       <notFailBuild>true</notFailBuild>
739     </hudson.plugins.ws__cleanup.WsCleanup>
740   </publishers>
741   <buildWrappers>
742     <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
743     <hudson.plugins.build__timeout.BuildTimeoutWrapper>
744       <timeoutMinutes>60</timeoutMinutes>
745       <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
746       <failBuild>true</failBuild>
747       <writingDescription>false</writingDescription>
748       <timeoutPercentage>0</timeoutPercentage>
749       <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
750       <timeoutType>absolute</timeoutType>
751     </hudson.plugins.build__timeout.BuildTimeoutWrapper>
752     <hudson.plugins.timestamper.TimestamperBuildWrapper/>
753     <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
754       <user>test-credential</user>
755     </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
756     <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
757     <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
758       <managedFiles>
759         <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
760           <fileId>npmrc</fileId>
761           <targetLocation>$HOME/.npmrc</targetLocation>
762           <variable/>
763         </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
764       </managedFiles>
765     </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
766   </buildWrappers>
767 </project>