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 <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>
129 <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
130 <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
131 <authorOrCommitter>false</authorOrCommitter>
132 <wipeOutWorkspace>true</wipeOutWorkspace>
133 <pruneBranches>false</pruneBranches>
134 <remotePoll>false</remotePoll>
135 <gitTool>Default</gitTool>
136 <submoduleCfg class="list"/>
141 <skipTag>true</skipTag>
143 <useShallowClone>false</useShallowClone>
144 <ignoreNotifyCommit>false</ignoreNotifyCommit>
146 <hudson.plugins.git.extensions.impl.SubmoduleOption>
147 <disableSubmodules>false</disableSubmodules>
148 <recursiveSubmodules>true</recursiveSubmodules>
149 <trackingSubmodules>false</trackingSubmodules>
151 <timeout>10</timeout>
152 </hudson.plugins.git.extensions.impl.SubmoduleOption>
153 <hudson.plugins.git.extensions.impl.WipeWorkspace/>
156 <triggers class="vector">
157 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
160 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
161 <compareType>ANT</compareType>
162 <pattern>releng/ciman</pattern>
164 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
165 <compareType>ANT</compareType>
166 <pattern>**/master</pattern>
167 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
170 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
171 <compareType>ANT</compareType>
172 <pattern>**</pattern>
173 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
175 <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
176 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
179 <onSuccessful>false</onSuccessful>
180 <onFailed>false</onFailed>
181 <onUnstable>false</onUnstable>
182 <onNotBuilt>false</onNotBuilt>
184 <silentMode>false</silentMode>
185 <silentStartMode>false</silentStartMode>
186 <escapeQuotes>true</escapeQuotes>
187 <noNameAndEmailParameters>false</noNameAndEmailParameters>
188 <readableMessage>false</readableMessage>
189 <dependencyJobsNames/>
191 <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
193 <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
195 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
196 <commentAddedCommentContains>recheck: [0-9 ]+</commentAddedCommentContains>
197 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
200 <buildFailureMessage/>
201 <buildSuccessfulMessage/>
202 <buildUnstableMessage/>
203 <buildNotBuiltMessage/>
204 <buildUnsuccessfulFilepath/>
206 <serverName>test-server</serverName>
207 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
211 <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
212 </hudson.tasks.Shell>
214 <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
215 </hudson.tasks.Shell>
217 <targets>--version</targets>
219 <mavenName>mvn33</mavenName>
220 <usePrivateRepository>false</usePrivateRepository>
221 <settings class="jenkins.mvn.DefaultSettingsProvider"/>
222 <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
223 </hudson.tasks.Maven>
225 <command>rm "$HOME/.wgetrc"</command>
226 </hudson.tasks.Shell>
227 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
229 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
230 <fileId>global-settings</fileId>
232 <variable>GLOBAL_SETTINGS_FILE</variable>
233 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
234 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
235 <fileId>gerrit-maven-project-settings</fileId>
237 <variable>SETTINGS_FILE</variable>
238 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
240 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
243 # SPDX-License-Identifier: EPL-1.0
244 ##############################################################################
245 # Copyright (c) 2017 The Linux Foundation and others.
247 # All rights reserved. This program and the accompanying materials
248 # are made available under the terms of the Eclipse Public License v1.0
249 # which accompanies this distribution, and is available at
250 # http://www.eclipse.org/legal/epl-v10.html
251 ##############################################################################
252 # Fetches patches all projects provided by comment trigger
254 # Takes a list of Gerrit patches and fetches all projects and cherry-pick
255 # patches for projects. The trigger is
256 # 'recheck: SPACE_SEPERATED_LIST_OF_PATCHES'
258 # NOTE: This script assumes the user will provide the correct dependency order
259 # via the PATCHES list.
261 # Ensure we fail the job if any steps fail.
264 REPOS_DIR="$WORKSPACE/.repos"
266 PATCHES=($(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep 'recheck:' | awk -F: '{print $2}'))
269 for patch in $(echo "${PATCHES[@]}"); do
270 json=$(curl -s "$GERRIT_URL/changes/$patch" | sed -e "s/)]}'//")
271 project=$(echo "$json" | jq -r '.project')
272 branch=$(echo "$json" | jq -r '.branch')
274 if [ ! -d "$REPOS_DIR/$project" ]; then
275 git clone -q --depth 1 -b "$branch" "$GIT_URL/$project" "$REPOS_DIR/$project"
277 # This array will be used later to determine project build order.
278 projects+=("$project")
281 pushd "$REPOS_DIR/$project"
282 git remote add gerrit "$GIT_URL/$project"
283 git review --cherrypick="$patch"
287 # This script should be a macro which re-inject's the projects variable back
288 # into the build so a script later on can use it.
289 echo "DEPENDENCY_BUILD_ORDER=${projects[*]}" > "$WORKSPACE/.dependency.properties"
291 </hudson.tasks.Shell>
294 <propertiesFilePath>$WORKSPACE/.dependency.properties</propertiesFilePath>
299 # SPDX-License-Identifier: EPL-1.0
300 ##############################################################################
301 # Copyright (c) 2017 The Linux Foundation and others.
303 # All rights reserved. This program and the accompanying materials
304 # are made available under the terms of the Eclipse Public License v1.0
305 # which accompanies this distribution, and is available at
306 # http://www.eclipse.org/legal/epl-v10.html
307 ##############################################################################
309 # This file contains a list of variables that are generally useful in many
310 # scripts. It is meant to be sourced in other scripts so that the variables can
313 MAVEN_OPTIONS="$(echo --show-version \
316 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
317 -Dmaven.repo.local=/tmp/r \
318 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)"
319 echo "$MAVEN_OPTIONS"
322 # SPDX-License-Identifier: EPL-1.0
323 ##############################################################################
324 # Copyright (c) 2017 The Linux Foundation and others.
326 # All rights reserved. This program and the accompanying materials
327 # are made available under the terms of the Eclipse Public License v1.0
328 # which accompanies this distribution, and is available at
329 # http://www.eclipse.org/legal/epl-v10.html
330 ##############################################################################
332 # Builds projects provided via $DEPENDENCY_BUILD_ORDER list
334 # This runs a `mvn clean install` against all projects provided by a list. This
335 # script is a companion script for the gerrit-fetch-dependencies script which
336 # clones project repos to "$WORKSPACE/.repos".
338 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
339 # Ensure we fail the job if any steps fail.
343 PROJECTS=($(echo "$DEPENDENCY_BUILD_ORDER"))
344 REPOS_DIR="$WORKSPACE/.repos"
348 for project in "${PROJECTS[@]}"; do
349 pushd "$REPOS_DIR/$project"
350 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
351 # shellcheck disable=SC2086
355 --global-settings "$GLOBAL_SETTINGS_FILE" \
356 --settings "$SETTINGS_FILE" \
357 $MAVEN_PARAMS $MAVEN_OPTIONS
361 </hudson.tasks.Shell>
364 # SPDX-License-Identifier: EPL-1.0
365 ##############################################################################
366 # Copyright (c) 2017 The Linux Foundation and others.
368 # All rights reserved. This program and the accompanying materials
369 # are made available under the terms of the Eclipse Public License v1.0
370 # which accompanies this distribution, and is available at
371 # http://www.eclipse.org/legal/epl-v10.html
372 ##############################################################################
374 # This file contains a list of variables that are generally useful in many
375 # scripts. It is meant to be sourced in other scripts so that the variables can
378 MAVEN_OPTIONS="$(echo --show-version \
381 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
382 -Dmaven.repo.local=/tmp/r \
383 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)"
384 echo "$MAVEN_OPTIONS"
387 # SPDX-License-Identifier: EPL-1.0
388 ##############################################################################
389 # Copyright (c) 2017 The Linux Foundation and others.
391 # All rights reserved. This program and the accompanying materials
392 # are made available under the terms of the Eclipse Public License v1.0
393 # which accompanies this distribution, and is available at
394 # http://www.eclipse.org/legal/epl-v10.html
395 ##############################################################################
397 # This script builds a Maven project and deploys it into a staging repo which
398 # can be used to deploy elsewhere later eg. Nexus staging / snapshot repos.
400 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
401 # Ensure we fail the job if any steps fail.
407 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
408 # shellcheck disable=SC2086
410 --global-settings "$GLOBAL_SETTINGS_FILE" \
411 --settings "$SETTINGS_FILE" \
412 -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \
413 $MAVEN_PARAMS $MAVEN_OPTIONS
415 </hudson.tasks.Shell>
418 set +e # DO NOT cause build failure if any of the rm calls fail.
420 rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
422 # In some cases we use the lf-provide-maven-settings macro to produce
423 # a "$HOME/.netrc" file containing credentials. Remove that file here
425 rm "$HOME/.netrc"
427 # DO NOT fail build if any of the above lines fail.
430 </hudson.tasks.Shell>
433 <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs">
434 <isRankActivated>false</isRankActivated>
439 <thresholdLimit>low</thresholdLimit>
440 <pluginName>[FINDBUGS] </pluginName>
442 <canRunOnFailed>false</canRunOnFailed>
443 <useStableBuildAsReference>false</useStableBuildAsReference>
444 <usePreviousBuildAsReference>false</usePreviousBuildAsReference>
445 <useDeltaValues>false</useDeltaValues>
449 <unstableTotalNormal/>
456 <shouldDetectModules>false</shouldDetectModules>
457 <dontComputeNew>true</dontComputeNew>
458 <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
460 </hudson.plugins.findbugs.FindBugsPublisher>
461 <hudson.plugins.jacoco.JacocoPublisher>
462 <execPattern>**/**.exec</execPattern>
463 <classPattern>**/classes</classPattern>
464 <sourcePattern>**/src/main/java</sourcePattern>
467 <exclusionPattern>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</exclusionPattern>
468 <maximumBranchCoverage>10</maximumBranchCoverage>
469 <minimumBranchCoverage>20</minimumBranchCoverage>
470 <maximumMethodCoverage>50</maximumMethodCoverage>
471 <minimumMethodCoverage>40</minimumMethodCoverage>
472 </hudson.plugins.jacoco.JacocoPublisher>
473 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
477 # SPDX-License-Identifier: EPL-1.0
478 ##############################################################################
479 # Copyright (c) 2017 The Linux Foundation and others.
481 # All rights reserved. This program and the accompanying materials
482 # are made available under the terms of the Eclipse Public License v1.0
483 # which accompanies this distribution, and is available at
484 # http://www.eclipse.org/legal/epl-v10.html
485 ##############################################################################
486 echo "---> sysstat.sh"
487 set +e # DON'T fail build if script fails.
489 OS=$(facter operatingsystem)
490 case "$OS" in
492 SYSSTAT_PATH="/var/log/sysstat"
494 # Dont run the script when systat is not enabled by default
495 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
500 SYSSTAT_PATH="/var/log/sa"
508 SAR_DIR="$WORKSPACE/archives/sar-reports"
509 mkdir -p "$SAR_DIR"
510 cp "$SYSSTAT_PATH/"* "$_"
511 # convert sar data to ascii format
512 while IFS="" read -r sarfilenum
514 [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}"
515 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
517 # DON'T fail build if script fails.
520 </hudson.tasks.Shell>
521 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
523 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
524 <fileId>jenkins-log-archives-settings</fileId>
526 <variable>SETTINGS_FILE</variable>
527 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
529 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
532 <propertiesContent>SERVER_ID=logs</propertiesContent>
537 # SPDX-License-Identifier: EPL-1.0
538 ##############################################################################
539 # Copyright (c) 2017 The Linux Foundation and others.
541 # All rights reserved. This program and the accompanying materials
542 # are made available under the terms of the Eclipse Public License v1.0
543 # which accompanies this distribution, and is available at
544 # http://www.eclipse.org/legal/epl-v10.html
545 ##############################################################################
546 echo "---> create-netrc.sh"
548 # Ensure we fail the job if any steps fail.
551 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
552 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
553 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
554 -v x:username -o ":" -v x:password \
555 "$SETTINGS_FILE")
557 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
558 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
559 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
561 echo "machine ${machine%:*} login $user password $pass" > ~/.netrc
563 </hudson.tasks.Shell>
566 # SPDX-License-Identifier: EPL-1.0
567 ##############################################################################
568 # Copyright (c) 2017 The Linux Foundation and others.
570 # All rights reserved. This program and the accompanying materials
571 # are made available under the terms of the Eclipse Public License v1.0
572 # which accompanies this distribution, and is available at
573 # http://www.eclipse.org/legal/epl-v10.html
574 ##############################################################################
575 echo "---> lftools-install.sh"
577 # Script to install lftools via a version passed in via lf-infra-parameters
579 # Required parameters:
581 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
582 # set to a strict version number like '1.2.3' or using
583 # PEP-440 definitions.
587 # >=1.0.0,<2.0.0
589 # By default a released version of lftools should always be used.
590 # The purpose of the 2 variables below is so that lftools devs can test
591 # unreleased versions of lftools. There are 2 methods to install a dev version
594 # 1) gerrit patch: Used to test a patch that has not yet been merged.
595 # To do this set something like this:
596 # LFTOOLS_MODE=gerrit
597 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
599 # 2) git branch: Used to install an lftools version from a specific branch.
600 # To use this set the variables as follows:
602 # LFTOOLS_REFSPEC=master
604 # 3) release : The intended use case and default setting.
605 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
607 LFTOOLS_MODE=release # release | git | gerrit
608 LFTOOLS_REFSPEC=master
610 # Ensure we fail the job if any steps fail.
611 # DO NOT set -u as virtualenv's activate script has unbound variables
614 virtualenv --quiet "/tmp/v/lftools"
615 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
616 source "/tmp/v/lftools/bin/activate"
617 pip install --quiet --upgrade pip
619 case $LFTOOLS_MODE in
621 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
623 git fetch origin "$LFTOOLS_REFSPEC"
624 git checkout FETCH_HEAD
625 pip install --quiet --upgrade -r requirements.txt
626 pip install --quiet --upgrade -e .
631 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
635 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
636 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
639 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
645 # pipdeptree prints out a lot of information because lftools pulls in many
646 # dependencies. Let's only print it if we want to debug.
647 # echo "----> Pip Dependency Tree"
648 # pip install --quiet --upgrade pipdeptree
652 # SPDX-License-Identifier: EPL-1.0
653 ##############################################################################
654 # Copyright (c) 2017 The Linux Foundation and others.
656 # All rights reserved. This program and the accompanying materials
657 # are made available under the terms of the Eclipse Public License v1.0
658 # which accompanies this distribution, and is available at
659 # http://www.eclipse.org/legal/epl-v10.html
660 ##############################################################################
661 echo "---> logs-deploy.sh"
663 # Ensure we fail the job if any steps fail.
666 set -x # Trace commands for this script to make debugging easier.
668 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
669 LOGS_SERVER="${LOGS_SERVER:-None}"
671 if [ "${LOGS_SERVER}" == 'None' ]
673 set +x # Disable trace since we no longer need it
675 echo "WARNING: Logging server not set"
677 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
678 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
679 BUILD_URL="${BUILD_URL}"
681 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
682 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
684 set +x # Disable trace since we no longer need it.
686 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
689 </hudson.tasks.Shell>
692 # SPDX-License-Identifier: EPL-1.0
693 ##############################################################################
694 # Copyright (c) 2017 The Linux Foundation and others.
696 # All rights reserved. This program and the accompanying materials
697 # are made available under the terms of the Eclipse Public License v1.0
698 # which accompanies this distribution, and is available at
699 # http://www.eclipse.org/legal/epl-v10.html
700 ##############################################################################
702 # Clear log credential files
703 rm "$SETTINGS_FILE"
706 </hudson.tasks.Shell>
707 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
708 <regexp>^Build logs: .*</regexp>
709 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
711 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
712 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
713 <markBuildUnstable>false</markBuildUnstable>
714 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
715 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
717 <hudson.plugins.ws__cleanup.Pattern>
718 <pattern>**/*.jenkins-trigger</pattern>
720 </hudson.plugins.ws__cleanup.Pattern>
722 <deleteDirs>false</deleteDirs>
723 <cleanupMatrixParent>false</cleanupMatrixParent>
725 <cleanWhenSuccess>true</cleanWhenSuccess>
726 <cleanWhenUnstable>true</cleanWhenUnstable>
727 <cleanWhenFailure>true</cleanWhenFailure>
728 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
729 <cleanWhenAborted>true</cleanWhenAborted>
730 <notFailBuild>true</notFailBuild>
731 </hudson.plugins.ws__cleanup.WsCleanup>
734 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
735 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
736 <timeoutMinutes>60</timeoutMinutes>
737 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
738 <failBuild>true</failBuild>
739 <writingDescription>false</writingDescription>
740 <timeoutPercentage>0</timeoutPercentage>
741 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
742 <timeoutType>absolute</timeoutType>
743 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
744 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
745 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
746 <user>test-credential</user>
747 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
748 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
749 <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
751 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
752 <fileId>npmrc</fileId>
753 <targetLocation>$HOME/.npmrc</targetLocation>
755 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
757 </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>