1 <?xml version="1.0" encoding="utf-8"?>
5 <description><!-- Managed by Jenkins Job Builder --></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>
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>
20 </jenkins.model.BuildDiscarderProperty>
21 <hudson.model.ParametersDefinitionProperty>
22 <parameterDefinitions>
23 <hudson.model.StringParameterDefinition>
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
29 <defaultValue>releng/ciman</defaultValue>
30 </hudson.model.StringParameterDefinition>
31 <hudson.model.StringParameterDefinition>
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
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
45 Note that Gerrit will override this parameter automatically if a
46 job is triggered by Gerrit.
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.
54 Note that Gerrit will override this parameter automatically if a
55 job is triggered by Gerrit.
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.
63 Note that Gerrit will override this parameter automatically if a
64 job is triggered by Gerrit.
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 '<1.0.0' or '>=1.0.0,<2.0.0'.
75 <defaultValue><1.0.0</defaultValue>
76 </hudson.model.StringParameterDefinition>
77 <hudson.model.StringParameterDefinition>
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
87 </hudson.model.StringParameterDefinition>
88 <hudson.model.StringParameterDefinition>
89 <name>MAVEN_PARAMS</name>
90 <description>Maven parameters to pass to the mvn command.
92 <defaultValue>-Dstream=$STREAM</defaultValue>
93 </hudson.model.StringParameterDefinition>
94 <hudson.model.StringParameterDefinition>
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.
103 <defaultValue>uuddlrlrba</defaultValue>
104 </hudson.model.StringParameterDefinition>
105 </parameterDefinitions>
106 </hudson.model.ParametersDefinitionProperty>
108 <scm class="hudson.plugins.git.GitSCM">
109 <configVersion>2</configVersion>
111 <hudson.plugins.git.UserRemoteConfig>
113 <refspec>$GERRIT_REFSPEC</refspec>
114 <url>$GIT_URL/$PROJECT</url>
115 <credentialsId>test-credential</credentialsId>
116 </hudson.plugins.git.UserRemoteConfig>
119 <hudson.plugins.git.BranchSpec>
120 <name>refs/heads/$GERRIT_BRANCH</name>
121 </hudson.plugins.git.BranchSpec>
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"/>
136 <skipTag>true</skipTag>
138 <useShallowClone>false</useShallowClone>
139 <ignoreNotifyCommit>false</ignoreNotifyCommit>
141 <hudson.plugins.git.extensions.impl.SubmoduleOption>
142 <disableSubmodules>false</disableSubmodules>
143 <recursiveSubmodules>true</recursiveSubmodules>
144 <trackingSubmodules>false</trackingSubmodules>
146 <timeout>10</timeout>
147 </hudson.plugins.git.extensions.impl.SubmoduleOption>
148 <hudson.plugins.git.extensions.impl.WipeWorkspace/>
151 <triggers class="vector">
152 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
155 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
156 <compareType>ANT</compareType>
157 <pattern>releng/ciman</pattern>
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>
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>
170 <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
171 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
174 <onSuccessful>false</onSuccessful>
175 <onFailed>false</onFailed>
176 <onUnstable>false</onUnstable>
177 <onNotBuilt>false</onNotBuilt>
179 <silentMode>false</silentMode>
180 <silentStartMode>false</silentStartMode>
181 <escapeQuotes>true</escapeQuotes>
182 <noNameAndEmailParameters>false</noNameAndEmailParameters>
183 <readableMessage>false</readableMessage>
184 <dependencyJobsNames/>
186 <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
188 <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
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>
195 <buildFailureMessage/>
196 <buildSuccessfulMessage/>
197 <buildUnstableMessage/>
198 <buildNotBuiltMessage/>
199 <buildUnsuccessfulFilepath/>
201 <serverName>test-server</serverName>
202 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
206 <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
207 </hudson.tasks.Shell>
209 <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
210 </hudson.tasks.Shell>
212 <targets>--version</targets>
214 <mavenName>mvn33</mavenName>
215 <usePrivateRepository>false</usePrivateRepository>
216 <settings class="jenkins.mvn.DefaultSettingsProvider"/>
217 <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
218 </hudson.tasks.Maven>
220 <command>rm "$HOME/.wgetrc"</command>
221 </hudson.tasks.Shell>
222 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
224 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
225 <fileId>global-settings</fileId>
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>
232 <variable>SETTINGS_FILE</variable>
233 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
235 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
238 # SPDX-License-Identifier: EPL-1.0
239 ##############################################################################
240 # Copyright (c) 2017 The Linux Foundation and others.
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
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'
253 # NOTE: This script assumes the user will provide the correct dependency order
254 # via the PATCHES list.
256 # Ensure we fail the job if any steps fail.
259 REPOS_DIR="$WORKSPACE/.repos"
261 PATCHES=($(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep 'recheck:' | awk -F: '{print $2}'))
264 for patch in $(echo "${PATCHES[@]}"); do
265 json=$(curl -s "$GERRIT_URL/changes/$patch" | sed -e "s/)]}'//")
266 project=$(echo "$json" | jq -r '.project')
267 branch=$(echo "$json" | jq -r '.branch')
269 if [ ! -d "$REPOS_DIR/$project" ]; then
270 git clone -q --depth 1 -b "$branch" "$GIT_URL/$project" "$REPOS_DIR/$project"
272 # This array will be used later to determine project build order.
273 projects+=("$project")
276 pushd "$REPOS_DIR/$project"
277 git remote add gerrit "$GIT_URL/$project"
278 git review --cherrypick="$patch"
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 "DEPENDENCY_BUILD_ORDER=${projects[*]}" > "$WORKSPACE/.dependency.properties"
286 </hudson.tasks.Shell>
289 <propertiesFilePath>$WORKSPACE/.dependency.properties</propertiesFilePath>
294 # SPDX-License-Identifier: EPL-1.0
295 ##############################################################################
296 # Copyright (c) 2017 The Linux Foundation and others.
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 ##############################################################################
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
308 MAVEN_OPTIONS="$(echo --show-version \
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)"
314 echo "$MAVEN_OPTIONS"
317 # SPDX-License-Identifier: EPL-1.0
318 ##############################################################################
319 # Copyright (c) 2017 The Linux Foundation and others.
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 ##############################################################################
327 # Builds projects provided via $DEPENDENCY_BUILD_ORDER list
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 "$WORKSPACE/.repos".
333 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
334 # Ensure we fail the job if any steps fail.
338 PROJECTS=($(echo "$DEPENDENCY_BUILD_ORDER"))
339 REPOS_DIR="$WORKSPACE/.repos"
343 for project in "${PROJECTS[@]}"; do
344 pushd "$REPOS_DIR/$project"
345 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
346 # shellcheck disable=SC2086
350 --global-settings "$GLOBAL_SETTINGS_FILE" \
351 --settings "$SETTINGS_FILE" \
352 $MAVEN_PARAMS $MAVEN_OPTIONS
356 </hudson.tasks.Shell>
359 # SPDX-License-Identifier: EPL-1.0
360 ##############################################################################
361 # Copyright (c) 2017 The Linux Foundation and others.
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 ##############################################################################
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
373 MAVEN_OPTIONS="$(echo --show-version \
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)"
379 echo "$MAVEN_OPTIONS"
382 # SPDX-License-Identifier: EPL-1.0
383 ##############################################################################
384 # Copyright (c) 2017 The Linux Foundation and others.
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 ##############################################################################
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.
395 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
396 # Ensure we fail the job if any steps fail.
402 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
403 # shellcheck disable=SC2086
405 --global-settings "$GLOBAL_SETTINGS_FILE" \
406 --settings "$SETTINGS_FILE" \
407 -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \
408 $MAVEN_PARAMS $MAVEN_OPTIONS
410 </hudson.tasks.Shell>
413 set +e # DO NOT cause build failure if any of the rm calls fail.
415 rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
417 # In some cases we use the lf-provide-maven-settings macro to produce
418 # a "$HOME/.netrc" file containing credentials. Remove that file here
420 rm "$HOME/.netrc"
422 # DO NOT fail build if any of the above lines fail.
425 </hudson.tasks.Shell>
428 <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs">
429 <isRankActivated>false</isRankActivated>
434 <thresholdLimit>low</thresholdLimit>
435 <pluginName>[FINDBUGS] </pluginName>
437 <canRunOnFailed>false</canRunOnFailed>
438 <useStableBuildAsReference>false</useStableBuildAsReference>
439 <usePreviousBuildAsReference>false</usePreviousBuildAsReference>
440 <useDeltaValues>false</useDeltaValues>
444 <unstableTotalNormal/>
451 <shouldDetectModules>false</shouldDetectModules>
452 <dontComputeNew>true</dontComputeNew>
453 <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
455 </hudson.plugins.findbugs.FindBugsPublisher>
456 <hudson.plugins.jacoco.JacocoPublisher>
457 <execPattern>**/**.exec</execPattern>
458 <classPattern>**/classes</classPattern>
459 <sourcePattern>**/src/main/java</sourcePattern>
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>
472 # SPDX-License-Identifier: EPL-1.0
473 ##############################################################################
474 # Copyright (c) 2017 The Linux Foundation and others.
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 "---> sysstat.sh"
482 set +e # DON'T fail build if script fails.
484 OS=$(facter operatingsystem)
485 case "$OS" in
487 SYSSTAT_PATH="/var/log/sysstat"
489 # Dont run the script when systat is not enabled by default
490 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
495 SYSSTAT_PATH="/var/log/sa"
503 SAR_DIR="$WORKSPACE/archives/sar-reports"
504 mkdir -p "$SAR_DIR"
505 cp "$SYSSTAT_PATH/"* "$_"
506 # convert sar data to ascii format
507 while IFS="" read -r s
509 [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/sar${s//[!0-9]/}"
510 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
512 # DON'T fail build if script fails.
515 </hudson.tasks.Shell>
516 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
518 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
519 <fileId>jenkins-log-archives-settings</fileId>
521 <variable>SETTINGS_FILE</variable>
522 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
524 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
527 <propertiesContent>SERVER_ID=logs</propertiesContent>
532 # SPDX-License-Identifier: EPL-1.0
533 ##############################################################################
534 # Copyright (c) 2017 The Linux Foundation and others.
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 "---> create-netrc.sh"
543 # Ensure we fail the job if any steps fail.
546 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
547 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
548 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
549 -v x:username -o ":" -v x:password \
550 "$SETTINGS_FILE")
552 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
553 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
554 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
556 echo "machine $machine login $user password $pass" > ~/.netrc
558 </hudson.tasks.Shell>
561 # SPDX-License-Identifier: EPL-1.0
562 ##############################################################################
563 # Copyright (c) 2017 The Linux Foundation and others.
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 "---> lftools-install.sh"
572 # Script to install lftools via a version passed in via lf-infra-parameters
574 # Required parameters:
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.
582 # >=1.0.0,<2.0.0
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
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
594 # 2) git branch: Used to install an lftools version from a specific branch.
595 # To use this set the variables as follows:
597 # LFTOOLS_REFSPEC=master
599 # 3) release : The intended use case and default setting.
600 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
602 LFTOOLS_MODE=release # release | git | gerrit
603 LFTOOLS_REFSPEC=master
605 # Ensure we fail the job if any steps fail.
606 # DO NOT set -u as virtualenv's activate script has unbound variables
609 virtualenv --quiet "/tmp/v/lftools"
610 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
611 source "/tmp/v/lftools/bin/activate"
612 pip install --quiet --upgrade pip
614 case $LFTOOLS_MODE in
616 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
618 git fetch origin "$LFTOOLS_REFSPEC"
619 git checkout FETCH_HEAD
620 pip install --quiet --upgrade -r requirements.txt
621 pip install --quiet --upgrade -e .
626 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
630 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
631 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
634 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
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 "----> Pip Dependency Tree"
643 # pip install --quiet --upgrade pipdeptree
647 # SPDX-License-Identifier: EPL-1.0
648 ##############################################################################
649 # Copyright (c) 2017 The Linux Foundation and others.
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 "---> logs-deploy.sh"
658 # Ensure we fail the job if any steps fail.
661 set -x # Trace commands for this script to make debugging easier.
663 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
664 LOGS_SERVER="${LOGS_SERVER:-None}"
666 if [ "${LOGS_SERVER}" == 'None' ]
668 set +x # Disable trace since we no longer need it
670 echo "WARNING: Logging server not set"
672 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
673 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
674 BUILD_URL="${BUILD_URL}"
676 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
677 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
679 set +x # Disable trace since we no longer need it.
681 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
684 </hudson.tasks.Shell>
687 # SPDX-License-Identifier: EPL-1.0
688 ##############################################################################
689 # Copyright (c) 2017 The Linux Foundation and others.
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 ##############################################################################
697 # Clear log credential files
698 rm "$SETTINGS_FILE"
701 </hudson.tasks.Shell>
702 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
703 <regexp>^Build logs: .*</regexp>
704 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
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">
712 <hudson.plugins.ws__cleanup.Pattern>
713 <pattern>**/*.jenkins-trigger</pattern>
715 </hudson.plugins.ws__cleanup.Pattern>
717 <deleteDirs>false</deleteDirs>
718 <cleanupMatrixParent>false</cleanupMatrixParent>
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>
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/>