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