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