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>
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.
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 <hudson.model.StringParameterDefinition>
106 <name>ARCHIVE_ARTIFACTS</name>
107 <description>Artifacts to archive to the logs server.</description>
109 </hudson.model.StringParameterDefinition>
110 </parameterDefinitions>
111 </hudson.model.ParametersDefinitionProperty>
113 <scm class="hudson.plugins.git.GitSCM">
114 <configVersion>2</configVersion>
116 <hudson.plugins.git.UserRemoteConfig>
118 <refspec>$GERRIT_REFSPEC</refspec>
119 <url>$GIT_URL/$PROJECT</url>
120 <credentialsId>test-credential</credentialsId>
121 </hudson.plugins.git.UserRemoteConfig>
124 <hudson.plugins.git.BranchSpec>
125 <name>refs/heads/$GERRIT_BRANCH</name>
126 </hudson.plugins.git.BranchSpec>
128 <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
129 <remotePoll>false</remotePoll>
130 <gitTool>Default</gitTool>
131 <submoduleCfg class="list"/>
136 <hudson.plugins.git.extensions.impl.BuildChooserSetting>
137 <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
138 </hudson.plugins.git.extensions.impl.BuildChooserSetting>
139 <hudson.plugins.git.extensions.impl.SubmoduleOption>
140 <disableSubmodules>false</disableSubmodules>
141 <recursiveSubmodules>true</recursiveSubmodules>
142 <trackingSubmodules>false</trackingSubmodules>
143 <parentCredentials>false</parentCredentials>
145 <timeout>10</timeout>
146 </hudson.plugins.git.extensions.impl.SubmoduleOption>
147 <hudson.plugins.git.extensions.impl.WipeWorkspace/>
150 <triggers class="vector">
151 <hudson.triggers.TimerTrigger>
153 </hudson.triggers.TimerTrigger>
154 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
157 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
158 <compareType>ANT</compareType>
159 <pattern>releng/ciman</pattern>
161 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
162 <compareType>ANT</compareType>
163 <pattern>**/master</pattern>
164 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
166 <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
167 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
170 <onSuccessful>false</onSuccessful>
171 <onFailed>false</onFailed>
172 <onUnstable>false</onUnstable>
173 <onNotBuilt>false</onNotBuilt>
175 <silentMode>false</silentMode>
176 <silentStartMode>false</silentStartMode>
177 <escapeQuotes>true</escapeQuotes>
178 <noNameAndEmailParameters>false</noNameAndEmailParameters>
179 <readableMessage>false</readableMessage>
180 <dependencyJobsNames/>
182 <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
184 <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
186 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
187 <commentAddedCommentContains>build release$</commentAddedCommentContains>
188 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
191 <buildFailureMessage/>
192 <buildSuccessfulMessage/>
193 <buildUnstableMessage/>
194 <buildNotBuiltMessage/>
195 <buildUnsuccessfulFilepath/>
197 <serverName>test-server</serverName>
198 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
202 <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
203 </hudson.tasks.Shell>
205 <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
206 </hudson.tasks.Shell>
208 <targets>--version</targets>
210 <mavenName>mvn33</mavenName>
211 <usePrivateRepository>false</usePrivateRepository>
212 <settings class="jenkins.mvn.DefaultSettingsProvider"/>
213 <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
214 </hudson.tasks.Maven>
216 <command>rm "$HOME/.wgetrc"</command>
217 </hudson.tasks.Shell>
218 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
220 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
221 <fileId>global-settings</fileId>
223 <variable>GLOBAL_SETTINGS_FILE</variable>
224 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
225 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
226 <fileId>gerrit-maven-project-settings</fileId>
228 <variable>SETTINGS_FILE</variable>
229 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
231 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
234 <propertiesContent>SERVER_ID=project-staging</propertiesContent>
239 # SPDX-License-Identifier: EPL-1.0
240 ##############################################################################
241 # Copyright (c) 2017 The Linux Foundation and others.
243 # All rights reserved. This program and the accompanying materials
244 # are made available under the terms of the Eclipse Public License v1.0
245 # which accompanies this distribution, and is available at
246 # http://www.eclipse.org/legal/epl-v10.html
247 ##############################################################################
248 echo "---> create-netrc.sh"
250 # Ensure we fail the job if any steps fail.
253 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
254 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
255 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
256 -v x:username -o ":" -v x:password \
257 "$SETTINGS_FILE")
259 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
260 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
261 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
263 echo "machine ${machine%:*} login $user password $pass" > ~/.netrc
265 </hudson.tasks.Shell>
268 # SPDX-License-Identifier: EPL-1.0
269 ##############################################################################
270 # Copyright (c) 2017 The Linux Foundation and others.
272 # All rights reserved. This program and the accompanying materials
273 # are made available under the terms of the Eclipse Public License v1.0
274 # which accompanies this distribution, and is available at
275 # http://www.eclipse.org/legal/epl-v10.html
276 ##############################################################################
277 echo "---> lftools-install.sh"
279 # Script to install lftools via a version passed in via lf-infra-parameters
281 # Required parameters:
283 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
284 # set to a strict version number like '1.2.3' or using
285 # PEP-440 definitions.
289 # >=1.0.0,<2.0.0
291 # By default a released version of lftools should always be used.
292 # The purpose of the 2 variables below is so that lftools devs can test
293 # unreleased versions of lftools. There are 2 methods to install a dev version
296 # 1) gerrit patch: Used to test a patch that has not yet been merged.
297 # To do this set something like this:
298 # LFTOOLS_MODE=gerrit
299 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
301 # 2) git branch: Used to install an lftools version from a specific branch.
302 # To use this set the variables as follows:
304 # LFTOOLS_REFSPEC=master
306 # 3) release : The intended use case and default setting.
307 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
309 LFTOOLS_MODE=release # release | git | gerrit
310 LFTOOLS_REFSPEC=master
312 # Ensure we fail the job if any steps fail.
313 # DO NOT set -u as virtualenv's activate script has unbound variables
316 virtualenv --quiet "/tmp/v/lftools"
317 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
318 source "/tmp/v/lftools/bin/activate"
319 pip install --quiet --upgrade pip
321 case $LFTOOLS_MODE in
323 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
325 git fetch origin "$LFTOOLS_REFSPEC"
326 git checkout FETCH_HEAD
327 pip install --quiet --upgrade -r requirements.txt
328 pip install --quiet --upgrade -e .
333 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
337 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
338 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
341 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
347 # pipdeptree prints out a lot of information because lftools pulls in many
348 # dependencies. Let's only print it if we want to debug.
349 # echo "----> Pip Dependency Tree"
350 # pip install --quiet --upgrade pipdeptree
354 # SPDX-License-Identifier: EPL-1.0
355 ##############################################################################
356 # Copyright (c) 2017 The Linux Foundation and others.
358 # All rights reserved. This program and the accompanying materials
359 # are made available under the terms of the Eclipse Public License v1.0
360 # which accompanies this distribution, and is available at
361 # http://www.eclipse.org/legal/epl-v10.html
362 ##############################################################################
364 # This file contains a list of variables that are generally useful in many
365 # scripts. It is meant to be sourced in other scripts so that the variables can
368 MAVEN_OPTIONS="$(echo --show-version \
371 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
372 -Dmaven.repo.local=/tmp/r \
373 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)"
374 echo "$MAVEN_OPTIONS"
377 # SPDX-License-Identifier: EPL-1.0
378 ##############################################################################
379 # Copyright (c) 2017 The Linux Foundation and others.
381 # All rights reserved. This program and the accompanying materials
382 # are made available under the terms of the Eclipse Public License v1.0
383 # which accompanies this distribution, and is available at
384 # http://www.eclipse.org/legal/epl-v10.html
385 ##############################################################################
387 # This script removes the -SNAPSHOT from a project to prepare it for release.
389 PATCH_DIR="$WORKSPACE/archives/patches"
390 mkdir -p "$PATCH_DIR"
392 # Ensure we fail the job if any steps fail.
395 echo "$PROJECT" "$(git rev-parse --verify HEAD)" | tee -a "$PATCH_DIR/taglist.log"
397 # Strip -SNAPSHOT from version to prepare release.
398 find . -name "*.xml" -print0 | xargs -0 sed -i 's/-SNAPSHOT//g'
400 git commit -am "Release $PROJECT"
401 git format-patch --stdout "origin/$GERRIT_BRANCH" > "$PATCH_DIR/${PROJECT//\//-}.patch"
402 git bundle create "$PATCH_DIR/${PROJECT//\//-}.bundle" "origin/${GERRIT_BRANCH}..HEAD"
405 # SPDX-License-Identifier: EPL-1.0
406 ##############################################################################
407 # Copyright (c) 2017 The Linux Foundation and others.
409 # All rights reserved. This program and the accompanying materials
410 # are made available under the terms of the Eclipse Public License v1.0
411 # which accompanies this distribution, and is available at
412 # http://www.eclipse.org/legal/epl-v10.html
413 ##############################################################################
415 # This script builds a Maven project and deploys it into a staging repo which
416 # can be used to deploy elsewhere later eg. Nexus staging / snapshot repos.
418 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
419 # Ensure we fail the job if any steps fail.
425 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
426 # shellcheck disable=SC2086
428 --global-settings "$GLOBAL_SETTINGS_FILE" \
429 --settings "$SETTINGS_FILE" \
430 -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \
431 $MAVEN_OPTIONS $MAVEN_PARAMS
434 # SPDX-License-Identifier: EPL-1.0
435 ##############################################################################
436 # Copyright (c) 2017 The Linux Foundation and others.
438 # All rights reserved. This program and the accompanying materials
439 # are made available under the terms of the Eclipse Public License v1.0
440 # which accompanies this distribution, and is available at
441 # http://www.eclipse.org/legal/epl-v10.html
442 ##############################################################################
444 # This script publishes artifacts to a staging repo in Nexus.
446 # $WORKSPACE/m2repo : Exists and used to deploy the staging repository.
447 # $NEXUS_URL : Jenkins global variable should be defined.
448 # $STAGING_PROFILE_ID : Provided by a job parameter.
450 # Ensure we fail the job if any steps fail.
453 TMP_FILE="$(mktemp)"
454 lftools deploy nexus-stage "$NEXUS_URL" "$STAGING_PROFILE_ID" "$WORKSPACE/m2repo" | tee "$TMP_FILE"
455 staging_repo=$(sed -n -e 's/Staging repository \(.*\) created\./\1/p' "$TMP_FILE")
457 # Store repo info to a file in archives
458 mkdir -p "$WORKSPACE/archives"
459 echo "$staging_repo" > "$WORKSPACE/archives/staging-repo.txt"
462 rm "$TMP_FILE"
464 </hudson.tasks.Shell>
467 set +e # DO NOT cause build failure if any of the rm calls fail.
469 rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
471 # In some cases we use the lf-provide-maven-settings macro to produce
472 # a "$HOME/.netrc" file containing credentials. Remove that file here
474 rm "$HOME/.netrc"
476 # DO NOT fail build if any of the above lines fail.
479 </hudson.tasks.Shell>
482 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
486 # SPDX-License-Identifier: EPL-1.0
487 ##############################################################################
488 # Copyright (c) 2017 The Linux Foundation and others.
490 # All rights reserved. This program and the accompanying materials
491 # are made available under the terms of the Eclipse Public License v1.0
492 # which accompanies this distribution, and is available at
493 # http://www.eclipse.org/legal/epl-v10.html
494 ##############################################################################
495 echo "---> sysstat.sh"
496 set +e # DON'T fail build if script fails.
498 OS=$(facter operatingsystem)
499 case "$OS" in
501 SYSSTAT_PATH="/var/log/sysstat"
503 # Dont run the script when systat is not enabled by default
504 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
509 SYSSTAT_PATH="/var/log/sa"
517 SAR_DIR="$WORKSPACE/archives/sar-reports"
518 mkdir -p "$SAR_DIR"
519 cp "$SYSSTAT_PATH/"* "$_"
520 # convert sar data to ascii format
521 while IFS="" read -r sarfilenum
523 [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}"
524 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
526 # DON'T fail build if script fails.
529 </hudson.tasks.Shell>
530 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
532 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
533 <fileId>jenkins-log-archives-settings</fileId>
535 <variable>SETTINGS_FILE</variable>
536 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
538 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
541 <propertiesContent>SERVER_ID=logs</propertiesContent>
546 # SPDX-License-Identifier: EPL-1.0
547 ##############################################################################
548 # Copyright (c) 2017 The Linux Foundation and others.
550 # All rights reserved. This program and the accompanying materials
551 # are made available under the terms of the Eclipse Public License v1.0
552 # which accompanies this distribution, and is available at
553 # http://www.eclipse.org/legal/epl-v10.html
554 ##############################################################################
555 echo "---> create-netrc.sh"
557 # Ensure we fail the job if any steps fail.
560 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
561 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
562 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
563 -v x:username -o ":" -v x:password \
564 "$SETTINGS_FILE")
566 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
567 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
568 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
570 echo "machine ${machine%:*} login $user password $pass" > ~/.netrc
572 </hudson.tasks.Shell>
575 # SPDX-License-Identifier: EPL-1.0
576 ##############################################################################
577 # Copyright (c) 2017 The Linux Foundation and others.
579 # All rights reserved. This program and the accompanying materials
580 # are made available under the terms of the Eclipse Public License v1.0
581 # which accompanies this distribution, and is available at
582 # http://www.eclipse.org/legal/epl-v10.html
583 ##############################################################################
584 echo "---> lftools-install.sh"
586 # Script to install lftools via a version passed in via lf-infra-parameters
588 # Required parameters:
590 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
591 # set to a strict version number like '1.2.3' or using
592 # PEP-440 definitions.
596 # >=1.0.0,<2.0.0
598 # By default a released version of lftools should always be used.
599 # The purpose of the 2 variables below is so that lftools devs can test
600 # unreleased versions of lftools. There are 2 methods to install a dev version
603 # 1) gerrit patch: Used to test a patch that has not yet been merged.
604 # To do this set something like this:
605 # LFTOOLS_MODE=gerrit
606 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
608 # 2) git branch: Used to install an lftools version from a specific branch.
609 # To use this set the variables as follows:
611 # LFTOOLS_REFSPEC=master
613 # 3) release : The intended use case and default setting.
614 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
616 LFTOOLS_MODE=release # release | git | gerrit
617 LFTOOLS_REFSPEC=master
619 # Ensure we fail the job if any steps fail.
620 # DO NOT set -u as virtualenv's activate script has unbound variables
623 virtualenv --quiet "/tmp/v/lftools"
624 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
625 source "/tmp/v/lftools/bin/activate"
626 pip install --quiet --upgrade pip
628 case $LFTOOLS_MODE in
630 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
632 git fetch origin "$LFTOOLS_REFSPEC"
633 git checkout FETCH_HEAD
634 pip install --quiet --upgrade -r requirements.txt
635 pip install --quiet --upgrade -e .
640 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
644 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
645 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
648 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
654 # pipdeptree prints out a lot of information because lftools pulls in many
655 # dependencies. Let's only print it if we want to debug.
656 # echo "----> Pip Dependency Tree"
657 # pip install --quiet --upgrade pipdeptree
661 # SPDX-License-Identifier: EPL-1.0
662 ##############################################################################
663 # Copyright (c) 2017 The Linux Foundation and others.
665 # All rights reserved. This program and the accompanying materials
666 # are made available under the terms of the Eclipse Public License v1.0
667 # which accompanies this distribution, and is available at
668 # http://www.eclipse.org/legal/epl-v10.html
669 ##############################################################################
670 echo "---> logs-deploy.sh"
672 # Ensure we fail the job if any steps fail.
675 set -x # Trace commands for this script to make debugging easier.
677 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
678 LOGS_SERVER="${LOGS_SERVER:-None}"
680 if [ "${LOGS_SERVER}" == 'None' ]
682 set +x # Disable trace since we no longer need it
684 echo "WARNING: Logging server not set"
686 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
687 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
688 BUILD_URL="${BUILD_URL}"
690 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
691 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
693 set +x # Disable trace since we no longer need it.
695 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
698 </hudson.tasks.Shell>
701 # SPDX-License-Identifier: EPL-1.0
702 ##############################################################################
703 # Copyright (c) 2017 The Linux Foundation and others.
705 # All rights reserved. This program and the accompanying materials
706 # are made available under the terms of the Eclipse Public License v1.0
707 # which accompanies this distribution, and is available at
708 # http://www.eclipse.org/legal/epl-v10.html
709 ##############################################################################
711 # Clear log credential files
712 rm "$SETTINGS_FILE"
715 </hudson.tasks.Shell>
716 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
717 <regexp>^Build logs: .*</regexp>
718 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
720 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
721 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
722 <markBuildUnstable>false</markBuildUnstable>
723 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
724 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
726 <hudson.plugins.ws__cleanup.Pattern>
727 <pattern>**/*.jenkins-trigger</pattern>
729 </hudson.plugins.ws__cleanup.Pattern>
731 <deleteDirs>false</deleteDirs>
732 <cleanupMatrixParent>false</cleanupMatrixParent>
734 <cleanWhenSuccess>true</cleanWhenSuccess>
735 <cleanWhenUnstable>true</cleanWhenUnstable>
736 <cleanWhenFailure>true</cleanWhenFailure>
737 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
738 <cleanWhenAborted>true</cleanWhenAborted>
739 <notFailBuild>true</notFailBuild>
740 </hudson.plugins.ws__cleanup.WsCleanup>
743 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
744 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
745 <timeoutMinutes>30</timeoutMinutes>
746 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
747 <failBuild>true</failBuild>
748 <writingDescription>false</writingDescription>
749 <timeoutPercentage>0</timeoutPercentage>
750 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
751 <timeoutType>absolute</timeoutType>
752 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
753 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
754 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
755 <user>test-credential</user>
756 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
757 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
758 <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
760 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
761 <fileId>npmrc</fileId>
762 <targetLocation>$HOME/.npmrc</targetLocation>
764 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
766 </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>