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>false</concurrentBuild>
10 <assignedNode>build-vm</assignedNode>
11 <canRoam>false</canRoam>
13 <jenkins.model.BuildDiscarderProperty>
14 <strategy class="hudson.tasks.LogRotator">
15 <daysToKeep>30</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>
78 <name>MAVEN_OPTS</name>
79 <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
82 </hudson.model.StringParameterDefinition>
83 <hudson.model.StringParameterDefinition>
84 <name>MAVEN_PARAMS</name>
85 <description>Maven parameters to pass to the mvn command.
88 </hudson.model.StringParameterDefinition>
89 <hudson.model.StringParameterDefinition>
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.
98 <defaultValue>uuddlrlrba</defaultValue>
99 </hudson.model.StringParameterDefinition>
100 </parameterDefinitions>
101 </hudson.model.ParametersDefinitionProperty>
103 <scm class="hudson.plugins.git.GitSCM">
104 <configVersion>2</configVersion>
106 <hudson.plugins.git.UserRemoteConfig>
108 <refspec>$GERRIT_REFSPEC</refspec>
109 <url>$GIT_URL/$PROJECT</url>
110 <credentialsId>test-credential</credentialsId>
111 </hudson.plugins.git.UserRemoteConfig>
114 <hudson.plugins.git.BranchSpec>
115 <name>refs/heads/$GERRIT_BRANCH</name>
116 </hudson.plugins.git.BranchSpec>
119 <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
120 <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
121 <authorOrCommitter>false</authorOrCommitter>
122 <wipeOutWorkspace>true</wipeOutWorkspace>
123 <pruneBranches>false</pruneBranches>
124 <remotePoll>false</remotePoll>
125 <gitTool>Default</gitTool>
126 <submoduleCfg class="list"/>
131 <skipTag>true</skipTag>
133 <useShallowClone>false</useShallowClone>
134 <ignoreNotifyCommit>false</ignoreNotifyCommit>
136 <hudson.plugins.git.extensions.impl.SubmoduleOption>
137 <disableSubmodules>false</disableSubmodules>
138 <recursiveSubmodules>true</recursiveSubmodules>
139 <trackingSubmodules>false</trackingSubmodules>
141 <timeout>10</timeout>
142 </hudson.plugins.git.extensions.impl.SubmoduleOption>
143 <hudson.plugins.git.extensions.impl.WipeWorkspace/>
146 <triggers class="vector">
147 <hudson.triggers.TimerTrigger>
149 </hudson.triggers.TimerTrigger>
150 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
153 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
154 <compareType>ANT</compareType>
155 <pattern>releng/ciman</pattern>
157 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
158 <compareType>ANT</compareType>
159 <pattern>**/master</pattern>
160 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
162 <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
163 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
166 <onSuccessful>false</onSuccessful>
167 <onFailed>false</onFailed>
168 <onUnstable>false</onUnstable>
169 <onNotBuilt>false</onNotBuilt>
171 <silentMode>false</silentMode>
172 <silentStartMode>false</silentStartMode>
173 <escapeQuotes>true</escapeQuotes>
174 <noNameAndEmailParameters>false</noNameAndEmailParameters>
175 <readableMessage>false</readableMessage>
176 <dependencyJobsNames/>
178 <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
180 <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
182 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
183 <commentAddedCommentContains>build release$</commentAddedCommentContains>
184 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
187 <buildFailureMessage/>
188 <buildSuccessfulMessage/>
189 <buildUnstableMessage/>
190 <buildNotBuiltMessage/>
191 <buildUnsuccessfulFilepath/>
193 <serverName>test-server</serverName>
194 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
198 <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
199 </hudson.tasks.Shell>
201 <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
202 </hudson.tasks.Shell>
204 <targets>--version</targets>
206 <mavenName>mvn33</mavenName>
207 <usePrivateRepository>false</usePrivateRepository>
208 <settings class="jenkins.mvn.DefaultSettingsProvider"/>
209 <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
210 </hudson.tasks.Maven>
212 <command>rm "$HOME/.wgetrc"</command>
213 </hudson.tasks.Shell>
214 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
216 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
217 <fileId>global-settings</fileId>
219 <variable>GLOBAL_SETTINGS_FILE</variable>
220 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
221 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
222 <fileId>gerrit-maven-project-settings</fileId>
224 <variable>SETTINGS_FILE</variable>
225 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
227 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
230 <propertiesContent>SERVER_ID=project-staging</propertiesContent>
235 # SPDX-License-Identifier: EPL-1.0
236 ##############################################################################
237 # Copyright (c) 2017 The Linux Foundation and others.
239 # All rights reserved. This program and the accompanying materials
240 # are made available under the terms of the Eclipse Public License v1.0
241 # which accompanies this distribution, and is available at
242 # http://www.eclipse.org/legal/epl-v10.html
243 ##############################################################################
244 echo "---> create-netrc.sh"
246 # Ensure we fail the job if any steps fail.
249 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
250 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
251 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
252 -v x:username -o ":" -v x:password \
253 "$SETTINGS_FILE")
255 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
256 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
257 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
259 echo "machine $machine login $user password $pass" > ~/.netrc
261 </hudson.tasks.Shell>
264 # SPDX-License-Identifier: EPL-1.0
265 ##############################################################################
266 # Copyright (c) 2017 The Linux Foundation and others.
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 "---> lftools-install.sh"
275 # Script to install lftools via a version passed in via lf-infra-parameters
277 # Required parameters:
279 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
280 # set to a strict version number like '1.2.3' or using
281 # PEP-440 definitions.
285 # >=1.0.0,<2.0.0
287 # By default a released version of lftools should always be used.
288 # The purpose of the 2 variables below is so that lftools devs can test
289 # unreleased versions of lftools. There are 2 methods to install a dev version
292 # 1) gerrit patch: Used to test a patch that has not yet been merged.
293 # To do this set something like this:
294 # LFTOOLS_MODE=gerrit
295 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
297 # 2) git branch: Used to install an lftools version from a specific branch.
298 # To use this set the variables as follows:
300 # LFTOOLS_REFSPEC=master
302 # 3) release : The intended use case and default setting.
303 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
305 LFTOOLS_MODE=release # release | git | gerrit
306 LFTOOLS_REFSPEC=master
308 # Ensure we fail the job if any steps fail.
309 # DO NOT set -u as virtualenv's activate script has unbound variables
312 virtualenv --quiet "/tmp/v/lftools"
313 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
314 source "/tmp/v/lftools/bin/activate"
315 pip install --quiet --upgrade pip
317 case $LFTOOLS_MODE in
319 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
321 git fetch origin "$LFTOOLS_REFSPEC"
322 git checkout FETCH_HEAD
323 pip install --quiet --upgrade -r requirements.txt
324 pip install --quiet --upgrade -e .
329 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
333 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
334 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
337 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
343 # pipdeptree prints out a lot of information because lftools pulls in many
344 # dependencies. Let's only print it if we want to debug.
345 # echo "----> Pip Dependency Tree"
346 # pip install --quiet --upgrade pipdeptree
350 # SPDX-License-Identifier: EPL-1.0
351 ##############################################################################
352 # Copyright (c) 2017 The Linux Foundation and others.
354 # All rights reserved. This program and the accompanying materials
355 # are made available under the terms of the Eclipse Public License v1.0
356 # which accompanies this distribution, and is available at
357 # http://www.eclipse.org/legal/epl-v10.html
358 ##############################################################################
360 # This file contains a list of variables that are generally useful in many
361 # scripts. It is meant to be sourced in other scripts so that the variables can
364 MAVEN_OPTIONS="$(echo --show-version \
367 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
368 -Dmaven.repo.local=/tmp/r \
369 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)"
370 echo "$MAVEN_OPTIONS"
373 # SPDX-License-Identifier: EPL-1.0
374 ##############################################################################
375 # Copyright (c) 2017 The Linux Foundation and others.
377 # All rights reserved. This program and the accompanying materials
378 # are made available under the terms of the Eclipse Public License v1.0
379 # which accompanies this distribution, and is available at
380 # http://www.eclipse.org/legal/epl-v10.html
381 ##############################################################################
383 # This script removes the -SNAPSHOT from a project to prepare it for release.
385 PATCH_DIR="$WORKSPACE/archives/patches"
386 mkdir -p "$PATCH_DIR"
388 # Ensure we fail the job if any steps fail.
391 echo "$PROJECT" "$(git rev-parse --verify HEAD)" | tee -a "$PATCH_DIR/taglist.log"
393 # Strip -SNAPSHOT from version to prepare release.
394 find . -name "*.xml" -print0 | xargs -0 sed -i 's/-SNAPSHOT//g'
396 git commit -am "Release $PROJECT"
397 git format-patch --stdout "origin/$GERRIT_BRANCH" > "$PATCH_DIR/${PROJECT//\//-}.patch"
398 git bundle create "$PATCH_DIR/${PROJECT//\//-}.bundle" "origin/${GERRIT_BRANCH}..HEAD"
401 # SPDX-License-Identifier: EPL-1.0
402 ##############################################################################
403 # Copyright (c) 2017 The Linux Foundation and others.
405 # All rights reserved. This program and the accompanying materials
406 # are made available under the terms of the Eclipse Public License v1.0
407 # which accompanies this distribution, and is available at
408 # http://www.eclipse.org/legal/epl-v10.html
409 ##############################################################################
411 # This script builds a Maven project and deploys it into a staging repo which
412 # can be used to deploy elsewhere later eg. Nexus staging / snapshot repos.
414 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
415 # Ensure we fail the job if any steps fail.
421 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
422 # shellcheck disable=SC2086
424 --global-settings "$GLOBAL_SETTINGS_FILE" \
425 --settings "$SETTINGS_FILE" \
426 -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \
427 $MAVEN_PARAMS $MAVEN_OPTIONS
430 # SPDX-License-Identifier: EPL-1.0
431 ##############################################################################
432 # Copyright (c) 2017 The Linux Foundation and others.
434 # All rights reserved. This program and the accompanying materials
435 # are made available under the terms of the Eclipse Public License v1.0
436 # which accompanies this distribution, and is available at
437 # http://www.eclipse.org/legal/epl-v10.html
438 ##############################################################################
440 # This script publishes artifacts to a staging repo in Nexus.
442 # $WORKSPACE/m2repo : Exists and used to deploy the staging repository.
443 # $NEXUS_URL : Jenkins global variable should be defined.
444 # $STAGING_PROFILE_ID : Provided by a job parameter.
446 # Ensure we fail the job if any steps fail.
449 TMP_FILE="$(mktemp)"
450 lftools deploy nexus-stage "$NEXUS_URL" "$STAGING_PROFILE_ID" "$WORKSPACE/m2repo" | tee "$TMP_FILE"
451 staging_repo=$(sed -n -e 's/Staging repository \(.*\) created\./\1/p' "$TMP_FILE")
453 # Store repo info to a file in archives
454 mkdir -p "$WORKSPACE/archives"
455 echo "$staging_repo" > "$WORKSPACE/archives/staging-repo.txt"
458 rm "$TMP_FILE"
460 </hudson.tasks.Shell>
463 set +e # DO NOT cause build failure if any of the rm calls fail.
465 rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
467 # In some cases we use the lf-provide-maven-settings macro to produce
468 # a "$HOME/.netrc" file containing credentials. Remove that file here
470 rm "$HOME/.netrc"
472 # DO NOT fail build if any of the above lines fail.
475 </hudson.tasks.Shell>
478 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
482 # SPDX-License-Identifier: EPL-1.0
483 ##############################################################################
484 # Copyright (c) 2017 The Linux Foundation and others.
486 # All rights reserved. This program and the accompanying materials
487 # are made available under the terms of the Eclipse Public License v1.0
488 # which accompanies this distribution, and is available at
489 # http://www.eclipse.org/legal/epl-v10.html
490 ##############################################################################
491 echo "---> sysstat.sh"
492 set +e # DON'T fail build if script fails.
494 OS=$(facter operatingsystem)
495 case "$OS" in
497 SYSSTAT_PATH="/var/log/sysstat"
499 # Dont run the script when systat is not enabled by default
500 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
505 SYSSTAT_PATH="/var/log/sa"
513 SAR_DIR="$WORKSPACE/archives/sar-reports"
514 mkdir -p "$SAR_DIR"
515 cp "$SYSSTAT_PATH/"* "$_"
516 # convert sar data to ascii format
517 while IFS="" read -r s
519 [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/sar${s//[!0-9]/}"
520 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
522 # DON'T fail build if script fails.
525 </hudson.tasks.Shell>
526 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
528 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
529 <fileId>jenkins-log-archives-settings</fileId>
531 <variable>SETTINGS_FILE</variable>
532 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
534 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
537 <propertiesContent>SERVER_ID=logs</propertiesContent>
542 # SPDX-License-Identifier: EPL-1.0
543 ##############################################################################
544 # Copyright (c) 2017 The Linux Foundation and others.
546 # All rights reserved. This program and the accompanying materials
547 # are made available under the terms of the Eclipse Public License v1.0
548 # which accompanies this distribution, and is available at
549 # http://www.eclipse.org/legal/epl-v10.html
550 ##############################################################################
551 echo "---> create-netrc.sh"
553 # Ensure we fail the job if any steps fail.
556 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
557 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
558 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
559 -v x:username -o ":" -v x:password \
560 "$SETTINGS_FILE")
562 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
563 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
564 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
566 echo "machine $machine login $user password $pass" > ~/.netrc
568 </hudson.tasks.Shell>
571 # SPDX-License-Identifier: EPL-1.0
572 ##############################################################################
573 # Copyright (c) 2017 The Linux Foundation and others.
575 # All rights reserved. This program and the accompanying materials
576 # are made available under the terms of the Eclipse Public License v1.0
577 # which accompanies this distribution, and is available at
578 # http://www.eclipse.org/legal/epl-v10.html
579 ##############################################################################
580 echo "---> lftools-install.sh"
582 # Script to install lftools via a version passed in via lf-infra-parameters
584 # Required parameters:
586 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
587 # set to a strict version number like '1.2.3' or using
588 # PEP-440 definitions.
592 # >=1.0.0,<2.0.0
594 # By default a released version of lftools should always be used.
595 # The purpose of the 2 variables below is so that lftools devs can test
596 # unreleased versions of lftools. There are 2 methods to install a dev version
599 # 1) gerrit patch: Used to test a patch that has not yet been merged.
600 # To do this set something like this:
601 # LFTOOLS_MODE=gerrit
602 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
604 # 2) git branch: Used to install an lftools version from a specific branch.
605 # To use this set the variables as follows:
607 # LFTOOLS_REFSPEC=master
609 # 3) release : The intended use case and default setting.
610 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
612 LFTOOLS_MODE=release # release | git | gerrit
613 LFTOOLS_REFSPEC=master
615 # Ensure we fail the job if any steps fail.
616 # DO NOT set -u as virtualenv's activate script has unbound variables
619 virtualenv --quiet "/tmp/v/lftools"
620 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
621 source "/tmp/v/lftools/bin/activate"
622 pip install --quiet --upgrade pip
624 case $LFTOOLS_MODE in
626 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
628 git fetch origin "$LFTOOLS_REFSPEC"
629 git checkout FETCH_HEAD
630 pip install --quiet --upgrade -r requirements.txt
631 pip install --quiet --upgrade -e .
636 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
640 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
641 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
644 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
650 # pipdeptree prints out a lot of information because lftools pulls in many
651 # dependencies. Let's only print it if we want to debug.
652 # echo "----> Pip Dependency Tree"
653 # pip install --quiet --upgrade pipdeptree
657 # SPDX-License-Identifier: EPL-1.0
658 ##############################################################################
659 # Copyright (c) 2017 The Linux Foundation and others.
661 # All rights reserved. This program and the accompanying materials
662 # are made available under the terms of the Eclipse Public License v1.0
663 # which accompanies this distribution, and is available at
664 # http://www.eclipse.org/legal/epl-v10.html
665 ##############################################################################
666 echo "---> logs-deploy.sh"
668 # Ensure we fail the job if any steps fail.
671 set -x # Trace commands for this script to make debugging easier.
673 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
674 LOGS_SERVER="${LOGS_SERVER:-None}"
676 if [ "${LOGS_SERVER}" == 'None' ]
678 set +x # Disable trace since we no longer need it
680 echo "WARNING: Logging server not set"
682 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
683 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
684 BUILD_URL="${BUILD_URL}"
686 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
687 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
689 set +x # Disable trace since we no longer need it.
691 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
694 </hudson.tasks.Shell>
697 # SPDX-License-Identifier: EPL-1.0
698 ##############################################################################
699 # Copyright (c) 2017 The Linux Foundation and others.
701 # All rights reserved. This program and the accompanying materials
702 # are made available under the terms of the Eclipse Public License v1.0
703 # which accompanies this distribution, and is available at
704 # http://www.eclipse.org/legal/epl-v10.html
705 ##############################################################################
707 # Clear log credential files
708 rm "$SETTINGS_FILE"
711 </hudson.tasks.Shell>
712 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
713 <regexp>^Build logs: .*</regexp>
714 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
716 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
717 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
718 <markBuildUnstable>false</markBuildUnstable>
719 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
720 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
722 <hudson.plugins.ws__cleanup.Pattern>
723 <pattern>**/*.jenkins-trigger</pattern>
725 </hudson.plugins.ws__cleanup.Pattern>
727 <deleteDirs>false</deleteDirs>
728 <cleanupMatrixParent>false</cleanupMatrixParent>
730 <cleanWhenSuccess>true</cleanWhenSuccess>
731 <cleanWhenUnstable>true</cleanWhenUnstable>
732 <cleanWhenFailure>true</cleanWhenFailure>
733 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
734 <cleanWhenAborted>true</cleanWhenAborted>
735 <notFailBuild>true</notFailBuild>
736 </hudson.plugins.ws__cleanup.WsCleanup>
739 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
740 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
741 <timeoutMinutes>30</timeoutMinutes>
742 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
743 <failBuild>true</failBuild>
744 <writingDescription>false</writingDescription>
745 <timeoutPercentage>0</timeoutPercentage>
746 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
747 <timeoutType>absolute</timeoutType>
748 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
749 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
750 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
751 <user>test-credential</user>
752 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
753 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>