Fix default platform location to common-packer
[releng/global-jjb.git] / .jjb-test / expected-xml / gerrit-maven-maven-verify-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.PluginPatchsetCreatedEvent>
190           <excludeDrafts>true</excludeDrafts>
191           <excludeTrivialRebase>false</excludeTrivialRebase>
192           <excludeNoCodeChange>false</excludeNoCodeChange>
193         </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
194         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginDraftPublishedEvent/>
195         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
196           <commentAddedCommentContains>recheck$</commentAddedCommentContains>
197         </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
198       </triggerOnEvents>
199       <buildStartMessage/>
200       <buildFailureMessage/>
201       <buildSuccessfulMessage/>
202       <buildUnstableMessage/>
203       <buildNotBuiltMessage/>
204       <buildUnsuccessfulFilepath/>
205       <customUrl/>
206       <serverName>test-server</serverName>
207     </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
208   </triggers>
209   <builders>
210     <hudson.tasks.Shell>
211       <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
212     </hudson.tasks.Shell>
213     <hudson.tasks.Shell>
214       <command>echo &quot;quiet=on&quot; &gt; &quot;$HOME/.wgetrc&quot;</command>
215     </hudson.tasks.Shell>
216     <hudson.tasks.Maven>
217       <targets>--version</targets>
218       <properties/>
219       <mavenName>mvn33</mavenName>
220       <usePrivateRepository>false</usePrivateRepository>
221       <settings class="jenkins.mvn.DefaultSettingsProvider"/>
222       <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
223     </hudson.tasks.Maven>
224     <hudson.tasks.Shell>
225       <command>rm &quot;$HOME/.wgetrc&quot;</command>
226     </hudson.tasks.Shell>
227     <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
228       <managedFiles>
229         <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
230           <fileId>global-settings</fileId>
231           <targetLocation/>
232           <variable>GLOBAL_SETTINGS_FILE</variable>
233         </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
234         <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
235           <fileId>gerrit-maven-project-settings</fileId>
236           <targetLocation/>
237           <variable>SETTINGS_FILE</variable>
238         </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
239       </managedFiles>
240     </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
241     <hudson.tasks.Shell>
242       <command>#!/bin/bash
243 # SPDX-License-Identifier: EPL-1.0
244 ##############################################################################
245 # Copyright (c) 2017 The Linux Foundation and others.
246 #
247 # All rights reserved. This program and the accompanying materials
248 # are made available under the terms of the Eclipse Public License v1.0
249 # which accompanies this distribution, and is available at
250 # http://www.eclipse.org/legal/epl-v10.html
251 ##############################################################################
252 echo &quot;---&gt; lftools-install.sh&quot;
253
254 # Script to install lftools via a version passed in via lf-infra-parameters
255 #
256 # Required parameters:
257 #
258 #     LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
259 #                      set to a strict version number like '1.2.3' or using
260 #                      PEP-440 definitions.
261 #
262 #                      Examples:
263 #                          &lt;1.0.0
264 #                          &gt;=1.0.0,&lt;2.0.0
265 #
266 # By default a released version of lftools should always be used.
267 # The purpose of the 2 variables below is so that lftools devs can test
268 # unreleased versions of lftools. There are 2 methods to install a dev version
269 # of lftools:
270 #
271 #     1) gerrit patch: Used to test a patch that has not yet been merged.
272 #                      To do this set something like this:
273 #                          LFTOOLS_MODE=gerrit
274 #                          LFTOOLS_REFSPEC=refs/changes/96/5296/7
275 #
276 #     2) git branch: Used to install an lftools version from a specific branch.
277 #                    To use this set the variables as follows:
278 #                          LFTOOLS_MODE=git
279 #                          LFTOOLS_REFSPEC=master
280 #
281 #     3) release : The intended use case and default setting.
282 #                  Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
283
284 LFTOOLS_MODE=release  # release | git | gerrit
285 LFTOOLS_REFSPEC=master
286
287 # Ensure we fail the job if any steps fail.
288 # DO NOT set -u as virtualenv's activate script has unbound variables
289 set -e -o pipefail
290
291 virtualenv --quiet &quot;/tmp/v/lftools&quot;
292 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
293 source &quot;/tmp/v/lftools/bin/activate&quot;
294 pip install --quiet --upgrade pip
295
296 case $LFTOOLS_MODE in
297     gerrit)
298         git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
299         pushd /tmp/lftools
300         git fetch origin &quot;$LFTOOLS_REFSPEC&quot;
301         git checkout FETCH_HEAD
302         pip install --quiet --upgrade -r requirements.txt
303         pip install --quiet --upgrade -e .
304         popd
305         ;;
306
307     git)
308         pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@&quot;$BRANCH&quot;
309         ;;
310
311     release)
312         if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
313             LFTOOLS_VERSION=&quot;==$LFTOOLS_VERSION&quot;
314         fi
315
316         pip install --quiet --upgrade &quot;lftools${LFTOOLS_VERSION}&quot;
317         ;;
318 esac
319
320 lftools --version
321
322 # pipdeptree prints out a lot of information because lftools pulls in many
323 # dependencies. Let's only print it if we want to debug.
324 # echo &quot;----&gt; Pip Dependency Tree&quot;
325 # pip install --quiet --upgrade pipdeptree
326 # pipdeptree
327
328 #!/bin/bash
329 # SPDX-License-Identifier: EPL-1.0
330 ##############################################################################
331 # Copyright (c) 2017 The Linux Foundation and others.
332 #
333 # All rights reserved. This program and the accompanying materials
334 # are made available under the terms of the Eclipse Public License v1.0
335 # which accompanies this distribution, and is available at
336 # http://www.eclipse.org/legal/epl-v10.html
337 ##############################################################################
338
339 # This file contains a list of variables that are generally useful in many
340 # scripts. It is meant to be sourced in other scripts so that the variables can
341 # be called.
342
343 MAVEN_OPTIONS=&quot;$(echo --show-version \
344     --batch-mode \
345     -Djenkins \
346     -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
347     -Dmaven.repo.local=/tmp/r \
348     -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)&quot;
349 echo &quot;$MAVEN_OPTIONS&quot;
350
351 #!/bin/bash
352 # SPDX-License-Identifier: EPL-1.0
353 ##############################################################################
354 # Copyright (c) 2017 The Linux Foundation and others.
355 #
356 # All rights reserved. This program and the accompanying materials
357 # are made available under the terms of the Eclipse Public License v1.0
358 # which accompanies this distribution, and is available at
359 # http://www.eclipse.org/legal/epl-v10.html
360 ##############################################################################
361
362 # This script builds a Maven project and deploys it into a staging repo which
363 # can be used to deploy elsewhere later eg. Nexus staging / snapshot repos.
364
365 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
366 # Ensure we fail the job if any steps fail.
367 set -e -o pipefail
368 set +u
369
370 export MAVEN_OPTS
371
372 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
373 # shellcheck disable=SC2086
374 $MVN clean deploy \
375     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
376     --settings &quot;$SETTINGS_FILE&quot; \
377     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
378     $MAVEN_OPTIONS $MAVEN_PARAMS
379 </command>
380     </hudson.tasks.Shell>
381     <hudson.tasks.Shell>
382       <command>#!/bin/bash
383 set +e  # DO NOT cause build failure if any of the rm calls fail.
384
385 rm &quot;$GLOBAL_SETTINGS_FILE&quot; &quot;$SETTINGS_FILE&quot;
386
387 # In some cases we use the lf-provide-maven-settings macro to produce
388 # a &quot;$HOME/.netrc&quot; file containing credentials. Remove that file here
389 # too if it exists.
390 rm &quot;$HOME/.netrc&quot;
391
392 # DO NOT fail build if any of the above lines fail.
393 exit 0
394 </command>
395     </hudson.tasks.Shell>
396   </builders>
397   <publishers>
398     <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs">
399       <isRankActivated>false</isRankActivated>
400       <includePattern/>
401       <excludePattern/>
402       <healthy/>
403       <unHealthy/>
404       <thresholdLimit>low</thresholdLimit>
405       <pluginName>[FINDBUGS] </pluginName>
406       <defaultEncoding/>
407       <canRunOnFailed>false</canRunOnFailed>
408       <useStableBuildAsReference>false</useStableBuildAsReference>
409       <usePreviousBuildAsReference>false</usePreviousBuildAsReference>
410       <useDeltaValues>false</useDeltaValues>
411       <thresholds>
412         <unstableTotalAll/>
413         <unstableTotalHigh/>
414         <unstableTotalNormal/>
415         <unstableTotalLow/>
416         <failedTotalAll/>
417         <failedTotalHigh/>
418         <failedTotalNormal/>
419         <failedTotalLow/>
420       </thresholds>
421       <shouldDetectModules>false</shouldDetectModules>
422       <dontComputeNew>true</dontComputeNew>
423       <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
424       <pattern/>
425     </hudson.plugins.findbugs.FindBugsPublisher>
426     <hudson.plugins.jacoco.JacocoPublisher plugin="jacoco">
427       <execPattern>**/**.exec</execPattern>
428       <classPattern>**/classes</classPattern>
429       <sourcePattern>**/src/main/java</sourcePattern>
430       <changeBuildStatus>false</changeBuildStatus>
431       <inclusionPattern/>
432       <exclusionPattern>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</exclusionPattern>
433       <maximumBranchCoverage>10</maximumBranchCoverage>
434       <minimumBranchCoverage>20</minimumBranchCoverage>
435       <maximumMethodCoverage>50</maximumMethodCoverage>
436       <minimumMethodCoverage>40</minimumMethodCoverage>
437     </hudson.plugins.jacoco.JacocoPublisher>
438     <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
439       <buildSteps>
440         <hudson.tasks.Shell>
441           <command>#!/bin/bash
442 # SPDX-License-Identifier: EPL-1.0
443 ##############################################################################
444 # Copyright (c) 2017 The Linux Foundation and others.
445 #
446 # All rights reserved. This program and the accompanying materials
447 # are made available under the terms of the Eclipse Public License v1.0
448 # which accompanies this distribution, and is available at
449 # http://www.eclipse.org/legal/epl-v10.html
450 ##############################################################################
451 echo &quot;---&gt; sysstat.sh&quot;
452 set +e  # DON'T fail build if script fails.
453
454 OS=$(facter operatingsystem)
455 case &quot;$OS&quot; in
456     Ubuntu)
457         SYSSTAT_PATH=&quot;/var/log/sysstat&quot;
458
459         # Dont run the script when systat is not enabled by default
460         if ! grep --quiet 'ENABLED=&quot;true&quot;' &quot;/etc/default/sysstat&quot;; then
461             exit 0
462         fi
463     ;;
464     CentOS|RedHat)
465         SYSSTAT_PATH=&quot;/var/log/sa&quot;
466     ;;
467     *)
468         # nothing to do
469         exit 0
470     ;;
471 esac
472
473 SAR_DIR=&quot;$WORKSPACE/archives/sar-reports&quot;
474 mkdir -p &quot;$SAR_DIR&quot;
475 cp &quot;$SYSSTAT_PATH/&quot;* &quot;$_&quot;
476 # convert sar data to ascii format
477 while IFS=&quot;&quot; read -r sarfilenum
478 do
479     [ -f &quot;$sarfilenum&quot; ] &amp;&amp; LC_TIME=POSIX sar -A -f &quot;$sarfilenum&quot; &gt; &quot;$SAR_DIR/sar${sarfilenum//[!0-9]/}&quot;
480 done &lt; &lt;(find &quot;$SYSSTAT_PATH&quot; -name &quot;sa[0-9]*&quot; || true)
481
482 # DON'T fail build if script fails.
483 exit 0
484 </command>
485         </hudson.tasks.Shell>
486         <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
487           <managedFiles>
488             <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
489               <fileId>jenkins-log-archives-settings</fileId>
490               <targetLocation/>
491               <variable>SETTINGS_FILE</variable>
492             </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
493           </managedFiles>
494         </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
495         <EnvInjectBuilder>
496           <info>
497             <propertiesContent>SERVER_ID=logs</propertiesContent>
498           </info>
499         </EnvInjectBuilder>
500         <hudson.tasks.Shell>
501           <command>#!/bin/bash
502 # SPDX-License-Identifier: EPL-1.0
503 ##############################################################################
504 # Copyright (c) 2017 The Linux Foundation and others.
505 #
506 # All rights reserved. This program and the accompanying materials
507 # are made available under the terms of the Eclipse Public License v1.0
508 # which accompanies this distribution, and is available at
509 # http://www.eclipse.org/legal/epl-v10.html
510 ##############################################################################
511 echo &quot;---&gt; create-netrc.sh&quot;
512
513 # Ensure we fail the job if any steps fail.
514 set -eu -o pipefail
515
516 NEXUS_URL=&quot;${NEXUSPROXY:-$NEXUS_URL}&quot;
517 CREDENTIAL=$(xmlstarlet sel -N &quot;x=http://maven.apache.org/SETTINGS/1.0.0&quot; \
518     -t -m &quot;/x:settings/x:servers/x:server[x:id='${SERVER_ID}']&quot; \
519     -v x:username -o &quot;:&quot; -v x:password \
520     &quot;$SETTINGS_FILE&quot;)
521
522 machine=$(echo &quot;$NEXUS_URL&quot; | awk -F/ '{print $3}')
523 user=$(echo &quot;$CREDENTIAL&quot; | cut -f1 -d:)
524 pass=$(echo &quot;$CREDENTIAL&quot; | cut -f2 -d:)
525
526 echo &quot;machine ${machine%:*} login $user password $pass&quot; &gt; ~/.netrc
527 </command>
528         </hudson.tasks.Shell>
529         <hudson.tasks.Shell>
530           <command>#!/bin/bash
531 # SPDX-License-Identifier: EPL-1.0
532 ##############################################################################
533 # Copyright (c) 2017 The Linux Foundation and others.
534 #
535 # All rights reserved. This program and the accompanying materials
536 # are made available under the terms of the Eclipse Public License v1.0
537 # which accompanies this distribution, and is available at
538 # http://www.eclipse.org/legal/epl-v10.html
539 ##############################################################################
540 echo &quot;---&gt; lftools-install.sh&quot;
541
542 # Script to install lftools via a version passed in via lf-infra-parameters
543 #
544 # Required parameters:
545 #
546 #     LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
547 #                      set to a strict version number like '1.2.3' or using
548 #                      PEP-440 definitions.
549 #
550 #                      Examples:
551 #                          &lt;1.0.0
552 #                          &gt;=1.0.0,&lt;2.0.0
553 #
554 # By default a released version of lftools should always be used.
555 # The purpose of the 2 variables below is so that lftools devs can test
556 # unreleased versions of lftools. There are 2 methods to install a dev version
557 # of lftools:
558 #
559 #     1) gerrit patch: Used to test a patch that has not yet been merged.
560 #                      To do this set something like this:
561 #                          LFTOOLS_MODE=gerrit
562 #                          LFTOOLS_REFSPEC=refs/changes/96/5296/7
563 #
564 #     2) git branch: Used to install an lftools version from a specific branch.
565 #                    To use this set the variables as follows:
566 #                          LFTOOLS_MODE=git
567 #                          LFTOOLS_REFSPEC=master
568 #
569 #     3) release : The intended use case and default setting.
570 #                  Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
571
572 LFTOOLS_MODE=release  # release | git | gerrit
573 LFTOOLS_REFSPEC=master
574
575 # Ensure we fail the job if any steps fail.
576 # DO NOT set -u as virtualenv's activate script has unbound variables
577 set -e -o pipefail
578
579 virtualenv --quiet &quot;/tmp/v/lftools&quot;
580 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
581 source &quot;/tmp/v/lftools/bin/activate&quot;
582 pip install --quiet --upgrade pip
583
584 case $LFTOOLS_MODE in
585     gerrit)
586         git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
587         pushd /tmp/lftools
588         git fetch origin &quot;$LFTOOLS_REFSPEC&quot;
589         git checkout FETCH_HEAD
590         pip install --quiet --upgrade -r requirements.txt
591         pip install --quiet --upgrade -e .
592         popd
593         ;;
594
595     git)
596         pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@&quot;$BRANCH&quot;
597         ;;
598
599     release)
600         if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
601             LFTOOLS_VERSION=&quot;==$LFTOOLS_VERSION&quot;
602         fi
603
604         pip install --quiet --upgrade &quot;lftools${LFTOOLS_VERSION}&quot;
605         ;;
606 esac
607
608 lftools --version
609
610 # pipdeptree prints out a lot of information because lftools pulls in many
611 # dependencies. Let's only print it if we want to debug.
612 # echo &quot;----&gt; Pip Dependency Tree&quot;
613 # pip install --quiet --upgrade pipdeptree
614 # pipdeptree
615
616 #!/bin/bash
617 # SPDX-License-Identifier: EPL-1.0
618 ##############################################################################
619 # Copyright (c) 2017 The Linux Foundation and others.
620 #
621 # All rights reserved. This program and the accompanying materials
622 # are made available under the terms of the Eclipse Public License v1.0
623 # which accompanies this distribution, and is available at
624 # http://www.eclipse.org/legal/epl-v10.html
625 ##############################################################################
626 echo &quot;---&gt; logs-deploy.sh&quot;
627
628 # Ensure we fail the job if any steps fail.
629 set -eu -o pipefail
630
631 set -x  # Trace commands for this script to make debugging easier.
632
633 ARCHIVE_ARTIFACTS=&quot;${ARCHIVE_ARTIFACTS:-}&quot;
634 LOGS_SERVER=&quot;${LOGS_SERVER:-None}&quot;
635
636 if [ &quot;${LOGS_SERVER}&quot; == 'None' ]
637 then
638     set +x # Disable trace since we no longer need it
639
640     echo &quot;WARNING: Logging server not set&quot;
641 else
642     NEXUS_URL=&quot;${NEXUSPROXY:-$NEXUS_URL}&quot;
643     NEXUS_PATH=&quot;${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}&quot;
644     BUILD_URL=&quot;${BUILD_URL}&quot;
645
646     lftools deploy archives -p &quot;$ARCHIVE_ARTIFACTS&quot; &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$WORKSPACE&quot;
647     lftools deploy logs &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$BUILD_URL&quot;
648
649     set +x  # Disable trace since we no longer need it.
650
651     echo &quot;Build logs: &lt;a href=\&quot;$LOGS_SERVER/$NEXUS_PATH\&quot;&gt;$LOGS_SERVER/$NEXUS_PATH&lt;/a&gt;&quot;
652 fi
653 </command>
654         </hudson.tasks.Shell>
655         <hudson.tasks.Shell>
656           <command>#!/bin/bash
657 # SPDX-License-Identifier: EPL-1.0
658 ##############################################################################
659 # Copyright (c) 2017 The Linux Foundation and others.
660 #
661 # All rights reserved. This program and the accompanying materials
662 # are made available under the terms of the Eclipse Public License v1.0
663 # which accompanies this distribution, and is available at
664 # http://www.eclipse.org/legal/epl-v10.html
665 ##############################################################################
666
667 # Clear log credential files
668 rm &quot;$SETTINGS_FILE&quot;
669 rm ~/.netrc
670 </command>
671         </hudson.tasks.Shell>
672         <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
673           <regexp>^Build logs: .*</regexp>
674         </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
675       </buildSteps>
676       <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
677       <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
678       <markBuildUnstable>false</markBuildUnstable>
679     </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
680     <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
681       <patterns>
682         <hudson.plugins.ws__cleanup.Pattern>
683           <pattern>**/*.jenkins-trigger</pattern>
684           <type>EXCLUDE</type>
685         </hudson.plugins.ws__cleanup.Pattern>
686       </patterns>
687       <deleteDirs>false</deleteDirs>
688       <cleanupMatrixParent>false</cleanupMatrixParent>
689       <externalDelete/>
690       <cleanWhenSuccess>true</cleanWhenSuccess>
691       <cleanWhenUnstable>true</cleanWhenUnstable>
692       <cleanWhenFailure>true</cleanWhenFailure>
693       <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
694       <cleanWhenAborted>true</cleanWhenAborted>
695       <notFailBuild>true</notFailBuild>
696     </hudson.plugins.ws__cleanup.WsCleanup>
697   </publishers>
698   <buildWrappers>
699     <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
700     <hudson.plugins.build__timeout.BuildTimeoutWrapper>
701       <timeoutMinutes>60</timeoutMinutes>
702       <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
703       <failBuild>true</failBuild>
704       <writingDescription>false</writingDescription>
705       <timeoutPercentage>0</timeoutPercentage>
706       <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
707       <timeoutType>absolute</timeoutType>
708     </hudson.plugins.build__timeout.BuildTimeoutWrapper>
709     <hudson.plugins.timestamper.TimestamperBuildWrapper/>
710     <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
711       <user>test-credential</user>
712     </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
713     <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
714     <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
715       <managedFiles>
716         <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
717           <fileId>npmrc</fileId>
718           <targetLocation>$HOME/.npmrc</targetLocation>
719           <variable/>
720         </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
721       </managedFiles>
722     </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
723   </buildWrappers>
724 </project>