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