Merge "Remove port from NEXUS_URL for netrc"
[releng/global-jjb.git] / .jjb-test / expected-xml / gerrit-maven-maven-verify-deps-master-mvn33-openjdk8
1 <?xml version="1.0" encoding="utf-8"?>
2 <project>
3   <jdk>openjdk8</jdk>
4   <actions/>
5   <description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
6   <keepDependencies>false</keepDependencies>
7   <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
8   <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
9   <concurrentBuild>true</concurrentBuild>
10   <assignedNode>build-vm</assignedNode>
11   <canRoam>false</canRoam>
12   <properties>
13     <jenkins.model.BuildDiscarderProperty>
14       <strategy class="hudson.tasks.LogRotator">
15         <daysToKeep>7</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>refs/heads/master</defaultValue>
67         </hudson.model.StringParameterDefinition>
68         <hudson.model.StringParameterDefinition>
69           <name>LFTOOLS_VERSION</name>
70           <description>Version of lftools to install. Can be a specific version like
71 '0.6.0' or a PEP-440 definition.
72 https://www.python.org/dev/peps/pep-0440/
73 For example '&lt;1.0.0' or '&gt;=1.0.0,&lt;2.0.0'.
74 </description>
75           <defaultValue>&lt;1.0.0</defaultValue>
76         </hudson.model.StringParameterDefinition>
77         <hudson.model.StringParameterDefinition>
78           <name>M2_HOME</name>
79           <description>Maven selector to be used by shell scripts</description>
80           <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
81         </hudson.model.StringParameterDefinition>
82         <hudson.model.StringParameterDefinition>
83           <name>MAVEN_OPTS</name>
84           <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
85 </description>
86           <defaultValue/>
87         </hudson.model.StringParameterDefinition>
88         <hudson.model.StringParameterDefinition>
89           <name>MAVEN_PARAMS</name>
90           <description>Maven parameters to pass to the mvn command.
91 </description>
92           <defaultValue>-Dstream=$STREAM</defaultValue>
93         </hudson.model.StringParameterDefinition>
94         <hudson.model.StringParameterDefinition>
95           <name>MVN</name>
96           <description>Maven selector to be used by shell scripts</description>
97           <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
98         </hudson.model.StringParameterDefinition>
99         <hudson.model.StringParameterDefinition>
100           <name>STAGING_PROFILE_ID</name>
101           <description>Nexus staging profile ID.
102 </description>
103           <defaultValue>uuddlrlrba</defaultValue>
104         </hudson.model.StringParameterDefinition>
105       </parameterDefinitions>
106     </hudson.model.ParametersDefinitionProperty>
107   </properties>
108   <scm class="hudson.plugins.git.GitSCM">
109     <configVersion>2</configVersion>
110     <userRemoteConfigs>
111       <hudson.plugins.git.UserRemoteConfig>
112         <name>origin</name>
113         <refspec>$GERRIT_REFSPEC</refspec>
114         <url>$GIT_URL/$PROJECT</url>
115         <credentialsId>test-credential</credentialsId>
116       </hudson.plugins.git.UserRemoteConfig>
117     </userRemoteConfigs>
118     <branches>
119       <hudson.plugins.git.BranchSpec>
120         <name>refs/heads/$GERRIT_BRANCH</name>
121       </hudson.plugins.git.BranchSpec>
122     </branches>
123     <excludedUsers/>
124     <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
125     <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
126     <authorOrCommitter>false</authorOrCommitter>
127     <wipeOutWorkspace>true</wipeOutWorkspace>
128     <pruneBranches>false</pruneBranches>
129     <remotePoll>false</remotePoll>
130     <gitTool>Default</gitTool>
131     <submoduleCfg class="list"/>
132     <relativeTargetDir/>
133     <reference/>
134     <gitConfigName/>
135     <gitConfigEmail/>
136     <skipTag>true</skipTag>
137     <scmName/>
138     <useShallowClone>false</useShallowClone>
139     <ignoreNotifyCommit>false</ignoreNotifyCommit>
140     <extensions>
141       <hudson.plugins.git.extensions.impl.SubmoduleOption>
142         <disableSubmodules>false</disableSubmodules>
143         <recursiveSubmodules>true</recursiveSubmodules>
144         <trackingSubmodules>false</trackingSubmodules>
145         <reference/>
146         <timeout>10</timeout>
147       </hudson.plugins.git.extensions.impl.SubmoduleOption>
148       <hudson.plugins.git.extensions.impl.WipeWorkspace/>
149     </extensions>
150   </scm>
151   <triggers class="vector">
152     <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
153       <spec/>
154       <gerritProjects>
155         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
156           <compareType>ANT</compareType>
157           <pattern>releng/ciman</pattern>
158           <branches>
159             <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
160               <compareType>ANT</compareType>
161               <pattern>**/master</pattern>
162             </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
163           </branches>
164           <filePaths>
165             <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
166               <compareType>ANT</compareType>
167               <pattern>**</pattern>
168             </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
169           </filePaths>
170           <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
171         </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
172       </gerritProjects>
173       <skipVote>
174         <onSuccessful>false</onSuccessful>
175         <onFailed>false</onFailed>
176         <onUnstable>false</onUnstable>
177         <onNotBuilt>false</onNotBuilt>
178       </skipVote>
179       <silentMode>false</silentMode>
180       <silentStartMode>false</silentStartMode>
181       <escapeQuotes>true</escapeQuotes>
182       <noNameAndEmailParameters>false</noNameAndEmailParameters>
183       <readableMessage>false</readableMessage>
184       <dependencyJobsNames/>
185       <notificationLevel/>
186       <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
187       <triggerConfigURL/>
188       <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
189       <triggerOnEvents>
190         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
191           <commentAddedCommentContains>recheck: [0-9 ]+</commentAddedCommentContains>
192         </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
193       </triggerOnEvents>
194       <buildStartMessage/>
195       <buildFailureMessage/>
196       <buildSuccessfulMessage/>
197       <buildUnstableMessage/>
198       <buildNotBuiltMessage/>
199       <buildUnsuccessfulFilepath/>
200       <customUrl/>
201       <serverName>test-server</serverName>
202     </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
203   </triggers>
204   <builders>
205     <hudson.tasks.Shell>
206       <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
207     </hudson.tasks.Shell>
208     <hudson.tasks.Shell>
209       <command>echo &quot;quiet=on&quot; &gt; &quot;$HOME/.wgetrc&quot;</command>
210     </hudson.tasks.Shell>
211     <hudson.tasks.Maven>
212       <targets>--version</targets>
213       <properties/>
214       <mavenName>mvn33</mavenName>
215       <usePrivateRepository>false</usePrivateRepository>
216       <settings class="jenkins.mvn.DefaultSettingsProvider"/>
217       <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
218     </hudson.tasks.Maven>
219     <hudson.tasks.Shell>
220       <command>rm &quot;$HOME/.wgetrc&quot;</command>
221     </hudson.tasks.Shell>
222     <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
223       <managedFiles>
224         <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
225           <fileId>global-settings</fileId>
226           <targetLocation/>
227           <variable>GLOBAL_SETTINGS_FILE</variable>
228         </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
229         <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
230           <fileId>gerrit-maven-project-settings</fileId>
231           <targetLocation/>
232           <variable>SETTINGS_FILE</variable>
233         </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
234       </managedFiles>
235     </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
236     <hudson.tasks.Shell>
237       <command>#!/bin/bash
238 # SPDX-License-Identifier: EPL-1.0
239 ##############################################################################
240 # Copyright (c) 2017 The Linux Foundation and others.
241 #
242 # All rights reserved. This program and the accompanying materials
243 # are made available under the terms of the Eclipse Public License v1.0
244 # which accompanies this distribution, and is available at
245 # http://www.eclipse.org/legal/epl-v10.html
246 ##############################################################################
247 # Fetches patches all projects provided by comment trigger
248 #
249 # Takes a list of Gerrit patches and fetches all projects and cherry-pick
250 # patches for projects. The trigger is
251 #     'recheck: SPACE_SEPERATED_LIST_OF_PATCHES'
252 #
253 # NOTE: This script assumes the user will provide the correct dependency order
254 #       via the PATCHES list.
255
256 # Ensure we fail the job if any steps fail.
257 set -eu -o pipefail
258
259 REPOS_DIR=&quot;$WORKSPACE/.repos&quot;
260
261 PATCHES=($(echo &quot;$GERRIT_EVENT_COMMENT_TEXT&quot; | grep 'recheck:' | awk -F: '{print $2}'))
262
263 projects=()
264 for patch in $(echo &quot;${PATCHES[@]}&quot;); do
265     json=$(curl -s &quot;$GERRIT_URL/changes/$patch&quot; | sed -e &quot;s/)]}'//&quot;)
266     project=$(echo &quot;$json&quot; | jq -r '.project')
267     branch=$(echo &quot;$json&quot; | jq -r '.branch')
268
269     if [ ! -d &quot;$REPOS_DIR/$project&quot; ]; then
270         git clone -q --depth 1 -b &quot;$branch&quot; &quot;$GIT_URL/$project&quot; &quot;$REPOS_DIR/$project&quot;
271
272         # This array will be used later to determine project build order.
273         projects+=(&quot;$project&quot;)
274     fi
275
276     pushd &quot;$REPOS_DIR/$project&quot;
277     git remote add gerrit &quot;$GIT_URL/$project&quot;
278     git review --cherrypick=&quot;$patch&quot;
279     popd
280 done
281
282 # This script should be a macro which re-inject's the projects variable back
283 # into the build so a script later on can use it.
284 echo &quot;DEPENDENCY_BUILD_ORDER=${projects[*]}&quot; &gt; &quot;$WORKSPACE/.dependency.properties&quot;
285 </command>
286     </hudson.tasks.Shell>
287     <EnvInjectBuilder>
288       <info>
289         <propertiesFilePath>$WORKSPACE/.dependency.properties</propertiesFilePath>
290       </info>
291     </EnvInjectBuilder>
292     <hudson.tasks.Shell>
293       <command>#!/bin/bash
294 # SPDX-License-Identifier: EPL-1.0
295 ##############################################################################
296 # Copyright (c) 2017 The Linux Foundation and others.
297 #
298 # All rights reserved. This program and the accompanying materials
299 # are made available under the terms of the Eclipse Public License v1.0
300 # which accompanies this distribution, and is available at
301 # http://www.eclipse.org/legal/epl-v10.html
302 ##############################################################################
303
304 # This file contains a list of variables that are generally useful in many
305 # scripts. It is meant to be sourced in other scripts so that the variables can
306 # be called.
307
308 MAVEN_OPTIONS=&quot;$(echo --show-version \
309     --batch-mode \
310     -Djenkins \
311     -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
312     -Dmaven.repo.local=/tmp/r \
313     -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)&quot;
314 echo &quot;$MAVEN_OPTIONS&quot;
315
316 #!/bin/bash
317 # SPDX-License-Identifier: EPL-1.0
318 ##############################################################################
319 # Copyright (c) 2017 The Linux Foundation and others.
320 #
321 # All rights reserved. This program and the accompanying materials
322 # are made available under the terms of the Eclipse Public License v1.0
323 # which accompanies this distribution, and is available at
324 # http://www.eclipse.org/legal/epl-v10.html
325 ##############################################################################
326
327 # Builds projects provided via $DEPENDENCY_BUILD_ORDER list
328 #
329 # This runs a `mvn clean install` against all projects provided by a list. This
330 # script is a companion script for the gerrit-fetch-dependencies script which
331 # clones project repos to &quot;$WORKSPACE/.repos&quot;.
332
333 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
334 # Ensure we fail the job if any steps fail.
335 set -e -o pipefail
336 set +u
337
338 PROJECTS=($(echo &quot;$DEPENDENCY_BUILD_ORDER&quot;))
339 REPOS_DIR=&quot;$WORKSPACE/.repos&quot;
340
341 export MAVEN_OPTS
342
343 for project in &quot;${PROJECTS[@]}&quot;; do
344     pushd &quot;$REPOS_DIR/$project&quot;
345     # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
346     # shellcheck disable=SC2086
347     $MVN clean install \
348         -Pq \
349         -DskipTests=true \
350         --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
351         --settings &quot;$SETTINGS_FILE&quot; \
352         $MAVEN_PARAMS $MAVEN_OPTIONS
353     popd
354 done
355 </command>
356     </hudson.tasks.Shell>
357     <hudson.tasks.Shell>
358       <command>#!/bin/bash
359 # SPDX-License-Identifier: EPL-1.0
360 ##############################################################################
361 # Copyright (c) 2017 The Linux Foundation and others.
362 #
363 # All rights reserved. This program and the accompanying materials
364 # are made available under the terms of the Eclipse Public License v1.0
365 # which accompanies this distribution, and is available at
366 # http://www.eclipse.org/legal/epl-v10.html
367 ##############################################################################
368
369 # This file contains a list of variables that are generally useful in many
370 # scripts. It is meant to be sourced in other scripts so that the variables can
371 # be called.
372
373 MAVEN_OPTIONS=&quot;$(echo --show-version \
374     --batch-mode \
375     -Djenkins \
376     -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
377     -Dmaven.repo.local=/tmp/r \
378     -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)&quot;
379 echo &quot;$MAVEN_OPTIONS&quot;
380
381 #!/bin/bash
382 # SPDX-License-Identifier: EPL-1.0
383 ##############################################################################
384 # Copyright (c) 2017 The Linux Foundation and others.
385 #
386 # All rights reserved. This program and the accompanying materials
387 # are made available under the terms of the Eclipse Public License v1.0
388 # which accompanies this distribution, and is available at
389 # http://www.eclipse.org/legal/epl-v10.html
390 ##############################################################################
391
392 # This script builds a Maven project and deploys it into a staging repo which
393 # can be used to deploy elsewhere later eg. Nexus staging / snapshot repos.
394
395 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
396 # Ensure we fail the job if any steps fail.
397 set -e -o pipefail
398 set +u
399
400 export MAVEN_OPTS
401
402 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
403 # shellcheck disable=SC2086
404 $MVN clean deploy \
405     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
406     --settings &quot;$SETTINGS_FILE&quot; \
407     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
408     $MAVEN_PARAMS $MAVEN_OPTIONS
409 </command>
410     </hudson.tasks.Shell>
411     <hudson.tasks.Shell>
412       <command>#!/bin/bash
413 set +e  # DO NOT cause build failure if any of the rm calls fail.
414
415 rm &quot;$GLOBAL_SETTINGS_FILE&quot; &quot;$SETTINGS_FILE&quot;
416
417 # In some cases we use the lf-provide-maven-settings macro to produce
418 # a &quot;$HOME/.netrc&quot; file containing credentials. Remove that file here
419 # too if it exists.
420 rm &quot;$HOME/.netrc&quot;
421
422 # DO NOT fail build if any of the above lines fail.
423 exit 0
424 </command>
425     </hudson.tasks.Shell>
426   </builders>
427   <publishers>
428     <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs">
429       <isRankActivated>false</isRankActivated>
430       <includePattern/>
431       <excludePattern/>
432       <healthy/>
433       <unHealthy/>
434       <thresholdLimit>low</thresholdLimit>
435       <pluginName>[FINDBUGS] </pluginName>
436       <defaultEncoding/>
437       <canRunOnFailed>false</canRunOnFailed>
438       <useStableBuildAsReference>false</useStableBuildAsReference>
439       <usePreviousBuildAsReference>false</usePreviousBuildAsReference>
440       <useDeltaValues>false</useDeltaValues>
441       <thresholds>
442         <unstableTotalAll/>
443         <unstableTotalHigh/>
444         <unstableTotalNormal/>
445         <unstableTotalLow/>
446         <failedTotalAll/>
447         <failedTotalHigh/>
448         <failedTotalNormal/>
449         <failedTotalLow/>
450       </thresholds>
451       <shouldDetectModules>false</shouldDetectModules>
452       <dontComputeNew>true</dontComputeNew>
453       <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
454       <pattern/>
455     </hudson.plugins.findbugs.FindBugsPublisher>
456     <hudson.plugins.jacoco.JacocoPublisher>
457       <execPattern>**/**.exec</execPattern>
458       <classPattern>**/classes</classPattern>
459       <sourcePattern>**/src/main/java</sourcePattern>
460       <changeBuildStatus/>
461       <inclusionPattern/>
462       <exclusionPattern>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</exclusionPattern>
463       <maximumBranchCoverage>10</maximumBranchCoverage>
464       <minimumBranchCoverage>20</minimumBranchCoverage>
465       <maximumMethodCoverage>50</maximumMethodCoverage>
466       <minimumMethodCoverage>40</minimumMethodCoverage>
467     </hudson.plugins.jacoco.JacocoPublisher>
468     <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
469       <buildSteps>
470         <hudson.tasks.Shell>
471           <command>#!/bin/bash
472 # SPDX-License-Identifier: EPL-1.0
473 ##############################################################################
474 # Copyright (c) 2017 The Linux Foundation and others.
475 #
476 # All rights reserved. This program and the accompanying materials
477 # are made available under the terms of the Eclipse Public License v1.0
478 # which accompanies this distribution, and is available at
479 # http://www.eclipse.org/legal/epl-v10.html
480 ##############################################################################
481 echo &quot;---&gt; sysstat.sh&quot;
482 set +e  # DON'T fail build if script fails.
483
484 OS=$(facter operatingsystem)
485 case &quot;$OS&quot; in
486     Ubuntu)
487         SYSSTAT_PATH=&quot;/var/log/sysstat&quot;
488
489         # Dont run the script when systat is not enabled by default
490         if ! grep --quiet 'ENABLED=&quot;true&quot;' &quot;/etc/default/sysstat&quot;; then
491             exit 0
492         fi
493     ;;
494     CentOS|RedHat)
495         SYSSTAT_PATH=&quot;/var/log/sa&quot;
496     ;;
497     *)
498         # nothing to do
499         exit 0
500     ;;
501 esac
502
503 SAR_DIR=&quot;$WORKSPACE/archives/sar-reports&quot;
504 mkdir -p &quot;$SAR_DIR&quot;
505 cp &quot;$SYSSTAT_PATH/&quot;* &quot;$_&quot;
506 # convert sar data to ascii format
507 while IFS=&quot;&quot; read -r s
508 do
509     [ -f &quot;$s&quot; ] &amp;&amp; LC_TIME=POSIX sar -A -f &quot;$s&quot; &gt; &quot;$SAR_DIR/sar${s//[!0-9]/}&quot;
510 done &lt; &lt;(find &quot;$SYSSTAT_PATH&quot; -name &quot;sa[0-9]*&quot; || true)
511
512 # DON'T fail build if script fails.
513 exit 0
514 </command>
515         </hudson.tasks.Shell>
516         <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
517           <managedFiles>
518             <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
519               <fileId>jenkins-log-archives-settings</fileId>
520               <targetLocation/>
521               <variable>SETTINGS_FILE</variable>
522             </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
523           </managedFiles>
524         </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
525         <EnvInjectBuilder>
526           <info>
527             <propertiesContent>SERVER_ID=logs</propertiesContent>
528           </info>
529         </EnvInjectBuilder>
530         <hudson.tasks.Shell>
531           <command>#!/bin/bash
532 # SPDX-License-Identifier: EPL-1.0
533 ##############################################################################
534 # Copyright (c) 2017 The Linux Foundation and others.
535 #
536 # All rights reserved. This program and the accompanying materials
537 # are made available under the terms of the Eclipse Public License v1.0
538 # which accompanies this distribution, and is available at
539 # http://www.eclipse.org/legal/epl-v10.html
540 ##############################################################################
541 echo &quot;---&gt; create-netrc.sh&quot;
542
543 # Ensure we fail the job if any steps fail.
544 set -eu -o pipefail
545
546 NEXUS_URL=&quot;${NEXUSPROXY:-$NEXUS_URL}&quot;
547 CREDENTIAL=$(xmlstarlet sel -N &quot;x=http://maven.apache.org/SETTINGS/1.0.0&quot; \
548     -t -m &quot;/x:settings/x:servers/x:server[x:id='${SERVER_ID}']&quot; \
549     -v x:username -o &quot;:&quot; -v x:password \
550     &quot;$SETTINGS_FILE&quot;)
551
552 machine=$(echo &quot;$NEXUS_URL&quot; | awk -F/ '{print $3}')
553 user=$(echo &quot;$CREDENTIAL&quot; | cut -f1 -d:)
554 pass=$(echo &quot;$CREDENTIAL&quot; | cut -f2 -d:)
555
556 echo &quot;machine ${machine%:*} login $user password $pass&quot; &gt; ~/.netrc
557 </command>
558         </hudson.tasks.Shell>
559         <hudson.tasks.Shell>
560           <command>#!/bin/bash
561 # SPDX-License-Identifier: EPL-1.0
562 ##############################################################################
563 # Copyright (c) 2017 The Linux Foundation and others.
564 #
565 # All rights reserved. This program and the accompanying materials
566 # are made available under the terms of the Eclipse Public License v1.0
567 # which accompanies this distribution, and is available at
568 # http://www.eclipse.org/legal/epl-v10.html
569 ##############################################################################
570 echo &quot;---&gt; lftools-install.sh&quot;
571
572 # Script to install lftools via a version passed in via lf-infra-parameters
573 #
574 # Required parameters:
575 #
576 #     LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
577 #                      set to a strict version number like '1.2.3' or using
578 #                      PEP-440 definitions.
579 #
580 #                      Examples:
581 #                          &lt;1.0.0
582 #                          &gt;=1.0.0,&lt;2.0.0
583 #
584 # By default a released version of lftools should always be used.
585 # The purpose of the 2 variables below is so that lftools devs can test
586 # unreleased versions of lftools. There are 2 methods to install a dev version
587 # of lftools:
588 #
589 #     1) gerrit patch: Used to test a patch that has not yet been merged.
590 #                      To do this set something like this:
591 #                          LFTOOLS_MODE=gerrit
592 #                          LFTOOLS_REFSPEC=refs/changes/96/5296/7
593 #
594 #     2) git branch: Used to install an lftools version from a specific branch.
595 #                    To use this set the variables as follows:
596 #                          LFTOOLS_MODE=git
597 #                          LFTOOLS_REFSPEC=master
598 #
599 #     3) release : The intended use case and default setting.
600 #                  Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
601
602 LFTOOLS_MODE=release  # release | git | gerrit
603 LFTOOLS_REFSPEC=master
604
605 # Ensure we fail the job if any steps fail.
606 # DO NOT set -u as virtualenv's activate script has unbound variables
607 set -e -o pipefail
608
609 virtualenv --quiet &quot;/tmp/v/lftools&quot;
610 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
611 source &quot;/tmp/v/lftools/bin/activate&quot;
612 pip install --quiet --upgrade pip
613
614 case $LFTOOLS_MODE in
615     gerrit)
616         git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
617         pushd /tmp/lftools
618         git fetch origin &quot;$LFTOOLS_REFSPEC&quot;
619         git checkout FETCH_HEAD
620         pip install --quiet --upgrade -r requirements.txt
621         pip install --quiet --upgrade -e .
622         popd
623         ;;
624
625     git)
626         pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@&quot;$BRANCH&quot;
627         ;;
628
629     release)
630         if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
631             LFTOOLS_VERSION=&quot;==$LFTOOLS_VERSION&quot;
632         fi
633
634         pip install --quiet --upgrade &quot;lftools${LFTOOLS_VERSION}&quot;
635         ;;
636 esac
637
638 lftools --version
639
640 # pipdeptree prints out a lot of information because lftools pulls in many
641 # dependencies. Let's only print it if we want to debug.
642 # echo &quot;----&gt; Pip Dependency Tree&quot;
643 # pip install --quiet --upgrade pipdeptree
644 # pipdeptree
645
646 #!/bin/bash
647 # SPDX-License-Identifier: EPL-1.0
648 ##############################################################################
649 # Copyright (c) 2017 The Linux Foundation and others.
650 #
651 # All rights reserved. This program and the accompanying materials
652 # are made available under the terms of the Eclipse Public License v1.0
653 # which accompanies this distribution, and is available at
654 # http://www.eclipse.org/legal/epl-v10.html
655 ##############################################################################
656 echo &quot;---&gt; logs-deploy.sh&quot;
657
658 # Ensure we fail the job if any steps fail.
659 set -eu -o pipefail
660
661 set -x  # Trace commands for this script to make debugging easier.
662
663 ARCHIVE_ARTIFACTS=&quot;${ARCHIVE_ARTIFACTS:-}&quot;
664 LOGS_SERVER=&quot;${LOGS_SERVER:-None}&quot;
665
666 if [ &quot;${LOGS_SERVER}&quot; == 'None' ]
667 then
668     set +x # Disable trace since we no longer need it
669
670     echo &quot;WARNING: Logging server not set&quot;
671 else
672     NEXUS_URL=&quot;${NEXUSPROXY:-$NEXUS_URL}&quot;
673     NEXUS_PATH=&quot;${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}&quot;
674     BUILD_URL=&quot;${BUILD_URL}&quot;
675
676     lftools deploy archives -p &quot;$ARCHIVE_ARTIFACTS&quot; &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$WORKSPACE&quot;
677     lftools deploy logs &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$BUILD_URL&quot;
678
679     set +x  # Disable trace since we no longer need it.
680
681     echo &quot;Build logs: &lt;a href=\&quot;$LOGS_SERVER/$NEXUS_PATH\&quot;&gt;$LOGS_SERVER/$NEXUS_PATH&lt;/a&gt;&quot;
682 fi
683 </command>
684         </hudson.tasks.Shell>
685         <hudson.tasks.Shell>
686           <command>#!/bin/bash
687 # SPDX-License-Identifier: EPL-1.0
688 ##############################################################################
689 # Copyright (c) 2017 The Linux Foundation and others.
690 #
691 # All rights reserved. This program and the accompanying materials
692 # are made available under the terms of the Eclipse Public License v1.0
693 # which accompanies this distribution, and is available at
694 # http://www.eclipse.org/legal/epl-v10.html
695 ##############################################################################
696
697 # Clear log credential files
698 rm &quot;$SETTINGS_FILE&quot;
699 rm ~/.netrc
700 </command>
701         </hudson.tasks.Shell>
702         <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
703           <regexp>^Build logs: .*</regexp>
704         </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
705       </buildSteps>
706       <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
707       <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
708       <markBuildUnstable>false</markBuildUnstable>
709     </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
710     <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
711       <patterns>
712         <hudson.plugins.ws__cleanup.Pattern>
713           <pattern>**/*.jenkins-trigger</pattern>
714           <type>EXCLUDE</type>
715         </hudson.plugins.ws__cleanup.Pattern>
716       </patterns>
717       <deleteDirs>false</deleteDirs>
718       <cleanupMatrixParent>false</cleanupMatrixParent>
719       <externalDelete/>
720       <cleanWhenSuccess>true</cleanWhenSuccess>
721       <cleanWhenUnstable>true</cleanWhenUnstable>
722       <cleanWhenFailure>true</cleanWhenFailure>
723       <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
724       <cleanWhenAborted>true</cleanWhenAborted>
725       <notFailBuild>true</notFailBuild>
726     </hudson.plugins.ws__cleanup.WsCleanup>
727   </publishers>
728   <buildWrappers>
729     <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
730     <hudson.plugins.build__timeout.BuildTimeoutWrapper>
731       <timeoutMinutes>60</timeoutMinutes>
732       <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
733       <failBuild>true</failBuild>
734       <writingDescription>false</writingDescription>
735       <timeoutPercentage>0</timeoutPercentage>
736       <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
737       <timeoutType>absolute</timeoutType>
738     </hudson.plugins.build__timeout.BuildTimeoutWrapper>
739     <hudson.plugins.timestamper.TimestamperBuildWrapper/>
740     <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
741       <user>test-credential</user>
742     </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
743     <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
744   </buildWrappers>
745 </project>