713ccb3a79284f1f5a010fa8dd98b1bfcee9637a
[releng/global-jjb.git] / .jjb-test / expected-xml / github-maven-sonar
1 <?xml version="1.0" encoding="utf-8"?>
2 <project>
3   <jdk>openjdk8</jdk>
4   <actions/>
5   <description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
6   <keepDependencies>false</keepDependencies>
7   <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
8   <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
9   <concurrentBuild>false</concurrentBuild>
10   <assignedNode>build-vm</assignedNode>
11   <canRoam>false</canRoam>
12   <properties>
13     <com.coravy.hudson.plugins.github.GithubProjectProperty>
14       <projectUrl>$GIT_URL/$PROJECT/example-org/releng/ciman</projectUrl>
15     </com.coravy.hudson.plugins.github.GithubProjectProperty>
16     <hudson.model.ParametersDefinitionProperty>
17       <parameterDefinitions>
18         <hudson.model.StringParameterDefinition>
19           <name>PROJECT</name>
20           <description>Parameter to identify a Gerrit project. This is typically the
21 project repo path as exists in Gerrit.
22 For example: ofextensions/circuitsw
23 </description>
24           <defaultValue>releng/ciman</defaultValue>
25         </hudson.model.StringParameterDefinition>
26         <hudson.model.StringParameterDefinition>
27           <name>STREAM</name>
28           <description>Stream is often set to the same name as 'branch' but can
29 sometimes be used as a name representing a project's release code
30 name.
31 </description>
32           <defaultValue>master</defaultValue>
33         </hudson.model.StringParameterDefinition>
34         <hudson.model.StringParameterDefinition>
35           <name>GERRIT_PROJECT</name>
36           <description>Parameter to identify Gerrit project. This is typically the
37 project repo path as exists in Gerrit.
38 For example: ofextensions/circuitsw
39
40 Note that Gerrit will override this parameter automatically if a
41 job is triggered by Gerrit.
42 </description>
43           <defaultValue>releng/ciman</defaultValue>
44         </hudson.model.StringParameterDefinition>
45         <hudson.model.StringParameterDefinition>
46           <name>GERRIT_BRANCH</name>
47           <description>Parameter to identify a Gerrit branch.
48
49 Note that Gerrit will override this parameter automatically if a
50 job is triggered by Gerrit.
51 </description>
52           <defaultValue>master</defaultValue>
53         </hudson.model.StringParameterDefinition>
54         <hudson.model.StringParameterDefinition>
55           <name>GERRIT_REFSPEC</name>
56           <description>Parameter to identify a refspec when pulling from Gerrit.
57
58 Note that Gerrit will override this parameter automatically if a
59 job is triggered by Gerrit.
60 </description>
61           <defaultValue>refs/heads/master</defaultValue>
62         </hudson.model.StringParameterDefinition>
63         <hudson.model.StringParameterDefinition>
64           <name>LFTOOLS_VERSION</name>
65           <description>Version of lftools to install. Can be a specific version like
66 '0.6.0' or a PEP-440 definition.
67 https://www.python.org/dev/peps/pep-0440/
68 For example '&lt;1.0.0' or '&gt;=1.0.0,&lt;2.0.0'.
69 </description>
70           <defaultValue>&lt;1.0.0</defaultValue>
71         </hudson.model.StringParameterDefinition>
72         <hudson.model.StringParameterDefinition>
73           <name>M2_HOME</name>
74           <description>Maven selector to be used by shell scripts</description>
75           <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
76         </hudson.model.StringParameterDefinition>
77         <hudson.model.StringParameterDefinition>
78           <name>MAVEN_OPTS</name>
79           <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
80 </description>
81           <defaultValue/>
82         </hudson.model.StringParameterDefinition>
83         <hudson.model.StringParameterDefinition>
84           <name>MAVEN_PARAMS</name>
85           <description>Maven parameters to pass to the mvn command.
86 </description>
87           <defaultValue/>
88         </hudson.model.StringParameterDefinition>
89         <hudson.model.StringParameterDefinition>
90           <name>MVN</name>
91           <description>Maven selector to be used by shell scripts</description>
92           <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
93         </hudson.model.StringParameterDefinition>
94         <hudson.model.StringParameterDefinition>
95           <name>STAGING_PROFILE_ID</name>
96           <description>Nexus staging profile ID.
97 </description>
98           <defaultValue/>
99         </hudson.model.StringParameterDefinition>
100         <hudson.model.StringParameterDefinition>
101           <name>ARCHIVE_ARTIFACTS</name>
102           <description>Artifacts to archive to the logs server.</description>
103           <defaultValue/>
104         </hudson.model.StringParameterDefinition>
105         <hudson.model.StringParameterDefinition>
106           <name>SONAR_MAVEN_GOAL</name>
107           <description>Maven goals to pass to the Sonar call. Typically sonar:sonar
108 however to use a specific version of the sonar-maven-plugin we
109 can call &quot;org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar&quot;.
110 </description>
111           <defaultValue>sonar:sonar</defaultValue>
112         </hudson.model.StringParameterDefinition>
113       </parameterDefinitions>
114     </hudson.model.ParametersDefinitionProperty>
115   </properties>
116   <scm class="hudson.plugins.git.GitSCM">
117     <configVersion>2</configVersion>
118     <userRemoteConfigs>
119       <hudson.plugins.git.UserRemoteConfig>
120         <name>origin</name>
121         <refspec>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
122         <url>git@github.com:example-org/releng/ciman</url>
123         <credentialsId>test-credential</credentialsId>
124       </hudson.plugins.git.UserRemoteConfig>
125     </userRemoteConfigs>
126     <branches>
127       <hudson.plugins.git.BranchSpec>
128         <name>$sha1</name>
129       </hudson.plugins.git.BranchSpec>
130     </branches>
131     <excludedUsers/>
132     <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
133     <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
134     <authorOrCommitter>false</authorOrCommitter>
135     <wipeOutWorkspace>true</wipeOutWorkspace>
136     <pruneBranches>false</pruneBranches>
137     <remotePoll>false</remotePoll>
138     <gitTool>Default</gitTool>
139     <submoduleCfg class="list"/>
140     <relativeTargetDir/>
141     <reference/>
142     <gitConfigName/>
143     <gitConfigEmail/>
144     <skipTag>true</skipTag>
145     <scmName/>
146     <useShallowClone>false</useShallowClone>
147     <ignoreNotifyCommit>false</ignoreNotifyCommit>
148     <extensions>
149       <hudson.plugins.git.extensions.impl.SubmoduleOption>
150         <disableSubmodules>false</disableSubmodules>
151         <recursiveSubmodules>true</recursiveSubmodules>
152         <trackingSubmodules>false</trackingSubmodules>
153         <reference/>
154         <timeout>10</timeout>
155       </hudson.plugins.git.extensions.impl.SubmoduleOption>
156       <hudson.plugins.git.extensions.impl.WipeWorkspace/>
157     </extensions>
158   </scm>
159   <triggers class="vector">
160     <org.jenkinsci.plugins.ghprb.GhprbTrigger>
161       <spec/>
162       <adminlist/>
163       <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
164       <whitelist/>
165       <orgslist/>
166       <cron/>
167       <triggerPhrase>^recheck$</triggerPhrase>
168       <onlyTriggerPhrase>false</onlyTriggerPhrase>
169       <useGitHubHooks>true</useGitHubHooks>
170       <permitAll>true</permitAll>
171       <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
172       <extensions>
173         <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
174           <commitStatusContext>Maven Verify</commitStatusContext>
175         </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
176       </extensions>
177     </org.jenkinsci.plugins.ghprb.GhprbTrigger>
178   </triggers>
179   <builders>
180     <hudson.tasks.Shell>
181       <command>echo &quot;quiet=on&quot; &gt; &quot;$HOME/.wgetrc&quot;</command>
182     </hudson.tasks.Shell>
183     <hudson.tasks.Maven>
184       <targets>--version</targets>
185       <properties/>
186       <mavenName>mvn33</mavenName>
187       <usePrivateRepository>false</usePrivateRepository>
188       <settings class="jenkins.mvn.DefaultSettingsProvider"/>
189       <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
190     </hudson.tasks.Maven>
191     <hudson.tasks.Shell>
192       <command>rm &quot;$HOME/.wgetrc&quot;</command>
193     </hudson.tasks.Shell>
194     <EnvInjectBuilder>
195       <info>
196         <propertiesContent>SONAR_HOST_URL=$SONAR_URL</propertiesContent>
197       </info>
198     </EnvInjectBuilder>
199     <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
200       <managedFiles>
201         <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
202           <fileId>global-settings</fileId>
203           <targetLocation/>
204           <variable>GLOBAL_SETTINGS_FILE</variable>
205         </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
206         <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
207           <fileId>aproject-settings</fileId>
208           <targetLocation/>
209           <variable>SETTINGS_FILE</variable>
210         </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
211       </managedFiles>
212     </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
213     <hudson.tasks.Shell>
214       <command>#!/bin/bash
215 # SPDX-License-Identifier: EPL-1.0
216 ##############################################################################
217 # Copyright (c) 2017 The Linux Foundation and others.
218 #
219 # All rights reserved. This program and the accompanying materials
220 # are made available under the terms of the Eclipse Public License v1.0
221 # which accompanies this distribution, and is available at
222 # http://www.eclipse.org/legal/epl-v10.html
223 ##############################################################################
224
225 # This file contains a list of variables that are generally useful in many
226 # scripts. It is meant to be sourced in other scripts so that the variables can
227 # be called.
228
229 MAVEN_OPTIONS=&quot;$(echo --show-version \
230     --batch-mode \
231     -Djenkins \
232     -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
233     -Dmaven.repo.local=/tmp/r \
234     -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)&quot;
235 echo &quot;$MAVEN_OPTIONS&quot;
236
237 #!/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
248 # This script builds a Maven project and deploys it into a staging repo which
249 # can be used to deploy elsewhere later eg. Nexus staging / snapshot repos.
250
251 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
252 # Ensure we fail the job if any steps fail.
253 set -e -o pipefail
254 set +u
255
256 export MAVEN_OPTS
257
258 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
259 # shellcheck disable=SC2086
260 $MVN clean deploy \
261     -Dsonar \
262     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
263     --settings &quot;$SETTINGS_FILE&quot; \
264     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
265     $MAVEN_OPTIONS $MAVEN_PARAMS
266
267 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
268 # shellcheck disable=SC2086
269 $MVN $SONAR_MAVEN_GOAL \
270     -Dsonar -Dsonar.host.url=&quot;$SONAR_HOST_URL&quot; \
271     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
272     --settings &quot;$SETTINGS_FILE&quot; \
273     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
274     $MAVEN_OPTIONS $MAVEN_PARAMS
275 </command>
276     </hudson.tasks.Shell>
277     <hudson.tasks.Shell>
278       <command>#!/bin/bash
279 set +e  # DO NOT cause build failure if any of the rm calls fail.
280
281 rm &quot;$GLOBAL_SETTINGS_FILE&quot; &quot;$SETTINGS_FILE&quot;
282
283 # In some cases we use the lf-provide-maven-settings macro to produce
284 # a &quot;$HOME/.netrc&quot; file containing credentials. Remove that file here
285 # too if it exists.
286 rm &quot;$HOME/.netrc&quot;
287
288 # DO NOT fail build if any of the above lines fail.
289 exit 0
290 </command>
291     </hudson.tasks.Shell>
292   </builders>
293   <publishers>
294     <hudson.plugins.jacoco.JacocoPublisher>
295       <execPattern>**/**.exec</execPattern>
296       <classPattern>**/classes</classPattern>
297       <sourcePattern>**/src/main/java</sourcePattern>
298       <changeBuildStatus/>
299       <inclusionPattern/>
300       <exclusionPattern>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</exclusionPattern>
301       <maximumBranchCoverage>10</maximumBranchCoverage>
302       <minimumBranchCoverage>20</minimumBranchCoverage>
303       <maximumMethodCoverage>50</maximumMethodCoverage>
304       <minimumMethodCoverage>40</minimumMethodCoverage>
305     </hudson.plugins.jacoco.JacocoPublisher>
306     <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs">
307       <isRankActivated>false</isRankActivated>
308       <includePattern/>
309       <excludePattern/>
310       <healthy/>
311       <unHealthy/>
312       <thresholdLimit>low</thresholdLimit>
313       <pluginName>[FINDBUGS] </pluginName>
314       <defaultEncoding/>
315       <canRunOnFailed>false</canRunOnFailed>
316       <useStableBuildAsReference>false</useStableBuildAsReference>
317       <usePreviousBuildAsReference>false</usePreviousBuildAsReference>
318       <useDeltaValues>false</useDeltaValues>
319       <thresholds>
320         <unstableTotalAll/>
321         <unstableTotalHigh/>
322         <unstableTotalNormal/>
323         <unstableTotalLow/>
324         <failedTotalAll/>
325         <failedTotalHigh/>
326         <failedTotalNormal/>
327         <failedTotalLow/>
328       </thresholds>
329       <shouldDetectModules>false</shouldDetectModules>
330       <dontComputeNew>true</dontComputeNew>
331       <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
332       <pattern/>
333     </hudson.plugins.findbugs.FindBugsPublisher>
334     <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
335       <buildSteps>
336         <hudson.tasks.Shell>
337           <command>#!/bin/bash
338 # SPDX-License-Identifier: EPL-1.0
339 ##############################################################################
340 # Copyright (c) 2017 The Linux Foundation and others.
341 #
342 # All rights reserved. This program and the accompanying materials
343 # are made available under the terms of the Eclipse Public License v1.0
344 # which accompanies this distribution, and is available at
345 # http://www.eclipse.org/legal/epl-v10.html
346 ##############################################################################
347 echo &quot;---&gt; sysstat.sh&quot;
348 set +e  # DON'T fail build if script fails.
349
350 OS=$(facter operatingsystem)
351 case &quot;$OS&quot; in
352     Ubuntu)
353         SYSSTAT_PATH=&quot;/var/log/sysstat&quot;
354
355         # Dont run the script when systat is not enabled by default
356         if ! grep --quiet 'ENABLED=&quot;true&quot;' &quot;/etc/default/sysstat&quot;; then
357             exit 0
358         fi
359     ;;
360     CentOS|RedHat)
361         SYSSTAT_PATH=&quot;/var/log/sa&quot;
362     ;;
363     *)
364         # nothing to do
365         exit 0
366     ;;
367 esac
368
369 SAR_DIR=&quot;$WORKSPACE/archives/sar-reports&quot;
370 mkdir -p &quot;$SAR_DIR&quot;
371 cp &quot;$SYSSTAT_PATH/&quot;* &quot;$_&quot;
372 # convert sar data to ascii format
373 while IFS=&quot;&quot; read -r sarfilenum
374 do
375     [ -f &quot;$sarfilenum&quot; ] &amp;&amp; LC_TIME=POSIX sar -A -f &quot;$sarfilenum&quot; &gt; &quot;$SAR_DIR/sar${sarfilenum//[!0-9]/}&quot;
376 done &lt; &lt;(find &quot;$SYSSTAT_PATH&quot; -name &quot;sa[0-9]*&quot; || true)
377
378 # DON'T fail build if script fails.
379 exit 0
380 </command>
381         </hudson.tasks.Shell>
382         <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
383           <managedFiles>
384             <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
385               <fileId>jenkins-log-archives-settings</fileId>
386               <targetLocation/>
387               <variable>SETTINGS_FILE</variable>
388             </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
389           </managedFiles>
390         </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
391         <EnvInjectBuilder>
392           <info>
393             <propertiesContent>SERVER_ID=logs</propertiesContent>
394           </info>
395         </EnvInjectBuilder>
396         <hudson.tasks.Shell>
397           <command>#!/bin/bash
398 # SPDX-License-Identifier: EPL-1.0
399 ##############################################################################
400 # Copyright (c) 2017 The Linux Foundation and others.
401 #
402 # All rights reserved. This program and the accompanying materials
403 # are made available under the terms of the Eclipse Public License v1.0
404 # which accompanies this distribution, and is available at
405 # http://www.eclipse.org/legal/epl-v10.html
406 ##############################################################################
407 echo &quot;---&gt; create-netrc.sh&quot;
408
409 # Ensure we fail the job if any steps fail.
410 set -eu -o pipefail
411
412 NEXUS_URL=&quot;${NEXUSPROXY:-$NEXUS_URL}&quot;
413 CREDENTIAL=$(xmlstarlet sel -N &quot;x=http://maven.apache.org/SETTINGS/1.0.0&quot; \
414     -t -m &quot;/x:settings/x:servers/x:server[x:id='${SERVER_ID}']&quot; \
415     -v x:username -o &quot;:&quot; -v x:password \
416     &quot;$SETTINGS_FILE&quot;)
417
418 machine=$(echo &quot;$NEXUS_URL&quot; | awk -F/ '{print $3}')
419 user=$(echo &quot;$CREDENTIAL&quot; | cut -f1 -d:)
420 pass=$(echo &quot;$CREDENTIAL&quot; | cut -f2 -d:)
421
422 echo &quot;machine ${machine%:*} login $user password $pass&quot; &gt; ~/.netrc
423 </command>
424         </hudson.tasks.Shell>
425         <hudson.tasks.Shell>
426           <command>#!/bin/bash
427 # SPDX-License-Identifier: EPL-1.0
428 ##############################################################################
429 # Copyright (c) 2017 The Linux Foundation and others.
430 #
431 # All rights reserved. This program and the accompanying materials
432 # are made available under the terms of the Eclipse Public License v1.0
433 # which accompanies this distribution, and is available at
434 # http://www.eclipse.org/legal/epl-v10.html
435 ##############################################################################
436 echo &quot;---&gt; lftools-install.sh&quot;
437
438 # Script to install lftools via a version passed in via lf-infra-parameters
439 #
440 # Required parameters:
441 #
442 #     LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
443 #                      set to a strict version number like '1.2.3' or using
444 #                      PEP-440 definitions.
445 #
446 #                      Examples:
447 #                          &lt;1.0.0
448 #                          &gt;=1.0.0,&lt;2.0.0
449 #
450 # By default a released version of lftools should always be used.
451 # The purpose of the 2 variables below is so that lftools devs can test
452 # unreleased versions of lftools. There are 2 methods to install a dev version
453 # of lftools:
454 #
455 #     1) gerrit patch: Used to test a patch that has not yet been merged.
456 #                      To do this set something like this:
457 #                          LFTOOLS_MODE=gerrit
458 #                          LFTOOLS_REFSPEC=refs/changes/96/5296/7
459 #
460 #     2) git branch: Used to install an lftools version from a specific branch.
461 #                    To use this set the variables as follows:
462 #                          LFTOOLS_MODE=git
463 #                          LFTOOLS_REFSPEC=master
464 #
465 #     3) release : The intended use case and default setting.
466 #                  Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
467
468 LFTOOLS_MODE=release  # release | git | gerrit
469 LFTOOLS_REFSPEC=master
470
471 # Ensure we fail the job if any steps fail.
472 # DO NOT set -u as virtualenv's activate script has unbound variables
473 set -e -o pipefail
474
475 virtualenv --quiet &quot;/tmp/v/lftools&quot;
476 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
477 source &quot;/tmp/v/lftools/bin/activate&quot;
478 pip install --quiet --upgrade pip
479
480 case $LFTOOLS_MODE in
481     gerrit)
482         git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
483         pushd /tmp/lftools
484         git fetch origin &quot;$LFTOOLS_REFSPEC&quot;
485         git checkout FETCH_HEAD
486         pip install --quiet --upgrade -r requirements.txt
487         pip install --quiet --upgrade -e .
488         popd
489         ;;
490
491     git)
492         pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@&quot;$BRANCH&quot;
493         ;;
494
495     release)
496         if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
497             LFTOOLS_VERSION=&quot;==$LFTOOLS_VERSION&quot;
498         fi
499
500         pip install --quiet --upgrade &quot;lftools${LFTOOLS_VERSION}&quot;
501         ;;
502 esac
503
504 lftools --version
505
506 # pipdeptree prints out a lot of information because lftools pulls in many
507 # dependencies. Let's only print it if we want to debug.
508 # echo &quot;----&gt; Pip Dependency Tree&quot;
509 # pip install --quiet --upgrade pipdeptree
510 # pipdeptree
511
512 #!/bin/bash
513 # SPDX-License-Identifier: EPL-1.0
514 ##############################################################################
515 # Copyright (c) 2017 The Linux Foundation and others.
516 #
517 # All rights reserved. This program and the accompanying materials
518 # are made available under the terms of the Eclipse Public License v1.0
519 # which accompanies this distribution, and is available at
520 # http://www.eclipse.org/legal/epl-v10.html
521 ##############################################################################
522 echo &quot;---&gt; logs-deploy.sh&quot;
523
524 # Ensure we fail the job if any steps fail.
525 set -eu -o pipefail
526
527 set -x  # Trace commands for this script to make debugging easier.
528
529 ARCHIVE_ARTIFACTS=&quot;${ARCHIVE_ARTIFACTS:-}&quot;
530 LOGS_SERVER=&quot;${LOGS_SERVER:-None}&quot;
531
532 if [ &quot;${LOGS_SERVER}&quot; == 'None' ]
533 then
534     set +x # Disable trace since we no longer need it
535
536     echo &quot;WARNING: Logging server not set&quot;
537 else
538     NEXUS_URL=&quot;${NEXUSPROXY:-$NEXUS_URL}&quot;
539     NEXUS_PATH=&quot;${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}&quot;
540     BUILD_URL=&quot;${BUILD_URL}&quot;
541
542     lftools deploy archives -p &quot;$ARCHIVE_ARTIFACTS&quot; &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$WORKSPACE&quot;
543     lftools deploy logs &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$BUILD_URL&quot;
544
545     set +x  # Disable trace since we no longer need it.
546
547     echo &quot;Build logs: &lt;a href=\&quot;$LOGS_SERVER/$NEXUS_PATH\&quot;&gt;$LOGS_SERVER/$NEXUS_PATH&lt;/a&gt;&quot;
548 fi
549 </command>
550         </hudson.tasks.Shell>
551         <hudson.tasks.Shell>
552           <command>#!/bin/bash
553 # SPDX-License-Identifier: EPL-1.0
554 ##############################################################################
555 # Copyright (c) 2017 The Linux Foundation and others.
556 #
557 # All rights reserved. This program and the accompanying materials
558 # are made available under the terms of the Eclipse Public License v1.0
559 # which accompanies this distribution, and is available at
560 # http://www.eclipse.org/legal/epl-v10.html
561 ##############################################################################
562
563 # Clear log credential files
564 rm &quot;$SETTINGS_FILE&quot;
565 rm ~/.netrc
566 </command>
567         </hudson.tasks.Shell>
568         <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
569           <regexp>^Build logs: .*</regexp>
570         </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
571       </buildSteps>
572       <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
573       <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
574       <markBuildUnstable>false</markBuildUnstable>
575     </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
576     <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
577       <patterns>
578         <hudson.plugins.ws__cleanup.Pattern>
579           <pattern>**/*.jenkins-trigger</pattern>
580           <type>EXCLUDE</type>
581         </hudson.plugins.ws__cleanup.Pattern>
582       </patterns>
583       <deleteDirs>false</deleteDirs>
584       <cleanupMatrixParent>false</cleanupMatrixParent>
585       <externalDelete/>
586       <cleanWhenSuccess>true</cleanWhenSuccess>
587       <cleanWhenUnstable>true</cleanWhenUnstable>
588       <cleanWhenFailure>true</cleanWhenFailure>
589       <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
590       <cleanWhenAborted>true</cleanWhenAborted>
591       <notFailBuild>true</notFailBuild>
592     </hudson.plugins.ws__cleanup.WsCleanup>
593   </publishers>
594   <buildWrappers>
595     <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
596     <hudson.plugins.build__timeout.BuildTimeoutWrapper>
597       <timeoutMinutes>30</timeoutMinutes>
598       <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
599       <failBuild>true</failBuild>
600       <writingDescription>false</writingDescription>
601       <timeoutPercentage>0</timeoutPercentage>
602       <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
603       <timeoutType>absolute</timeoutType>
604     </hudson.plugins.build__timeout.BuildTimeoutWrapper>
605     <hudson.plugins.timestamper.TimestamperBuildWrapper/>
606     <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
607       <user>test-credential</user>
608     </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
609     <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
610     <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
611       <managedFiles>
612         <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
613           <fileId>npmrc</fileId>
614           <targetLocation>$HOME/.npmrc</targetLocation>
615           <variable/>
616         </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
617       </managedFiles>
618     </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
619   </buildWrappers>
620 </project>