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