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