18976d10ebe5c77fd72d33322efdbac5a1f895ec
[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     <EnvInjectBuilder>
278       <info>
279         <propertiesContent>PYTHON_VERSION=python3</propertiesContent>
280       </info>
281     </EnvInjectBuilder>
282     <hudson.tasks.Shell>
283       <command>#!/bin/bash
284 # SPDX-License-Identifier: EPL-1.0
285 ##############################################################################
286 # Copyright (c) 2017 The Linux Foundation and others.
287 #
288 # All rights reserved. This program and the accompanying materials
289 # are made available under the terms of the Eclipse Public License v1.0
290 # which accompanies this distribution, and is available at
291 # http://www.eclipse.org/legal/epl-v10.html
292 ##############################################################################
293 echo &quot;---&gt; tox-install.sh&quot;
294
295 # Ensure we fail the job if any steps fail.
296 # DO NOT set -u as virtualenv's activate script has unbound variables
297 set -e -o pipefail
298
299 virtualenv --quiet -p &quot;$PYTHON_VERSION&quot; &quot;/tmp/v/tox&quot;
300 # shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
301 source &quot;/tmp/v/tox/bin/activate&quot;
302 pip install --quiet --upgrade pip
303 pip install --quiet --upgrade pipdeptree
304 pip install --quiet --upgrade argparse detox tox tox-pyenv
305
306 echo &quot;----&gt; Pip Dependency Tree&quot;
307 pipdeptree
308 </command>
309     </hudson.tasks.Shell>
310     <hudson.tasks.Shell>
311       <command>#!/bin/bash
312 # SPDX-License-Identifier: EPL-1.0
313 ##############################################################################
314 # Copyright (c) 2017 The Linux Foundation and others.
315 #
316 # All rights reserved. This program and the accompanying materials
317 # are made available under the terms of the Eclipse Public License v1.0
318 # which accompanies this distribution, and is available at
319 # http://www.eclipse.org/legal/epl-v10.html
320 ##############################################################################
321 echo &quot;---&gt; tox-run.sh&quot;
322
323 # shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
324 source &quot;/tmp/v/tox/bin/activate&quot;
325
326 # Ensure we fail the job if any steps fail.
327 # DO NOT set -u as virtualenv's activate script has unbound variables
328 set -e -o pipefail
329
330 ARCHIVE_TOX_DIR=&quot;$WORKSPACE/archives/tox&quot;
331 mkdir -p &quot;$ARCHIVE_TOX_DIR&quot;
332 cd &quot;$WORKSPACE/$TOX_DIR&quot;
333
334 if [ -d &quot;/opt/pyenv&quot; ]; then
335     echo &quot;---&gt; Setting up pyenv&quot;
336     export PYENV_ROOT=&quot;/opt/pyenv&quot;
337     export PATH=&quot;$PYENV_ROOT/bin:$PATH&quot;
338 fi
339
340 set +e  # Allow detox to fail so that we can collect the logs in the next step
341 if [ ! -z &quot;$TOX_ENVS&quot; ]; then
342     detox -e &quot;$TOX_ENVS&quot;  | tee -a &quot;$ARCHIVE_TOX_DIR/detox.log&quot;
343     detox_status=&quot;${PIPESTATUS[0]}&quot;
344 else
345     detox | tee -a &quot;$ARCHIVE_TOX_DIR/detox.log&quot;
346     detox_status=&quot;${PIPESTATUS[0]}&quot;
347 fi
348
349 # Disable SC2116 as we want to echo a space separated list of TOX_ENVS
350 # shellcheck disable=SC2116
351 for i in .tox/*/log; do
352     tox_env=$(echo $i | awk -F'/' '{print $2}')
353     cp -r &quot;$i&quot; &quot;$ARCHIVE_TOX_DIR/$tox_env&quot;
354 done
355 set -e  # Logs collected so re-enable
356
357 echo &quot;Completed tox runs.&quot;
358
359 test &quot;$detox_status&quot; -eq 0 || exit &quot;$detox_status&quot;
360 </command>
361     </hudson.tasks.Shell>
362   </builders>
363   <publishers>
364     <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
365       <buildSteps>
366         <hudson.tasks.Shell>
367           <command>#!/bin/bash
368 # SPDX-License-Identifier: EPL-1.0
369 ##############################################################################
370 # Copyright (c) 2017 The Linux Foundation and others.
371 #
372 # All rights reserved. This program and the accompanying materials
373 # are made available under the terms of the Eclipse Public License v1.0
374 # which accompanies this distribution, and is available at
375 # http://www.eclipse.org/legal/epl-v10.html
376 ##############################################################################
377 echo &quot;---&gt; sysstat.sh&quot;
378 set +e  # DON'T fail build if script fails.
379
380 OS=$(facter operatingsystem)
381 case &quot;$OS&quot; in
382     Ubuntu)
383         SYSSTAT_PATH=&quot;/var/log/sysstat&quot;
384
385         # Dont run the script when systat is not enabled by default
386         if ! grep --quiet 'ENABLED=&quot;true&quot;' &quot;/etc/default/sysstat&quot;; then
387             exit 0
388         fi
389     ;;
390     CentOS|RedHat)
391         SYSSTAT_PATH=&quot;/var/log/sa&quot;
392     ;;
393     *)
394         # nothing to do
395         exit 0
396     ;;
397 esac
398
399 SAR_DIR=&quot;$WORKSPACE/archives/sar-reports&quot;
400 mkdir -p &quot;$SAR_DIR&quot;
401 cp &quot;$SYSSTAT_PATH/&quot;* &quot;$_&quot;
402 # convert sar data to ascii format
403 while IFS=&quot;&quot; read -r sarfilenum
404 do
405     [ -f &quot;$sarfilenum&quot; ] &amp;&amp; LC_TIME=POSIX sar -A -f &quot;$sarfilenum&quot; &gt; &quot;$SAR_DIR/sar${sarfilenum//[!0-9]/}&quot;
406 done &lt; &lt;(find &quot;$SYSSTAT_PATH&quot; -name &quot;sa[0-9]*&quot; || true)
407
408 # DON'T fail build if script fails.
409 exit 0
410 </command>
411         </hudson.tasks.Shell>
412         <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
413           <managedFiles>
414             <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
415               <fileId>jenkins-log-archives-settings</fileId>
416               <targetLocation/>
417               <variable>SETTINGS_FILE</variable>
418             </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
419           </managedFiles>
420         </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
421         <EnvInjectBuilder>
422           <info>
423             <propertiesContent>SERVER_ID=logs</propertiesContent>
424           </info>
425         </EnvInjectBuilder>
426         <hudson.tasks.Shell>
427           <command>#!/bin/bash
428 # SPDX-License-Identifier: EPL-1.0
429 ##############################################################################
430 # Copyright (c) 2017 The Linux Foundation and others.
431 #
432 # All rights reserved. This program and the accompanying materials
433 # are made available under the terms of the Eclipse Public License v1.0
434 # which accompanies this distribution, and is available at
435 # http://www.eclipse.org/legal/epl-v10.html
436 ##############################################################################
437 echo &quot;---&gt; create-netrc.sh&quot;
438
439 # Ensure we fail the job if any steps fail.
440 set -eu -o pipefail
441
442 NEXUS_URL=&quot;${NEXUSPROXY:-$NEXUS_URL}&quot;
443 CREDENTIAL=$(xmlstarlet sel -N &quot;x=http://maven.apache.org/SETTINGS/1.0.0&quot; \
444     -t -m &quot;/x:settings/x:servers/x:server[x:id='${SERVER_ID}']&quot; \
445     -v x:username -o &quot;:&quot; -v x:password \
446     &quot;$SETTINGS_FILE&quot;)
447
448 machine=$(echo &quot;$NEXUS_URL&quot; | awk -F/ '{print $3}')
449 user=$(echo &quot;$CREDENTIAL&quot; | cut -f1 -d:)
450 pass=$(echo &quot;$CREDENTIAL&quot; | cut -f2 -d:)
451
452 echo &quot;machine ${machine%:*} login $user password $pass&quot; &gt; ~/.netrc
453 </command>
454         </hudson.tasks.Shell>
455         <hudson.tasks.Shell>
456           <command>#!/bin/bash
457 # SPDX-License-Identifier: EPL-1.0
458 ##############################################################################
459 # Copyright (c) 2017 The Linux Foundation and others.
460 #
461 # All rights reserved. This program and the accompanying materials
462 # are made available under the terms of the Eclipse Public License v1.0
463 # which accompanies this distribution, and is available at
464 # http://www.eclipse.org/legal/epl-v10.html
465 ##############################################################################
466 echo &quot;---&gt; lftools-install.sh&quot;
467
468 # Script to install lftools via a version passed in via lf-infra-parameters
469 #
470 # Required parameters:
471 #
472 #     LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
473 #                      set to a strict version number like '1.2.3' or using
474 #                      PEP-440 definitions.
475 #
476 #                      Examples:
477 #                          &lt;1.0.0
478 #                          &gt;=1.0.0,&lt;2.0.0
479 #
480 # By default a released version of lftools should always be used.
481 # The purpose of the 2 variables below is so that lftools devs can test
482 # unreleased versions of lftools. There are 2 methods to install a dev version
483 # of lftools:
484 #
485 #     1) gerrit patch: Used to test a patch that has not yet been merged.
486 #                      To do this set something like this:
487 #                          LFTOOLS_MODE=gerrit
488 #                          LFTOOLS_REFSPEC=refs/changes/96/5296/7
489 #
490 #     2) git branch: Used to install an lftools version from a specific branch.
491 #                    To use this set the variables as follows:
492 #                          LFTOOLS_MODE=git
493 #                          LFTOOLS_REFSPEC=master
494 #
495 #     3) release : The intended use case and default setting.
496 #                  Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
497
498 LFTOOLS_MODE=release  # release | git | gerrit
499 LFTOOLS_REFSPEC=master
500
501 # Ensure we fail the job if any steps fail.
502 # DO NOT set -u as virtualenv's activate script has unbound variables
503 set -e -o pipefail
504
505 virtualenv --quiet &quot;/tmp/v/lftools&quot;
506 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
507 source &quot;/tmp/v/lftools/bin/activate&quot;
508 pip install --quiet --upgrade pip
509
510 case $LFTOOLS_MODE in
511     gerrit)
512         git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
513         pushd /tmp/lftools
514         git fetch origin &quot;$LFTOOLS_REFSPEC&quot;
515         git checkout FETCH_HEAD
516         pip install --quiet --upgrade -r requirements.txt
517         pip install --quiet --upgrade -e .
518         popd
519         ;;
520
521     git)
522         pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@&quot;$BRANCH&quot;
523         ;;
524
525     release)
526         if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
527             LFTOOLS_VERSION=&quot;==$LFTOOLS_VERSION&quot;
528         fi
529
530         pip install --quiet --upgrade &quot;lftools${LFTOOLS_VERSION}&quot;
531         ;;
532 esac
533
534 lftools --version
535
536 # pipdeptree prints out a lot of information because lftools pulls in many
537 # dependencies. Let's only print it if we want to debug.
538 # echo &quot;----&gt; Pip Dependency Tree&quot;
539 # pip install --quiet --upgrade pipdeptree
540 # pipdeptree
541
542 #!/bin/bash
543 # SPDX-License-Identifier: EPL-1.0
544 ##############################################################################
545 # Copyright (c) 2017 The Linux Foundation and others.
546 #
547 # All rights reserved. This program and the accompanying materials
548 # are made available under the terms of the Eclipse Public License v1.0
549 # which accompanies this distribution, and is available at
550 # http://www.eclipse.org/legal/epl-v10.html
551 ##############################################################################
552 echo &quot;---&gt; logs-deploy.sh&quot;
553
554 # Ensure we fail the job if any steps fail.
555 set -eu -o pipefail
556
557 set -x  # Trace commands for this script to make debugging easier.
558
559 ARCHIVE_ARTIFACTS=&quot;${ARCHIVE_ARTIFACTS:-}&quot;
560 LOGS_SERVER=&quot;${LOGS_SERVER:-None}&quot;
561
562 if [ &quot;${LOGS_SERVER}&quot; == 'None' ]
563 then
564     set +x # Disable trace since we no longer need it
565
566     echo &quot;WARNING: Logging server not set&quot;
567 else
568     NEXUS_URL=&quot;${NEXUSPROXY:-$NEXUS_URL}&quot;
569     NEXUS_PATH=&quot;${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}&quot;
570     BUILD_URL=&quot;${BUILD_URL}&quot;
571
572     lftools deploy archives -p &quot;$ARCHIVE_ARTIFACTS&quot; &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$WORKSPACE&quot;
573     lftools deploy logs &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$BUILD_URL&quot;
574
575     set +x  # Disable trace since we no longer need it.
576
577     echo &quot;Build logs: &lt;a href=\&quot;$LOGS_SERVER/$NEXUS_PATH\&quot;&gt;$LOGS_SERVER/$NEXUS_PATH&lt;/a&gt;&quot;
578 fi
579 </command>
580         </hudson.tasks.Shell>
581         <hudson.tasks.Shell>
582           <command>#!/bin/bash
583 # SPDX-License-Identifier: EPL-1.0
584 ##############################################################################
585 # Copyright (c) 2017 The Linux Foundation and others.
586 #
587 # All rights reserved. This program and the accompanying materials
588 # are made available under the terms of the Eclipse Public License v1.0
589 # which accompanies this distribution, and is available at
590 # http://www.eclipse.org/legal/epl-v10.html
591 ##############################################################################
592
593 # Clear log credential files
594 rm &quot;$SETTINGS_FILE&quot;
595 rm ~/.netrc
596 </command>
597         </hudson.tasks.Shell>
598         <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
599           <regexp>^Build logs: .*</regexp>
600         </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
601       </buildSteps>
602       <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
603       <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
604       <markBuildUnstable>false</markBuildUnstable>
605     </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
606     <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
607       <patterns>
608         <hudson.plugins.ws__cleanup.Pattern>
609           <pattern>**/*.jenkins-trigger</pattern>
610           <type>EXCLUDE</type>
611         </hudson.plugins.ws__cleanup.Pattern>
612       </patterns>
613       <deleteDirs>false</deleteDirs>
614       <cleanupMatrixParent>false</cleanupMatrixParent>
615       <externalDelete/>
616       <cleanWhenSuccess>true</cleanWhenSuccess>
617       <cleanWhenUnstable>true</cleanWhenUnstable>
618       <cleanWhenFailure>true</cleanWhenFailure>
619       <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
620       <cleanWhenAborted>true</cleanWhenAborted>
621       <notFailBuild>true</notFailBuild>
622     </hudson.plugins.ws__cleanup.WsCleanup>
623   </publishers>
624   <buildWrappers>
625     <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
626     <hudson.plugins.build__timeout.BuildTimeoutWrapper>
627       <timeoutMinutes>10</timeoutMinutes>
628       <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
629       <failBuild>true</failBuild>
630       <writingDescription>false</writingDescription>
631       <timeoutPercentage>0</timeoutPercentage>
632       <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
633       <timeoutType>absolute</timeoutType>
634     </hudson.plugins.build__timeout.BuildTimeoutWrapper>
635     <hudson.plugins.timestamper.TimestamperBuildWrapper/>
636     <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
637       <user>test-credential</user>
638     </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
639     <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
640     <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
641       <managedFiles>
642         <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
643           <fileId>npmrc</fileId>
644           <targetLocation>$HOME/.npmrc</targetLocation>
645           <variable/>
646         </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
647       </managedFiles>
648     </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
649   </buildWrappers>
650 </project>