Merge "Verify JJB when global-jjb is updated"
[releng/global-jjb.git] / jjb-test / expected-xml / gerrit-ciman-jjb-verify
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>JJB_VERSION</name>
78           <description>Jenkins Job Builder version to download and install.</description>
79           <defaultValue>1.6.2</defaultValue>
80         </hudson.model.StringParameterDefinition>
81       </parameterDefinitions>
82     </hudson.model.ParametersDefinitionProperty>
83   </properties>
84   <scm class="hudson.plugins.git.GitSCM">
85     <configVersion>2</configVersion>
86     <userRemoteConfigs>
87       <hudson.plugins.git.UserRemoteConfig>
88         <name>origin</name>
89         <refspec>$GERRIT_REFSPEC</refspec>
90         <url>$GIT_URL/$GERRIT_PROJECT</url>
91         <credentialsId>test-credential</credentialsId>
92       </hudson.plugins.git.UserRemoteConfig>
93     </userRemoteConfigs>
94     <branches>
95       <hudson.plugins.git.BranchSpec>
96         <name>refs/heads/$GERRIT_BRANCH</name>
97       </hudson.plugins.git.BranchSpec>
98     </branches>
99     <excludedUsers/>
100     <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
101     <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
102     <authorOrCommitter>false</authorOrCommitter>
103     <wipeOutWorkspace>true</wipeOutWorkspace>
104     <pruneBranches>false</pruneBranches>
105     <remotePoll>false</remotePoll>
106     <gitTool>Default</gitTool>
107     <submoduleCfg class="list"/>
108     <relativeTargetDir/>
109     <reference/>
110     <gitConfigName/>
111     <gitConfigEmail/>
112     <skipTag>true</skipTag>
113     <scmName/>
114     <useShallowClone>false</useShallowClone>
115     <ignoreNotifyCommit>false</ignoreNotifyCommit>
116     <extensions>
117       <hudson.plugins.git.extensions.impl.SubmoduleOption>
118         <disableSubmodules>false</disableSubmodules>
119         <recursiveSubmodules>true</recursiveSubmodules>
120         <trackingSubmodules>false</trackingSubmodules>
121         <reference/>
122         <timeout>10</timeout>
123       </hudson.plugins.git.extensions.impl.SubmoduleOption>
124       <hudson.plugins.git.extensions.impl.WipeWorkspace/>
125     </extensions>
126   </scm>
127   <triggers class="vector">
128     <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
129       <spec/>
130       <gerritProjects>
131         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
132           <compareType>ANT</compareType>
133           <pattern>releng/ciman</pattern>
134           <branches>
135             <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
136               <compareType>ANT</compareType>
137               <pattern>**/master</pattern>
138             </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
139           </branches>
140           <filePaths>
141             <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
142               <compareType>ANT</compareType>
143               <pattern>**/*.sh</pattern>
144             </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
145             <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
146               <compareType>ANT</compareType>
147               <pattern>**/*.yaml</pattern>
148             </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
149             <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
150               <compareType>ANT</compareType>
151               <pattern>**/global-jjb</pattern>
152             </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
153           </filePaths>
154           <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
155         </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
156       </gerritProjects>
157       <skipVote>
158         <onSuccessful>false</onSuccessful>
159         <onFailed>false</onFailed>
160         <onUnstable>false</onUnstable>
161         <onNotBuilt>false</onNotBuilt>
162       </skipVote>
163       <silentMode>false</silentMode>
164       <silentStartMode>false</silentStartMode>
165       <escapeQuotes>true</escapeQuotes>
166       <noNameAndEmailParameters>false</noNameAndEmailParameters>
167       <readableMessage>false</readableMessage>
168       <dependencyJobsNames/>
169       <notificationLevel/>
170       <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
171       <triggerConfigURL/>
172       <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
173       <triggerOnEvents>
174         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
175           <excludeDrafts>false</excludeDrafts>
176           <excludeTrivialRebase>false</excludeTrivialRebase>
177           <excludeNoCodeChange>false</excludeNoCodeChange>
178         </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
179         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginDraftPublishedEvent/>
180         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
181           <commentAddedCommentContains>recheck$</commentAddedCommentContains>
182         </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
183       </triggerOnEvents>
184       <buildStartMessage/>
185       <buildFailureMessage/>
186       <buildSuccessfulMessage/>
187       <buildUnstableMessage/>
188       <buildNotBuiltMessage/>
189       <buildUnsuccessfulFilepath/>
190       <customUrl/>
191       <serverName>test-server</serverName>
192     </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
193   </triggers>
194   <builders>
195     <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
196       <managedFiles>
197         <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
198           <fileId>jjbini</fileId>
199           <targetLocation>$HOME/.config/jenkins_jobs/jenkins_jobs.ini</targetLocation>
200           <variable/>
201         </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
202       </managedFiles>
203     </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
204     <hudson.tasks.Shell>
205       <command>#!/bin/bash
206 # SPDX-License-Identifier: EPL-1.0
207 ##############################################################################
208 # Copyright (c) 2017 The Linux Foundation and others.
209 #
210 # All rights reserved. This program and the accompanying materials
211 # are made available under the terms of the Eclipse Public License v1.0
212 # which accompanies this distribution, and is available at
213 # http://www.eclipse.org/legal/epl-v10.html
214 ##############################################################################
215
216 # This script will make sure that there are no JIRA URLs in the commit
217 # message. JIRA URLs will break the its-jira plugin
218
219 # Ensure we fail the job if any steps fail.
220 # Do not treat undefined variables as errors as in this case we are allowed
221 # to have JIRA_URL undefined
222 set -e -o pipefail
223 set +u
224
225 if [ -n &quot;${JIRA_URL}&quot; ];
226 then
227   BASE_URL=$(echo $JIRA_URL | awk -F'/' '{print $3}')
228   JIRA_LINK=$(git rev-list --format=%B --max-count=1 HEAD | grep -io &quot;http[s]*://$BASE_URL/&quot; || true)
229   if [[ ! -z &quot;$JIRA_LINK&quot; ]]
230   then
231     echo 'Remove JIRA URLs from commit message'
232     echo 'Add jira references as: Issue: &lt;JIRAKEY&gt;-&lt;ISSUE#&gt;, instead of URLs'
233     exit 1
234   fi
235 fi
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 echo &quot;---&gt; jjb-install.sh&quot;
248
249 # Ensure we fail the job if any steps fail.
250 # DO NOT set -u as virtualenv's activate script has unbound variables
251 set -e -o pipefail
252
253 virtualenv &quot;/tmp/v/jjb&quot;
254 # shellcheck source=/tmp/v/jjb/bin/activate disable=SC1091
255 source &quot;/tmp/v/jjb/bin/activate&quot;
256 pip install --quiet --upgrade pip
257 pip install --quiet --upgrade pipdeptree
258 pip install --quiet --upgrade &quot;jenkins-job-builder==$JJB_VERSION&quot;
259
260 echo &quot;----&gt; Pip Dependency Tree&quot;
261 pipdeptree
262
263 #!/bin/bash
264 # SPDX-License-Identifier: EPL-1.0
265 ##############################################################################
266 # Copyright (c) 2017 The Linux Foundation and others.
267 #
268 # All rights reserved. This program and the accompanying materials
269 # are made available under the terms of the Eclipse Public License v1.0
270 # which accompanies this distribution, and is available at
271 # http://www.eclipse.org/legal/epl-v10.html
272 ##############################################################################
273 echo &quot;---&gt; jjb-verify-job.sh&quot;
274
275 # Ensure we fail the job if any steps fail.
276 set -eu -o pipefail
277
278 jenkins-jobs -l DEBUG test --recursive -o archives/job-configs --exclude jjb-test jjb
279
280 # Sort job output into sub-directories. On large Jenkins systems that have
281 # many jobs archiving so many files into the same directory makes NGINX return
282 # the directory list slow.
283 pushd archives/job-configs
284 for letter in {a..z}
285 do
286     if [[ $(ls &quot;$letter&quot;* &gt; /dev/null 2&gt;&amp;1) -eq 0 ]]
287     then
288         mkdir &quot;$letter&quot;
289         find . -maxdepth 1 -type f -name &quot;$letter*&quot; -exec mv {} &quot;$letter&quot; \;
290     fi
291 done
292 popd
293
294 #!/bin/bash
295 # SPDX-License-Identifier: EPL-1.0
296 ##############################################################################
297 # Copyright (c) 2015 The Linux Foundation and others.
298 #
299 # All rights reserved. This program and the accompanying materials
300 # are made available under the terms of the Eclipse Public License v1.0
301 # which accompanies this distribution, and is available at
302 # http://www.eclipse.org/legal/epl-v10.html
303 ##############################################################################
304 echo &quot;---&gt; jjb-check-unicode.sh&quot;
305
306 if LC_ALL=C grep -r '[^[:print:][:space:]]' jjb/; then
307     echo &quot;Found files containing non-ascii characters.&quot;
308     exit 1
309 fi
310
311 echo &quot;All files are ASCII only&quot;
312 </command>
313     </hudson.tasks.Shell>
314     <hudson.tasks.Shell>
315       <command>#!/bin/bash
316 # SPDX-License-Identifier: EPL-1.0
317 ##############################################################################
318 # Copyright (c) 2016 The Linux Foundation and others.
319 #
320 # All rights reserved. This program and the accompanying materials
321 # are made available under the terms of the Eclipse Public License v1.0
322 # which accompanies this distribution, and is available at
323 # http://www.eclipse.org/legal/epl-v10.html
324 ##############################################################################
325 echo &quot;---&gt; gpg-verify-git-signature.sh&quot;
326
327 if git log --show-signature -1 | grep -E -q 'gpg: Signature made.*key ID'; then
328    echo &quot;Git commit is GPG signed.&quot;
329 else
330    echo &quot;WARNING: GPG signature missing for the commit.&quot;
331 fi
332
333 # Do NOT fail the job for unsigned commits
334 exit 0
335 </command>
336     </hudson.tasks.Shell>
337   </builders>
338   <publishers>
339     <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
340       <buildSteps>
341         <hudson.tasks.Shell>
342           <command>#!/bin/bash
343 # SPDX-License-Identifier: EPL-1.0
344 ##############################################################################
345 # Copyright (c) 2017 The Linux Foundation and others.
346 #
347 # All rights reserved. This program and the accompanying materials
348 # are made available under the terms of the Eclipse Public License v1.0
349 # which accompanies this distribution, and is available at
350 # http://www.eclipse.org/legal/epl-v10.html
351 ##############################################################################
352 echo &quot;---&gt; sysstat.sh&quot;
353 set +e  # DON'T fail build if script fails.
354
355 OS=$(facter operatingsystem)
356 case &quot;$OS&quot; in
357     Ubuntu)
358         SYSSTAT_PATH=&quot;/var/log/sysstat&quot;
359
360         # Dont run the script when systat is not enabled by default
361         if ! grep --quiet 'ENABLED=&quot;true&quot;' &quot;/etc/default/sysstat&quot;; then
362             exit 0
363         fi
364     ;;
365     CentOS|RedHat)
366         SYSSTAT_PATH=&quot;/var/log/sa&quot;
367     ;;
368     *)
369         # nothing to do
370         exit 0
371     ;;
372 esac
373
374 SAR_DIR=&quot;$WORKSPACE/archives/sar-reports&quot;
375 mkdir -p &quot;$SAR_DIR&quot;
376 cp &quot;$SYSSTAT_PATH/&quot;* &quot;$_&quot;
377 # convert sar data to ascii format
378 while IFS=&quot;&quot; read -r s
379 do
380     [ -f &quot;$s&quot; ] &amp;&amp; LC_TIME=POSIX sar -A -f &quot;$s&quot; &gt; &quot;$SAR_DIR/sar${s//[!0-9]/}&quot;
381 done &lt; &lt;(find &quot;$SYSSTAT_PATH&quot; -name &quot;sa[0-9]*&quot; || true)
382
383 # DON'T fail build if script fails.
384 exit 0
385 </command>
386         </hudson.tasks.Shell>
387         <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
388           <managedFiles>
389             <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
390               <fileId>jenkins-log-archives-settings</fileId>
391               <targetLocation/>
392               <variable>SETTINGS_FILE</variable>
393             </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
394           </managedFiles>
395         </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
396         <EnvInjectBuilder>
397           <info>
398             <propertiesContent>SERVER_ID=logs</propertiesContent>
399           </info>
400         </EnvInjectBuilder>
401         <hudson.tasks.Shell>
402           <command>#!/bin/bash
403 # SPDX-License-Identifier: EPL-1.0
404 ##############################################################################
405 # Copyright (c) 2017 The Linux Foundation and others.
406 #
407 # All rights reserved. This program and the accompanying materials
408 # are made available under the terms of the Eclipse Public License v1.0
409 # which accompanies this distribution, and is available at
410 # http://www.eclipse.org/legal/epl-v10.html
411 ##############################################################################
412 echo &quot;---&gt; create-netrc.sh&quot;
413
414 # Ensure we fail the job if any steps fail.
415 set -eu -o pipefail
416
417 NEXUS_URL=&quot;${NEXUS_URL:-$NEXUSPROXY}&quot;
418 CREDENTIAL=$(xmlstarlet sel -N &quot;x=http://maven.apache.org/SETTINGS/1.0.0&quot; \
419     -t -m &quot;/x:settings/x:servers/x:server[x:id='${SERVER_ID}']&quot; \
420     -v x:username -o &quot;:&quot; -v x:password \
421     &quot;$SETTINGS_FILE&quot;)
422
423 machine=$(echo &quot;$NEXUS_URL&quot; | awk -F/ '{print $3}')
424 user=$(echo &quot;$CREDENTIAL&quot; | cut -f1 -d:)
425 pass=$(echo &quot;$CREDENTIAL&quot; | cut -f2 -d:)
426
427 echo &quot;machine $machine login $user password $pass&quot; &gt; ~/.netrc
428 </command>
429         </hudson.tasks.Shell>
430         <hudson.tasks.Shell>
431           <command>#!/bin/bash
432 # SPDX-License-Identifier: EPL-1.0
433 ##############################################################################
434 # Copyright (c) 2017 The Linux Foundation and others.
435 #
436 # All rights reserved. This program and the accompanying materials
437 # are made available under the terms of the Eclipse Public License v1.0
438 # which accompanies this distribution, and is available at
439 # http://www.eclipse.org/legal/epl-v10.html
440 ##############################################################################
441 echo &quot;---&gt; lftools-install.sh&quot;
442
443 # Script to install lftools via a version passed in via lf-infra-parameters
444 #
445 # Required parameters:
446 #
447 #     LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
448 #                      set to a strict version number like '1.2.3' or using
449 #                      PEP-440 definitions.
450 #
451 #                      Examples:
452 #                          &lt;1.0.0
453 #                          &gt;=1.0.0,&lt;2.0.0
454 #
455 # By default a released version of lftools should always be used.
456 # The purpose of the 2 variables below is so that lftools devs can test
457 # unreleased versions of lftools. There are 2 methods to install a dev version
458 # of lftools:
459 #
460 #     1) gerrit patch: Used to test a patch that has not yet been merged.
461 #                      To do this set something like this:
462 #                          LFTOOLS_MODE=gerrit
463 #                          LFTOOLS_REFSPEC=refs/changes/96/5296/7
464 #
465 #     2) git branch: Used to install an lftools version from a specific branch.
466 #                    To use this set the variables as follows:
467 #                          LFTOOLS_MODE=git
468 #                          LFTOOLS_REFSPEC=master
469 #
470 #     3) release : The intended use case and default setting.
471 #                  Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
472
473 LFTOOLS_MODE=release  # release | git | gerrit
474 LFTOOLS_REFSPEC=master
475
476 # Ensure we fail the job if any steps fail.
477 # DO NOT set -u as virtualenv's activate script has unbound variables
478 set -e -o pipefail
479
480 virtualenv --quiet &quot;/tmp/v/lftools&quot;
481 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
482 source &quot;/tmp/v/lftools/bin/activate&quot;
483 pip install --quiet --upgrade pip
484
485 case $LFTOOLS_MODE in
486     gerrit)
487         git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
488         pushd /tmp/lftools
489         git fetch origin &quot;$LFTOOLS_REFSPEC&quot;
490         git checkout FETCH_HEAD
491         pip install --quiet --upgrade -r requirements.txt
492         pip install --quiet --upgrade -e .
493         popd
494         ;;
495
496     git)
497         pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@&quot;$BRANCH&quot;
498         ;;
499
500     release)
501         if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
502             LFTOOLS_VERSION=&quot;==$LFTOOLS_VERSION&quot;
503         fi
504
505         pip install --quiet --upgrade &quot;lftools${LFTOOLS_VERSION}&quot;
506         ;;
507 esac
508
509 lftools --version
510
511 # pipdeptree prints out a lot of information because lftools pulls in many
512 # dependencies. Let's only print it if we want to debug.
513 # echo &quot;----&gt; Pip Dependency Tree&quot;
514 # pip install --quiet --upgrade pipdeptree
515 # pipdeptree
516
517 #!/bin/bash
518 # SPDX-License-Identifier: EPL-1.0
519 ##############################################################################
520 # Copyright (c) 2017 The Linux Foundation and others.
521 #
522 # All rights reserved. This program and the accompanying materials
523 # are made available under the terms of the Eclipse Public License v1.0
524 # which accompanies this distribution, and is available at
525 # http://www.eclipse.org/legal/epl-v10.html
526 ##############################################################################
527 echo &quot;---&gt; logs-deploy.sh&quot;
528
529 # Ensure we fail the job if any steps fail.
530 set -eu -o pipefail
531
532 set -x  # Trace commands for this script to make debugging easier.
533
534 ARCHIVE_ARTIFACTS=&quot;${ARCHIVE_ARTIFACTS:-}&quot;
535 LOGS_SERVER=&quot;${LOGS_SERVER:-None}&quot;
536
537 if [ &quot;${LOGS_SERVER}&quot; == 'None' ]
538 then
539     set +x # Disable trace since we no longer need it
540
541     echo &quot;WARNING: Logging server not set&quot;
542 else
543     NEXUS_URL=&quot;${NEXUS_URL:-$NEXUSPROXY}&quot;
544     NEXUS_PATH=&quot;${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}&quot;
545     BUILD_URL=&quot;${BUILD_URL}&quot;
546
547     lftools deploy archives -p &quot;$ARCHIVE_ARTIFACTS&quot; &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$WORKSPACE&quot;
548     lftools deploy logs &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$BUILD_URL&quot;
549
550     set +x  # Disable trace since we no longer need it.
551
552     echo &quot;Build logs: &lt;a href=\&quot;$LOGS_SERVER/$NEXUS_PATH\&quot;&gt;$LOGS_SERVER/$NEXUS_PATH&lt;/a&gt;&quot;
553 fi
554 </command>
555         </hudson.tasks.Shell>
556         <hudson.tasks.Shell>
557           <command>#!/bin/bash
558 # SPDX-License-Identifier: EPL-1.0
559 ##############################################################################
560 # Copyright (c) 2017 The Linux Foundation and others.
561 #
562 # All rights reserved. This program and the accompanying materials
563 # are made available under the terms of the Eclipse Public License v1.0
564 # which accompanies this distribution, and is available at
565 # http://www.eclipse.org/legal/epl-v10.html
566 ##############################################################################
567
568 # Clear log credential files
569 rm &quot;$SETTINGS_FILE&quot;
570 rm ~/.netrc
571 </command>
572         </hudson.tasks.Shell>
573         <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
574           <regexp>^Build logs: .*</regexp>
575         </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
576       </buildSteps>
577       <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
578       <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
579       <markBuildUnstable>false</markBuildUnstable>
580     </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
581     <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
582       <patterns>
583         <hudson.plugins.ws__cleanup.Pattern>
584           <pattern>**/*.jenkins-trigger</pattern>
585           <type>EXCLUDE</type>
586         </hudson.plugins.ws__cleanup.Pattern>
587       </patterns>
588       <deleteDirs>false</deleteDirs>
589       <cleanupMatrixParent>false</cleanupMatrixParent>
590       <externalDelete/>
591       <cleanWhenSuccess>true</cleanWhenSuccess>
592       <cleanWhenUnstable>true</cleanWhenUnstable>
593       <cleanWhenFailure>true</cleanWhenFailure>
594       <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
595       <cleanWhenAborted>true</cleanWhenAborted>
596       <notFailBuild>true</notFailBuild>
597     </hudson.plugins.ws__cleanup.WsCleanup>
598   </publishers>
599   <buildWrappers>
600     <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
601     <hudson.plugins.build__timeout.BuildTimeoutWrapper>
602       <timeoutMinutes>10</timeoutMinutes>
603       <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
604       <failBuild>true</failBuild>
605       <writingDescription>false</writingDescription>
606       <timeoutPercentage>0</timeoutPercentage>
607       <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
608       <timeoutType>absolute</timeoutType>
609     </hudson.plugins.build__timeout.BuildTimeoutWrapper>
610     <hudson.plugins.timestamper.TimestamperBuildWrapper/>
611     <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
612       <user>test-credential</user>
613     </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
614     <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
615   </buildWrappers>
616 </project>