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