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 </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="hudson.plugins.git.util.DefaultBuildChooser"/>
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 <hudson.triggers.TimerTrigger>
154 </hudson.triggers.TimerTrigger>
155 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
158 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
159 <compareType>ANT</compareType>
160 <pattern>releng/ciman</pattern>
162 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
163 <compareType>ANT</compareType>
164 <pattern>**/master</pattern>
165 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
167 <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
168 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
171 <onSuccessful>false</onSuccessful>
172 <onFailed>false</onFailed>
173 <onUnstable>false</onUnstable>
174 <onNotBuilt>false</onNotBuilt>
176 <silentMode>false</silentMode>
177 <silentStartMode>false</silentStartMode>
178 <escapeQuotes>true</escapeQuotes>
179 <noNameAndEmailParameters>false</noNameAndEmailParameters>
180 <readableMessage>false</readableMessage>
181 <dependencyJobsNames/>
183 <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
185 <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
187 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
188 <commentAddedCommentContains>build release$</commentAddedCommentContains>
189 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
192 <buildFailureMessage/>
193 <buildSuccessfulMessage/>
194 <buildUnstableMessage/>
195 <buildNotBuiltMessage/>
196 <buildUnsuccessfulFilepath/>
198 <serverName>test-server</serverName>
199 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
203 <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
204 </hudson.tasks.Shell>
206 <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
207 </hudson.tasks.Shell>
209 <targets>--version</targets>
211 <mavenName>mvn33</mavenName>
212 <usePrivateRepository>false</usePrivateRepository>
213 <settings class="jenkins.mvn.DefaultSettingsProvider"/>
214 <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
215 </hudson.tasks.Maven>
217 <command>rm "$HOME/.wgetrc"</command>
218 </hudson.tasks.Shell>
219 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
221 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
222 <fileId>global-settings</fileId>
224 <variable>GLOBAL_SETTINGS_FILE</variable>
225 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
226 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
227 <fileId>gerrit-maven-project-settings</fileId>
229 <variable>SETTINGS_FILE</variable>
230 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
232 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
235 <propertiesContent>SERVER_ID=project-staging</propertiesContent>
240 # SPDX-License-Identifier: EPL-1.0
241 ##############################################################################
242 # Copyright (c) 2017 The Linux Foundation and others.
244 # All rights reserved. This program and the accompanying materials
245 # are made available under the terms of the Eclipse Public License v1.0
246 # which accompanies this distribution, and is available at
247 # http://www.eclipse.org/legal/epl-v10.html
248 ##############################################################################
249 echo "---> create-netrc.sh"
251 # Ensure we fail the job if any steps fail.
254 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
255 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
256 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
257 -v x:username -o ":" -v x:password \
258 "$SETTINGS_FILE")
260 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
261 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
262 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
264 echo "machine ${machine%:*} login $user password $pass" > ~/.netrc
266 </hudson.tasks.Shell>
269 # SPDX-License-Identifier: EPL-1.0
270 ##############################################################################
271 # Copyright (c) 2017 The Linux Foundation and others.
273 # All rights reserved. This program and the accompanying materials
274 # are made available under the terms of the Eclipse Public License v1.0
275 # which accompanies this distribution, and is available at
276 # http://www.eclipse.org/legal/epl-v10.html
277 ##############################################################################
278 echo "---> lftools-install.sh"
280 # Script to install lftools via a version passed in via lf-infra-parameters
282 # Required parameters:
284 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
285 # set to a strict version number like '1.2.3' or using
286 # PEP-440 definitions.
290 # >=1.0.0,<2.0.0
292 # By default a released version of lftools should always be used.
293 # The purpose of the 2 variables below is so that lftools devs can test
294 # unreleased versions of lftools. There are 2 methods to install a dev version
297 # 1) gerrit patch: Used to test a patch that has not yet been merged.
298 # To do this set something like this:
299 # LFTOOLS_MODE=gerrit
300 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
302 # 2) git branch: Used to install an lftools version from a specific branch.
303 # To use this set the variables as follows:
305 # LFTOOLS_REFSPEC=master
307 # 3) release : The intended use case and default setting.
308 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
310 LFTOOLS_MODE=release # release | git | gerrit
311 LFTOOLS_REFSPEC=master
313 # Ensure we fail the job if any steps fail.
314 # DO NOT set -u as virtualenv's activate script has unbound variables
317 virtualenv --quiet "/tmp/v/lftools"
318 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
319 source "/tmp/v/lftools/bin/activate"
320 pip install --quiet --upgrade pip
322 case $LFTOOLS_MODE in
324 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
326 git fetch origin "$LFTOOLS_REFSPEC"
327 git checkout FETCH_HEAD
328 pip install --quiet --upgrade -r requirements.txt
329 pip install --quiet --upgrade -e .
334 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
338 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
339 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
342 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
348 # pipdeptree prints out a lot of information because lftools pulls in many
349 # dependencies. Let's only print it if we want to debug.
350 # echo "----> Pip Dependency Tree"
351 # pip install --quiet --upgrade pipdeptree
355 # SPDX-License-Identifier: EPL-1.0
356 ##############################################################################
357 # Copyright (c) 2017 The Linux Foundation and others.
359 # All rights reserved. This program and the accompanying materials
360 # are made available under the terms of the Eclipse Public License v1.0
361 # which accompanies this distribution, and is available at
362 # http://www.eclipse.org/legal/epl-v10.html
363 ##############################################################################
365 # This file contains a list of variables that are generally useful in many
366 # scripts. It is meant to be sourced in other scripts so that the variables can
369 MAVEN_OPTIONS="$(echo --show-version \
372 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
373 -Dmaven.repo.local=/tmp/r \
374 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)"
375 echo "$MAVEN_OPTIONS"
378 # SPDX-License-Identifier: EPL-1.0
379 ##############################################################################
380 # Copyright (c) 2017 The Linux Foundation and others.
382 # All rights reserved. This program and the accompanying materials
383 # are made available under the terms of the Eclipse Public License v1.0
384 # which accompanies this distribution, and is available at
385 # http://www.eclipse.org/legal/epl-v10.html
386 ##############################################################################
388 # This script removes the -SNAPSHOT from a project to prepare it for release.
390 PATCH_DIR="$WORKSPACE/archives/patches"
391 mkdir -p "$PATCH_DIR"
393 # Ensure we fail the job if any steps fail.
396 echo "$PROJECT" "$(git rev-parse --verify HEAD)" | tee -a "$PATCH_DIR/taglist.log"
398 # Strip -SNAPSHOT from version to prepare release.
399 find . -name "*.xml" -print0 | xargs -0 sed -i 's/-SNAPSHOT//g'
401 git commit -am "Release $PROJECT"
402 git format-patch --stdout "origin/$GERRIT_BRANCH" > "$PATCH_DIR/${PROJECT//\//-}.patch"
403 git bundle create "$PATCH_DIR/${PROJECT//\//-}.bundle" "origin/${GERRIT_BRANCH}..HEAD"
406 # SPDX-License-Identifier: EPL-1.0
407 ##############################################################################
408 # Copyright (c) 2017 The Linux Foundation and others.
410 # All rights reserved. This program and the accompanying materials
411 # are made available under the terms of the Eclipse Public License v1.0
412 # which accompanies this distribution, and is available at
413 # http://www.eclipse.org/legal/epl-v10.html
414 ##############################################################################
416 # This script builds a Maven project and deploys it into a staging repo which
417 # can be used to deploy elsewhere later eg. Nexus staging / snapshot repos.
419 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
420 # Ensure we fail the job if any steps fail.
426 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
427 # shellcheck disable=SC2086
429 --global-settings "$GLOBAL_SETTINGS_FILE" \
430 --settings "$SETTINGS_FILE" \
431 -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \
432 $MAVEN_PARAMS $MAVEN_OPTIONS
435 # SPDX-License-Identifier: EPL-1.0
436 ##############################################################################
437 # Copyright (c) 2017 The Linux Foundation and others.
439 # All rights reserved. This program and the accompanying materials
440 # are made available under the terms of the Eclipse Public License v1.0
441 # which accompanies this distribution, and is available at
442 # http://www.eclipse.org/legal/epl-v10.html
443 ##############################################################################
445 # This script publishes artifacts to a staging repo in Nexus.
447 # $WORKSPACE/m2repo : Exists and used to deploy the staging repository.
448 # $NEXUS_URL : Jenkins global variable should be defined.
449 # $STAGING_PROFILE_ID : Provided by a job parameter.
451 # Ensure we fail the job if any steps fail.
454 TMP_FILE="$(mktemp)"
455 lftools deploy nexus-stage "$NEXUS_URL" "$STAGING_PROFILE_ID" "$WORKSPACE/m2repo" | tee "$TMP_FILE"
456 staging_repo=$(sed -n -e 's/Staging repository \(.*\) created\./\1/p' "$TMP_FILE")
458 # Store repo info to a file in archives
459 mkdir -p "$WORKSPACE/archives"
460 echo "$staging_repo" > "$WORKSPACE/archives/staging-repo.txt"
463 rm "$TMP_FILE"
465 </hudson.tasks.Shell>
468 set +e # DO NOT cause build failure if any of the rm calls fail.
470 rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
472 # In some cases we use the lf-provide-maven-settings macro to produce
473 # a "$HOME/.netrc" file containing credentials. Remove that file here
475 rm "$HOME/.netrc"
477 # DO NOT fail build if any of the above lines fail.
480 </hudson.tasks.Shell>
483 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
487 # SPDX-License-Identifier: EPL-1.0
488 ##############################################################################
489 # Copyright (c) 2017 The Linux Foundation and others.
491 # All rights reserved. This program and the accompanying materials
492 # are made available under the terms of the Eclipse Public License v1.0
493 # which accompanies this distribution, and is available at
494 # http://www.eclipse.org/legal/epl-v10.html
495 ##############################################################################
496 echo "---> sysstat.sh"
497 set +e # DON'T fail build if script fails.
499 OS=$(facter operatingsystem)
500 case "$OS" in
502 SYSSTAT_PATH="/var/log/sysstat"
504 # Dont run the script when systat is not enabled by default
505 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
510 SYSSTAT_PATH="/var/log/sa"
518 SAR_DIR="$WORKSPACE/archives/sar-reports"
519 mkdir -p "$SAR_DIR"
520 cp "$SYSSTAT_PATH/"* "$_"
521 # convert sar data to ascii format
522 while IFS="" read -r s
524 [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/sar${s//[!0-9]/}"
525 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
527 # DON'T fail build if script fails.
530 </hudson.tasks.Shell>
531 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
533 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
534 <fileId>jenkins-log-archives-settings</fileId>
536 <variable>SETTINGS_FILE</variable>
537 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
539 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
542 <propertiesContent>SERVER_ID=logs</propertiesContent>
547 # SPDX-License-Identifier: EPL-1.0
548 ##############################################################################
549 # Copyright (c) 2017 The Linux Foundation and others.
551 # All rights reserved. This program and the accompanying materials
552 # are made available under the terms of the Eclipse Public License v1.0
553 # which accompanies this distribution, and is available at
554 # http://www.eclipse.org/legal/epl-v10.html
555 ##############################################################################
556 echo "---> create-netrc.sh"
558 # Ensure we fail the job if any steps fail.
561 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
562 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
563 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
564 -v x:username -o ":" -v x:password \
565 "$SETTINGS_FILE")
567 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
568 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
569 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
571 echo "machine ${machine%:*} login $user password $pass" > ~/.netrc
573 </hudson.tasks.Shell>
576 # SPDX-License-Identifier: EPL-1.0
577 ##############################################################################
578 # Copyright (c) 2017 The Linux Foundation and others.
580 # All rights reserved. This program and the accompanying materials
581 # are made available under the terms of the Eclipse Public License v1.0
582 # which accompanies this distribution, and is available at
583 # http://www.eclipse.org/legal/epl-v10.html
584 ##############################################################################
585 echo "---> lftools-install.sh"
587 # Script to install lftools via a version passed in via lf-infra-parameters
589 # Required parameters:
591 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
592 # set to a strict version number like '1.2.3' or using
593 # PEP-440 definitions.
597 # >=1.0.0,<2.0.0
599 # By default a released version of lftools should always be used.
600 # The purpose of the 2 variables below is so that lftools devs can test
601 # unreleased versions of lftools. There are 2 methods to install a dev version
604 # 1) gerrit patch: Used to test a patch that has not yet been merged.
605 # To do this set something like this:
606 # LFTOOLS_MODE=gerrit
607 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
609 # 2) git branch: Used to install an lftools version from a specific branch.
610 # To use this set the variables as follows:
612 # LFTOOLS_REFSPEC=master
614 # 3) release : The intended use case and default setting.
615 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
617 LFTOOLS_MODE=release # release | git | gerrit
618 LFTOOLS_REFSPEC=master
620 # Ensure we fail the job if any steps fail.
621 # DO NOT set -u as virtualenv's activate script has unbound variables
624 virtualenv --quiet "/tmp/v/lftools"
625 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
626 source "/tmp/v/lftools/bin/activate"
627 pip install --quiet --upgrade pip
629 case $LFTOOLS_MODE in
631 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
633 git fetch origin "$LFTOOLS_REFSPEC"
634 git checkout FETCH_HEAD
635 pip install --quiet --upgrade -r requirements.txt
636 pip install --quiet --upgrade -e .
641 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
645 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
646 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
649 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
655 # pipdeptree prints out a lot of information because lftools pulls in many
656 # dependencies. Let's only print it if we want to debug.
657 # echo "----> Pip Dependency Tree"
658 # pip install --quiet --upgrade pipdeptree
662 # SPDX-License-Identifier: EPL-1.0
663 ##############################################################################
664 # Copyright (c) 2017 The Linux Foundation and others.
666 # All rights reserved. This program and the accompanying materials
667 # are made available under the terms of the Eclipse Public License v1.0
668 # which accompanies this distribution, and is available at
669 # http://www.eclipse.org/legal/epl-v10.html
670 ##############################################################################
671 echo "---> logs-deploy.sh"
673 # Ensure we fail the job if any steps fail.
676 set -x # Trace commands for this script to make debugging easier.
678 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
679 LOGS_SERVER="${LOGS_SERVER:-None}"
681 if [ "${LOGS_SERVER}" == 'None' ]
683 set +x # Disable trace since we no longer need it
685 echo "WARNING: Logging server not set"
687 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
688 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
689 BUILD_URL="${BUILD_URL}"
691 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
692 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
694 set +x # Disable trace since we no longer need it.
696 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
699 </hudson.tasks.Shell>
702 # SPDX-License-Identifier: EPL-1.0
703 ##############################################################################
704 # Copyright (c) 2017 The Linux Foundation and others.
706 # All rights reserved. This program and the accompanying materials
707 # are made available under the terms of the Eclipse Public License v1.0
708 # which accompanies this distribution, and is available at
709 # http://www.eclipse.org/legal/epl-v10.html
710 ##############################################################################
712 # Clear log credential files
713 rm "$SETTINGS_FILE"
716 </hudson.tasks.Shell>
717 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
718 <regexp>^Build logs: .*</regexp>
719 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
721 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
722 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
723 <markBuildUnstable>false</markBuildUnstable>
724 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
725 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
727 <hudson.plugins.ws__cleanup.Pattern>
728 <pattern>**/*.jenkins-trigger</pattern>
730 </hudson.plugins.ws__cleanup.Pattern>
732 <deleteDirs>false</deleteDirs>
733 <cleanupMatrixParent>false</cleanupMatrixParent>
735 <cleanWhenSuccess>true</cleanWhenSuccess>
736 <cleanWhenUnstable>true</cleanWhenUnstable>
737 <cleanWhenFailure>true</cleanWhenFailure>
738 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
739 <cleanWhenAborted>true</cleanWhenAborted>
740 <notFailBuild>true</notFailBuild>
741 </hudson.plugins.ws__cleanup.WsCleanup>
744 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
745 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
746 <timeoutMinutes>30</timeoutMinutes>
747 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
748 <failBuild>true</failBuild>
749 <writingDescription>false</writingDescription>
750 <timeoutPercentage>0</timeoutPercentage>
751 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
752 <timeoutType>absolute</timeoutType>
753 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
754 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
755 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
756 <user>test-credential</user>
757 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
758 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>