da945ce7d7876c5b1528cc3a463ee48301313fe0
[releng/global-jjb.git] / .jjb-test / expected-xml / gerrit-python-tox-verify-master
1 <?xml version="1.0" encoding="utf-8"?>
2 <project>
3   <actions/>
4   <description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
5   <keepDependencies>false</keepDependencies>
6   <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
7   <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
8   <concurrentBuild>true</concurrentBuild>
9   <assignedNode>build-vm</assignedNode>
10   <canRoam>false</canRoam>
11   <properties>
12     <jenkins.model.BuildDiscarderProperty>
13       <strategy class="hudson.tasks.LogRotator">
14         <daysToKeep>7</daysToKeep>
15         <numToKeep>-1</numToKeep>
16         <artifactDaysToKeep>-1</artifactDaysToKeep>
17         <artifactNumToKeep>0</artifactNumToKeep>
18       </strategy>
19     </jenkins.model.BuildDiscarderProperty>
20     <hudson.model.ParametersDefinitionProperty>
21       <parameterDefinitions>
22         <hudson.model.StringParameterDefinition>
23           <name>PROJECT</name>
24           <description>Parameter to identify a Gerrit project. This is typically the
25 project repo path as exists in Gerrit.
26 For example: ofextensions/circuitsw
27 </description>
28           <defaultValue>releng/ciman</defaultValue>
29         </hudson.model.StringParameterDefinition>
30         <hudson.model.StringParameterDefinition>
31           <name>STREAM</name>
32           <description>Stream is often set to the same name as 'branch' but can
33 sometimes be used as a name representing a project's release code
34 name.
35 </description>
36           <defaultValue>master</defaultValue>
37         </hudson.model.StringParameterDefinition>
38         <hudson.model.StringParameterDefinition>
39           <name>GERRIT_PROJECT</name>
40           <description>Parameter to identify Gerrit project. This is typically the
41 project repo path as exists in Gerrit.
42 For example: ofextensions/circuitsw
43
44 Note that Gerrit will override this parameter automatically if a
45 job is triggered by Gerrit.
46 </description>
47           <defaultValue>releng/ciman</defaultValue>
48         </hudson.model.StringParameterDefinition>
49         <hudson.model.StringParameterDefinition>
50           <name>GERRIT_BRANCH</name>
51           <description>Parameter to identify a Gerrit branch.
52
53 Note that Gerrit will override this parameter automatically if a
54 job is triggered by Gerrit.
55 </description>
56           <defaultValue>master</defaultValue>
57         </hudson.model.StringParameterDefinition>
58         <hudson.model.StringParameterDefinition>
59           <name>GERRIT_REFSPEC</name>
60           <description>Parameter to identify a refspec when pulling from Gerrit.
61
62 Note that Gerrit will override this parameter automatically if a
63 job is triggered by Gerrit.
64 </description>
65           <defaultValue>refs/heads/master</defaultValue>
66         </hudson.model.StringParameterDefinition>
67         <hudson.model.StringParameterDefinition>
68           <name>LFTOOLS_VERSION</name>
69           <description>Version of lftools to install. Can be a specific version like
70 '0.6.0' or a PEP-440 definition.
71 https://www.python.org/dev/peps/pep-0440/
72 For example '&lt;1.0.0' or '&gt;=1.0.0,&lt;2.0.0'.
73 </description>
74           <defaultValue>&lt;1.0.0</defaultValue>
75         </hudson.model.StringParameterDefinition>
76         <hudson.model.StringParameterDefinition>
77           <name>TOX_DIR</name>
78           <description>Path to directory containing tox.ini file.
79 </description>
80           <defaultValue/>
81         </hudson.model.StringParameterDefinition>
82         <hudson.model.StringParameterDefinition>
83           <name>TOX_ENVS</name>
84           <description>Tox environments to run build against.
85 Example: docs,py2,py3
86 </description>
87           <defaultValue/>
88         </hudson.model.StringParameterDefinition>
89       </parameterDefinitions>
90     </hudson.model.ParametersDefinitionProperty>
91   </properties>
92   <scm class="hudson.plugins.git.GitSCM">
93     <configVersion>2</configVersion>
94     <userRemoteConfigs>
95       <hudson.plugins.git.UserRemoteConfig>
96         <name>origin</name>
97         <refspec>$GERRIT_REFSPEC</refspec>
98         <url>$GIT_URL/$GERRIT_PROJECT</url>
99         <credentialsId>test-credential</credentialsId>
100       </hudson.plugins.git.UserRemoteConfig>
101     </userRemoteConfigs>
102     <branches>
103       <hudson.plugins.git.BranchSpec>
104         <name>refs/heads/$GERRIT_BRANCH</name>
105       </hudson.plugins.git.BranchSpec>
106     </branches>
107     <excludedUsers/>
108     <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
109     <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
110     <authorOrCommitter>false</authorOrCommitter>
111     <wipeOutWorkspace>true</wipeOutWorkspace>
112     <pruneBranches>false</pruneBranches>
113     <remotePoll>false</remotePoll>
114     <gitTool>Default</gitTool>
115     <submoduleCfg class="list"/>
116     <relativeTargetDir/>
117     <reference/>
118     <gitConfigName/>
119     <gitConfigEmail/>
120     <skipTag>true</skipTag>
121     <scmName/>
122     <useShallowClone>false</useShallowClone>
123     <ignoreNotifyCommit>false</ignoreNotifyCommit>
124     <extensions>
125       <hudson.plugins.git.extensions.impl.SubmoduleOption>
126         <disableSubmodules>false</disableSubmodules>
127         <recursiveSubmodules>true</recursiveSubmodules>
128         <trackingSubmodules>false</trackingSubmodules>
129         <reference/>
130         <timeout>10</timeout>
131       </hudson.plugins.git.extensions.impl.SubmoduleOption>
132       <hudson.plugins.git.extensions.impl.WipeWorkspace/>
133     </extensions>
134   </scm>
135   <triggers class="vector">
136     <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
137       <spec/>
138       <gerritProjects>
139         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
140           <compareType>ANT</compareType>
141           <pattern>releng/ciman</pattern>
142           <branches>
143             <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
144               <compareType>ANT</compareType>
145               <pattern>**/master</pattern>
146             </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
147           </branches>
148           <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
149         </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
150       </gerritProjects>
151       <skipVote>
152         <onSuccessful>false</onSuccessful>
153         <onFailed>false</onFailed>
154         <onUnstable>false</onUnstable>
155         <onNotBuilt>false</onNotBuilt>
156       </skipVote>
157       <silentMode>false</silentMode>
158       <silentStartMode>false</silentStartMode>
159       <escapeQuotes>true</escapeQuotes>
160       <noNameAndEmailParameters>false</noNameAndEmailParameters>
161       <readableMessage>false</readableMessage>
162       <dependencyJobsNames/>
163       <notificationLevel/>
164       <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
165       <triggerConfigURL/>
166       <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
167       <triggerOnEvents>
168         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
169           <excludeDrafts>true</excludeDrafts>
170           <excludeTrivialRebase>false</excludeTrivialRebase>
171           <excludeNoCodeChange>false</excludeNoCodeChange>
172         </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
173         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginDraftPublishedEvent/>
174         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
175           <commentAddedCommentContains>recheck$</commentAddedCommentContains>
176         </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
177       </triggerOnEvents>
178       <buildStartMessage/>
179       <buildFailureMessage/>
180       <buildSuccessfulMessage/>
181       <buildUnstableMessage/>
182       <buildNotBuiltMessage/>
183       <buildUnsuccessfulFilepath/>
184       <customUrl/>
185       <serverName>test-server</serverName>
186     </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
187   </triggers>
188   <builders>
189     <hudson.tasks.Shell>
190       <command>#!/bin/bash
191 # SPDX-License-Identifier: EPL-1.0
192 ##############################################################################
193 # Copyright (c) 2017 The Linux Foundation and others.
194 #
195 # All rights reserved. This program and the accompanying materials
196 # are made available under the terms of the Eclipse Public License v1.0
197 # which accompanies this distribution, and is available at
198 # http://www.eclipse.org/legal/epl-v10.html
199 ##############################################################################
200 echo &quot;---&gt; lftools-install.sh&quot;
201
202 # Script to install lftools via a version passed in via lf-infra-parameters
203 #
204 # Required parameters:
205 #
206 #     LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
207 #                      set to a strict version number like '1.2.3' or using
208 #                      PEP-440 definitions.
209 #
210 #                      Examples:
211 #                          &lt;1.0.0
212 #                          &gt;=1.0.0,&lt;2.0.0
213 #
214 # By default a released version of lftools should always be used.
215 # The purpose of the 2 variables below is so that lftools devs can test
216 # unreleased versions of lftools. There are 2 methods to install a dev version
217 # of lftools:
218 #
219 #     1) gerrit patch: Used to test a patch that has not yet been merged.
220 #                      To do this set something like this:
221 #                          LFTOOLS_MODE=gerrit
222 #                          LFTOOLS_REFSPEC=refs/changes/96/5296/7
223 #
224 #     2) git branch: Used to install an lftools version from a specific branch.
225 #                    To use this set the variables as follows:
226 #                          LFTOOLS_MODE=git
227 #                          LFTOOLS_REFSPEC=master
228 #
229 #     3) release : The intended use case and default setting.
230 #                  Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
231
232 LFTOOLS_MODE=release  # release | git | gerrit
233 LFTOOLS_REFSPEC=master
234
235 # Ensure we fail the job if any steps fail.
236 # DO NOT set -u as virtualenv's activate script has unbound variables
237 set -e -o pipefail
238
239 virtualenv --quiet &quot;/tmp/v/lftools&quot;
240 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
241 source &quot;/tmp/v/lftools/bin/activate&quot;
242 pip install --quiet --upgrade pip
243
244 case $LFTOOLS_MODE in
245     gerrit)
246         git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
247         pushd /tmp/lftools
248         git fetch origin &quot;$LFTOOLS_REFSPEC&quot;
249         git checkout FETCH_HEAD
250         pip install --quiet --upgrade -r requirements.txt
251         pip install --quiet --upgrade -e .
252         popd
253         ;;
254
255     git)
256         pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@&quot;$BRANCH&quot;
257         ;;
258
259     release)
260         if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
261             LFTOOLS_VERSION=&quot;==$LFTOOLS_VERSION&quot;
262         fi
263
264         pip install --quiet --upgrade &quot;lftools${LFTOOLS_VERSION}&quot;
265         ;;
266 esac
267
268 lftools --version
269
270 # pipdeptree prints out a lot of information because lftools pulls in many
271 # dependencies. Let's only print it if we want to debug.
272 # echo &quot;----&gt; Pip Dependency Tree&quot;
273 # pip install --quiet --upgrade pipdeptree
274 # pipdeptree
275 </command>
276     </hudson.tasks.Shell>
277     <hudson.tasks.Shell>
278       <command>#!/bin/bash
279 # SPDX-License-Identifier: EPL-1.0
280 ##############################################################################
281 # Copyright (c) 2017 The Linux Foundation and others.
282 #
283 # All rights reserved. This program and the accompanying materials
284 # are made available under the terms of the Eclipse Public License v1.0
285 # which accompanies this distribution, and is available at
286 # http://www.eclipse.org/legal/epl-v10.html
287 ##############################################################################
288 echo &quot;---&gt; tox-install.sh&quot;
289
290 # Ensure we fail the job if any steps fail.
291 # DO NOT set -u as virtualenv's activate script has unbound variables
292 set -e -o pipefail
293
294 virtualenv --quiet &quot;/tmp/v/tox&quot;
295 # shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
296 source &quot;/tmp/v/tox/bin/activate&quot;
297 pip install --quiet --upgrade pip
298 pip install --quiet --upgrade pipdeptree
299 pip install --quiet --upgrade tox argparse
300
301 echo &quot;----&gt; Pip Dependency Tree&quot;
302 pipdeptree
303
304 #!/bin/bash
305 # SPDX-License-Identifier: EPL-1.0
306 ##############################################################################
307 # Copyright (c) 2017 The Linux Foundation and others.
308 #
309 # All rights reserved. This program and the accompanying materials
310 # are made available under the terms of the Eclipse Public License v1.0
311 # which accompanies this distribution, and is available at
312 # http://www.eclipse.org/legal/epl-v10.html
313 ##############################################################################
314 echo &quot;---&gt; tox-run.sh&quot;
315
316 # Ensure we fail the job if any steps fail.
317 # DO NOT set -u as virtualenv's activate script has unbound variables
318 set -e -o pipefail
319
320 ARCHIVE_TOX_DIR=&quot;$WORKSPACE/archives/tox&quot;
321 mkdir -p &quot;$ARCHIVE_TOX_DIR&quot;
322
323 cd &quot;$WORKSPACE/$TOX_DIR&quot;
324
325 if [ -z &quot;$TOX_ENVS&quot; ]; then
326     TOX_ENVS=$(crudini --get tox.ini tox envlist)
327 fi
328
329 run_tox() {
330     local log_dir=&quot;$1&quot;
331     local env=&quot;$2&quot;
332
333     # Sleep a random 10 second interval to workaround tox sdist
334     # conflicts due to building in the same dist directory.
335     sleep $[ ( $RANDOM % 10 )  + 1 ]s
336
337     echo &quot;-----&gt; Running tox $env&quot;
338     if ! tox -e $env &gt; &quot;$log_dir/tox-$env.log&quot;; then
339         echo &quot;$env&quot; &gt;&gt; &quot;$log_dir/failed-envs.log&quot;
340     fi
341 }
342
343 TOX_ENVS=(${TOX_ENVS//,/ })
344 if hash parallel 2&gt;/dev/null; then
345     export -f run_tox
346     parallel --jobs 200% &quot;run_tox $ARCHIVE_TOX_DIR {}&quot; ::: ${TOX_ENVS[*]}
347 else
348     for env in &quot;${TOX_ENVS[@]}&quot;; do
349         run_tox &quot;$ARCHIVE_TOX_DIR&quot; &quot;$env&quot;
350     done
351 fi
352
353 if [ -f &quot;$ARCHIVE_TOX_DIR/failed-envs.log&quot; ]; then
354     failed_envs=($(cat &quot;$ARCHIVE_TOX_DIR/failed-envs.log&quot;))
355     for e in &quot;${failed_envs[@]}&quot;; do
356         echo &quot;cat $ARCHIVE_TOX_DIR/tox-$e.log&quot;
357         cat &quot;$ARCHIVE_TOX_DIR/tox-$e.log&quot;
358     done
359     echo &quot;ERROR: Failed the following builds: ${failed_envs[*]}&quot;
360     exit 1
361 fi
362
363 echo &quot;Completed tox runs.&quot;
364 </command>
365     </hudson.tasks.Shell>
366   </builders>
367   <publishers>
368     <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
369       <buildSteps>
370         <hudson.tasks.Shell>
371           <command>#!/bin/bash
372 # SPDX-License-Identifier: EPL-1.0
373 ##############################################################################
374 # Copyright (c) 2017 The Linux Foundation and others.
375 #
376 # All rights reserved. This program and the accompanying materials
377 # are made available under the terms of the Eclipse Public License v1.0
378 # which accompanies this distribution, and is available at
379 # http://www.eclipse.org/legal/epl-v10.html
380 ##############################################################################
381 echo &quot;---&gt; sysstat.sh&quot;
382 set +e  # DON'T fail build if script fails.
383
384 OS=$(facter operatingsystem)
385 case &quot;$OS&quot; in
386     Ubuntu)
387         SYSSTAT_PATH=&quot;/var/log/sysstat&quot;
388
389         # Dont run the script when systat is not enabled by default
390         if ! grep --quiet 'ENABLED=&quot;true&quot;' &quot;/etc/default/sysstat&quot;; then
391             exit 0
392         fi
393     ;;
394     CentOS|RedHat)
395         SYSSTAT_PATH=&quot;/var/log/sa&quot;
396     ;;
397     *)
398         # nothing to do
399         exit 0
400     ;;
401 esac
402
403 SAR_DIR=&quot;$WORKSPACE/archives/sar-reports&quot;
404 mkdir -p &quot;$SAR_DIR&quot;
405 cp &quot;$SYSSTAT_PATH/&quot;* &quot;$_&quot;
406 # convert sar data to ascii format
407 while IFS=&quot;&quot; read -r sarfilenum
408 do
409     [ -f &quot;$sarfilenum&quot; ] &amp;&amp; LC_TIME=POSIX sar -A -f &quot;$sarfilenum&quot; &gt; &quot;$SAR_DIR/sar${sarfilenum//[!0-9]/}&quot;
410 done &lt; &lt;(find &quot;$SYSSTAT_PATH&quot; -name &quot;sa[0-9]*&quot; || true)
411
412 # DON'T fail build if script fails.
413 exit 0
414 </command>
415         </hudson.tasks.Shell>
416         <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
417           <managedFiles>
418             <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
419               <fileId>jenkins-log-archives-settings</fileId>
420               <targetLocation/>
421               <variable>SETTINGS_FILE</variable>
422             </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
423           </managedFiles>
424         </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
425         <EnvInjectBuilder>
426           <info>
427             <propertiesContent>SERVER_ID=logs</propertiesContent>
428           </info>
429         </EnvInjectBuilder>
430         <hudson.tasks.Shell>
431           <command>#!/bin/bash
432 # SPDX-License-Identifier: EPL-1.0
433 ##############################################################################
434 # Copyright (c) 2017 The Linux Foundation and others.
435 #
436 # All rights reserved. This program and the accompanying materials
437 # are made available under the terms of the Eclipse Public License v1.0
438 # which accompanies this distribution, and is available at
439 # http://www.eclipse.org/legal/epl-v10.html
440 ##############################################################################
441 echo &quot;---&gt; create-netrc.sh&quot;
442
443 # Ensure we fail the job if any steps fail.
444 set -eu -o pipefail
445
446 NEXUS_URL=&quot;${NEXUSPROXY:-$NEXUS_URL}&quot;
447 CREDENTIAL=$(xmlstarlet sel -N &quot;x=http://maven.apache.org/SETTINGS/1.0.0&quot; \
448     -t -m &quot;/x:settings/x:servers/x:server[x:id='${SERVER_ID}']&quot; \
449     -v x:username -o &quot;:&quot; -v x:password \
450     &quot;$SETTINGS_FILE&quot;)
451
452 machine=$(echo &quot;$NEXUS_URL&quot; | awk -F/ '{print $3}')
453 user=$(echo &quot;$CREDENTIAL&quot; | cut -f1 -d:)
454 pass=$(echo &quot;$CREDENTIAL&quot; | cut -f2 -d:)
455
456 echo &quot;machine ${machine%:*} login $user password $pass&quot; &gt; ~/.netrc
457 </command>
458         </hudson.tasks.Shell>
459         <hudson.tasks.Shell>
460           <command>#!/bin/bash
461 # SPDX-License-Identifier: EPL-1.0
462 ##############################################################################
463 # Copyright (c) 2017 The Linux Foundation and others.
464 #
465 # All rights reserved. This program and the accompanying materials
466 # are made available under the terms of the Eclipse Public License v1.0
467 # which accompanies this distribution, and is available at
468 # http://www.eclipse.org/legal/epl-v10.html
469 ##############################################################################
470 echo &quot;---&gt; lftools-install.sh&quot;
471
472 # Script to install lftools via a version passed in via lf-infra-parameters
473 #
474 # Required parameters:
475 #
476 #     LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
477 #                      set to a strict version number like '1.2.3' or using
478 #                      PEP-440 definitions.
479 #
480 #                      Examples:
481 #                          &lt;1.0.0
482 #                          &gt;=1.0.0,&lt;2.0.0
483 #
484 # By default a released version of lftools should always be used.
485 # The purpose of the 2 variables below is so that lftools devs can test
486 # unreleased versions of lftools. There are 2 methods to install a dev version
487 # of lftools:
488 #
489 #     1) gerrit patch: Used to test a patch that has not yet been merged.
490 #                      To do this set something like this:
491 #                          LFTOOLS_MODE=gerrit
492 #                          LFTOOLS_REFSPEC=refs/changes/96/5296/7
493 #
494 #     2) git branch: Used to install an lftools version from a specific branch.
495 #                    To use this set the variables as follows:
496 #                          LFTOOLS_MODE=git
497 #                          LFTOOLS_REFSPEC=master
498 #
499 #     3) release : The intended use case and default setting.
500 #                  Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
501
502 LFTOOLS_MODE=release  # release | git | gerrit
503 LFTOOLS_REFSPEC=master
504
505 # Ensure we fail the job if any steps fail.
506 # DO NOT set -u as virtualenv's activate script has unbound variables
507 set -e -o pipefail
508
509 virtualenv --quiet &quot;/tmp/v/lftools&quot;
510 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
511 source &quot;/tmp/v/lftools/bin/activate&quot;
512 pip install --quiet --upgrade pip
513
514 case $LFTOOLS_MODE in
515     gerrit)
516         git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
517         pushd /tmp/lftools
518         git fetch origin &quot;$LFTOOLS_REFSPEC&quot;
519         git checkout FETCH_HEAD
520         pip install --quiet --upgrade -r requirements.txt
521         pip install --quiet --upgrade -e .
522         popd
523         ;;
524
525     git)
526         pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@&quot;$BRANCH&quot;
527         ;;
528
529     release)
530         if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
531             LFTOOLS_VERSION=&quot;==$LFTOOLS_VERSION&quot;
532         fi
533
534         pip install --quiet --upgrade &quot;lftools${LFTOOLS_VERSION}&quot;
535         ;;
536 esac
537
538 lftools --version
539
540 # pipdeptree prints out a lot of information because lftools pulls in many
541 # dependencies. Let's only print it if we want to debug.
542 # echo &quot;----&gt; Pip Dependency Tree&quot;
543 # pip install --quiet --upgrade pipdeptree
544 # pipdeptree
545
546 #!/bin/bash
547 # SPDX-License-Identifier: EPL-1.0
548 ##############################################################################
549 # Copyright (c) 2017 The Linux Foundation and others.
550 #
551 # All rights reserved. This program and the accompanying materials
552 # are made available under the terms of the Eclipse Public License v1.0
553 # which accompanies this distribution, and is available at
554 # http://www.eclipse.org/legal/epl-v10.html
555 ##############################################################################
556 echo &quot;---&gt; logs-deploy.sh&quot;
557
558 # Ensure we fail the job if any steps fail.
559 set -eu -o pipefail
560
561 set -x  # Trace commands for this script to make debugging easier.
562
563 ARCHIVE_ARTIFACTS=&quot;${ARCHIVE_ARTIFACTS:-}&quot;
564 LOGS_SERVER=&quot;${LOGS_SERVER:-None}&quot;
565
566 if [ &quot;${LOGS_SERVER}&quot; == 'None' ]
567 then
568     set +x # Disable trace since we no longer need it
569
570     echo &quot;WARNING: Logging server not set&quot;
571 else
572     NEXUS_URL=&quot;${NEXUSPROXY:-$NEXUS_URL}&quot;
573     NEXUS_PATH=&quot;${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}&quot;
574     BUILD_URL=&quot;${BUILD_URL}&quot;
575
576     lftools deploy archives -p &quot;$ARCHIVE_ARTIFACTS&quot; &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$WORKSPACE&quot;
577     lftools deploy logs &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$BUILD_URL&quot;
578
579     set +x  # Disable trace since we no longer need it.
580
581     echo &quot;Build logs: &lt;a href=\&quot;$LOGS_SERVER/$NEXUS_PATH\&quot;&gt;$LOGS_SERVER/$NEXUS_PATH&lt;/a&gt;&quot;
582 fi
583 </command>
584         </hudson.tasks.Shell>
585         <hudson.tasks.Shell>
586           <command>#!/bin/bash
587 # SPDX-License-Identifier: EPL-1.0
588 ##############################################################################
589 # Copyright (c) 2017 The Linux Foundation and others.
590 #
591 # All rights reserved. This program and the accompanying materials
592 # are made available under the terms of the Eclipse Public License v1.0
593 # which accompanies this distribution, and is available at
594 # http://www.eclipse.org/legal/epl-v10.html
595 ##############################################################################
596
597 # Clear log credential files
598 rm &quot;$SETTINGS_FILE&quot;
599 rm ~/.netrc
600 </command>
601         </hudson.tasks.Shell>
602         <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
603           <regexp>^Build logs: .*</regexp>
604         </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
605       </buildSteps>
606       <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
607       <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
608       <markBuildUnstable>false</markBuildUnstable>
609     </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
610     <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
611       <patterns>
612         <hudson.plugins.ws__cleanup.Pattern>
613           <pattern>**/*.jenkins-trigger</pattern>
614           <type>EXCLUDE</type>
615         </hudson.plugins.ws__cleanup.Pattern>
616       </patterns>
617       <deleteDirs>false</deleteDirs>
618       <cleanupMatrixParent>false</cleanupMatrixParent>
619       <externalDelete/>
620       <cleanWhenSuccess>true</cleanWhenSuccess>
621       <cleanWhenUnstable>true</cleanWhenUnstable>
622       <cleanWhenFailure>true</cleanWhenFailure>
623       <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
624       <cleanWhenAborted>true</cleanWhenAborted>
625       <notFailBuild>true</notFailBuild>
626     </hudson.plugins.ws__cleanup.WsCleanup>
627   </publishers>
628   <buildWrappers>
629     <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
630     <hudson.plugins.build__timeout.BuildTimeoutWrapper>
631       <timeoutMinutes>10</timeoutMinutes>
632       <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
633       <failBuild>true</failBuild>
634       <writingDescription>false</writingDescription>
635       <timeoutPercentage>0</timeoutPercentage>
636       <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
637       <timeoutType>absolute</timeoutType>
638     </hudson.plugins.build__timeout.BuildTimeoutWrapper>
639     <hudson.plugins.timestamper.TimestamperBuildWrapper/>
640     <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
641       <user>test-credential</user>
642     </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
643     <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
644     <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
645       <managedFiles>
646         <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
647           <fileId>npmrc</fileId>
648           <targetLocation>$HOME/.npmrc</targetLocation>
649           <variable/>
650         </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
651       </managedFiles>
652     </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
653   </buildWrappers>
654 </project>