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>
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="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
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 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
154 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
155 <compareType>ANT</compareType>
156 <pattern>releng/ciman</pattern>
158 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
159 <compareType>ANT</compareType>
160 <pattern>**/master</pattern>
161 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
164 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
165 <compareType>ANT</compareType>
166 <pattern>**</pattern>
167 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
169 <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
170 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
173 <onSuccessful>false</onSuccessful>
174 <onFailed>false</onFailed>
175 <onUnstable>false</onUnstable>
176 <onNotBuilt>false</onNotBuilt>
178 <silentMode>false</silentMode>
179 <silentStartMode>false</silentStartMode>
180 <escapeQuotes>true</escapeQuotes>
181 <noNameAndEmailParameters>false</noNameAndEmailParameters>
182 <readableMessage>false</readableMessage>
183 <dependencyJobsNames/>
185 <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
187 <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
189 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
190 <commentAddedCommentContains>recheck: [0-9 ]+</commentAddedCommentContains>
191 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
194 <buildFailureMessage/>
195 <buildSuccessfulMessage/>
196 <buildUnstableMessage/>
197 <buildNotBuiltMessage/>
198 <buildUnsuccessfulFilepath/>
200 <serverName>test-server</serverName>
201 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
205 <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
206 </hudson.tasks.Shell>
208 <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
209 </hudson.tasks.Shell>
211 <targets>--version</targets>
213 <mavenName>mvn33</mavenName>
214 <usePrivateRepository>false</usePrivateRepository>
215 <settings class="jenkins.mvn.DefaultSettingsProvider"/>
216 <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
217 </hudson.tasks.Maven>
219 <command>rm "$HOME/.wgetrc"</command>
220 </hudson.tasks.Shell>
221 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
223 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
224 <fileId>global-settings</fileId>
226 <variable>GLOBAL_SETTINGS_FILE</variable>
227 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
228 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
229 <fileId>gerrit-maven-project-settings</fileId>
231 <variable>SETTINGS_FILE</variable>
232 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
234 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
237 # SPDX-License-Identifier: EPL-1.0
238 ##############################################################################
239 # Copyright (c) 2017 The Linux Foundation and others.
241 # All rights reserved. This program and the accompanying materials
242 # are made available under the terms of the Eclipse Public License v1.0
243 # which accompanies this distribution, and is available at
244 # http://www.eclipse.org/legal/epl-v10.html
245 ##############################################################################
246 # Fetches patches all projects provided by comment trigger
248 # Takes a list of Gerrit patches and fetches all projects and cherry-pick
249 # patches for projects. The trigger is
250 # 'recheck: SPACE_SEPERATED_LIST_OF_PATCHES'
252 # NOTE: This script assumes the user will provide the correct dependency order
253 # via the PATCHES list.
255 # Ensure we fail the job if any steps fail.
258 REPOS_DIR="$WORKSPACE/.repos"
260 IFS=" " read -r -a PATCHES <<< "$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep 'recheck:' | awk -F: '{print $2}')"
262 # Workaround for git-review bug in v1.24
263 # https://storyboard.openstack.org/#!/story/2001081
264 set +u # Allow unbound variables for virtualenv
265 virtualenv --quiet "/tmp/v/git-review"
266 # shellcheck source=/tmp/v/git-review/bin/activate disable=SC1091
267 source "/tmp/v/git-review/bin/activate"
268 pip install --quiet --upgrade pip
269 pip install --quiet --upgrade git-review
271 # End git-review workaround
274 for patch in $(echo "${PATCHES[@]}"); do
275 json=$(curl -s "$GERRIT_URL/changes/$patch" | sed -e "s/)]}'//")
276 project=$(echo "$json" | jq -r '.project')
277 branch=$(echo "$json" | jq -r '.branch')
279 if [ ! -d "$REPOS_DIR/$project" ]; then
280 git clone -q --depth 1 -b "$branch" "$GIT_URL/$project" "$REPOS_DIR/$project"
282 # This array will be used later to determine project build order.
283 projects+=("$project")
286 pushd "$REPOS_DIR/$project"
287 # If remote gerrit already exists just make sure path is expected
288 if ! git remote add gerrit "$GERRIT_URL/$project" > /dev/null 2>&1; then
289 git remote set-url gerrit "$GERRIT_URL/$project"
291 git review --cherrypick="$patch"
295 # This script should be a macro which re-inject's the projects variable back
296 # into the build so a script later on can use it.
297 echo "DEPENDENCY_BUILD_ORDER=${projects[*]}" > "$WORKSPACE/.dependency.properties"
299 </hudson.tasks.Shell>
302 <propertiesFilePath>$WORKSPACE/.dependency.properties</propertiesFilePath>
307 # SPDX-License-Identifier: EPL-1.0
308 ##############################################################################
309 # Copyright (c) 2017 The Linux Foundation and others.
311 # All rights reserved. This program and the accompanying materials
312 # are made available under the terms of the Eclipse Public License v1.0
313 # which accompanies this distribution, and is available at
314 # http://www.eclipse.org/legal/epl-v10.html
315 ##############################################################################
317 # This file contains a list of variables that are generally useful in many
318 # scripts. It is meant to be sourced in other scripts so that the variables can
321 MAVEN_OPTIONS="$(echo --show-version \
324 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
325 -Dmaven.repo.local=/tmp/r \
326 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)"
327 echo "$MAVEN_OPTIONS"
330 # SPDX-License-Identifier: EPL-1.0
331 ##############################################################################
332 # Copyright (c) 2017 The Linux Foundation and others.
334 # All rights reserved. This program and the accompanying materials
335 # are made available under the terms of the Eclipse Public License v1.0
336 # which accompanies this distribution, and is available at
337 # http://www.eclipse.org/legal/epl-v10.html
338 ##############################################################################
340 # Builds projects provided via $DEPENDENCY_BUILD_ORDER list
342 # This runs a `mvn clean install` against all projects provided by a list. This
343 # script is a companion script for the gerrit-fetch-dependencies script which
344 # clones project repos to "$WORKSPACE/.repos".
346 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
347 # Ensure we fail the job if any steps fail.
351 IFS=" " read -r -a PROJECTS <<< "$DEPENDENCY_BUILD_ORDER"
352 REPOS_DIR="$WORKSPACE/.repos"
356 for project in "${PROJECTS[@]}"; do
357 pushd "$REPOS_DIR/$project"
358 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
359 # shellcheck disable=SC2086
363 --global-settings "$GLOBAL_SETTINGS_FILE" \
364 --settings "$SETTINGS_FILE" \
365 $MAVEN_OPTIONS $MAVEN_PARAMS
369 </hudson.tasks.Shell>
372 # SPDX-License-Identifier: EPL-1.0
373 ##############################################################################
374 # Copyright (c) 2017 The Linux Foundation and others.
376 # All rights reserved. This program and the accompanying materials
377 # are made available under the terms of the Eclipse Public License v1.0
378 # which accompanies this distribution, and is available at
379 # http://www.eclipse.org/legal/epl-v10.html
380 ##############################################################################
382 # This file contains a list of variables that are generally useful in many
383 # scripts. It is meant to be sourced in other scripts so that the variables can
386 MAVEN_OPTIONS="$(echo --show-version \
389 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
390 -Dmaven.repo.local=/tmp/r \
391 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)"
392 echo "$MAVEN_OPTIONS"
395 # SPDX-License-Identifier: EPL-1.0
396 ##############################################################################
397 # Copyright (c) 2017 The Linux Foundation and others.
399 # All rights reserved. This program and the accompanying materials
400 # are made available under the terms of the Eclipse Public License v1.0
401 # which accompanies this distribution, and is available at
402 # http://www.eclipse.org/legal/epl-v10.html
403 ##############################################################################
405 # This script builds a Maven project and deploys it into a staging repo which
406 # can be used to deploy elsewhere later eg. Nexus staging / snapshot repos.
408 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
409 # Ensure we fail the job if any steps fail.
415 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
416 # shellcheck disable=SC2086
418 --global-settings "$GLOBAL_SETTINGS_FILE" \
419 --settings "$SETTINGS_FILE" \
420 -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \
421 $MAVEN_OPTIONS $MAVEN_PARAMS
423 </hudson.tasks.Shell>
426 set +e # DO NOT cause build failure if any of the rm calls fail.
428 rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
430 # In some cases we use the lf-provide-maven-settings macro to produce
431 # a "$HOME/.netrc" file containing credentials. Remove that file here
433 rm "$HOME/.netrc"
435 # DO NOT fail build if any of the above lines fail.
438 </hudson.tasks.Shell>
441 <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs">
442 <isRankActivated>false</isRankActivated>
447 <thresholdLimit>low</thresholdLimit>
448 <pluginName>[FINDBUGS] </pluginName>
450 <canRunOnFailed>false</canRunOnFailed>
451 <useStableBuildAsReference>false</useStableBuildAsReference>
452 <usePreviousBuildAsReference>false</usePreviousBuildAsReference>
453 <useDeltaValues>false</useDeltaValues>
457 <unstableTotalNormal/>
464 <shouldDetectModules>false</shouldDetectModules>
465 <dontComputeNew>true</dontComputeNew>
466 <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
468 </hudson.plugins.findbugs.FindBugsPublisher>
469 <hudson.plugins.jacoco.JacocoPublisher plugin="jacoco">
470 <execPattern>**/**.exec</execPattern>
471 <classPattern>**/classes</classPattern>
472 <sourcePattern>**/src/main/java</sourcePattern>
473 <changeBuildStatus>false</changeBuildStatus>
475 <exclusionPattern>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</exclusionPattern>
476 <maximumBranchCoverage>10</maximumBranchCoverage>
477 <minimumBranchCoverage>20</minimumBranchCoverage>
478 <maximumMethodCoverage>50</maximumMethodCoverage>
479 <minimumMethodCoverage>40</minimumMethodCoverage>
480 </hudson.plugins.jacoco.JacocoPublisher>
481 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
485 # SPDX-License-Identifier: EPL-1.0
486 ##############################################################################
487 # Copyright (c) 2017 The Linux Foundation and others.
489 # All rights reserved. This program and the accompanying materials
490 # are made available under the terms of the Eclipse Public License v1.0
491 # which accompanies this distribution, and is available at
492 # http://www.eclipse.org/legal/epl-v10.html
493 ##############################################################################
494 echo "---> sysstat.sh"
495 set +e # DON'T fail build if script fails.
497 OS=$(facter operatingsystem)
498 case "$OS" in
500 SYSSTAT_PATH="/var/log/sysstat"
502 # Dont run the script when systat is not enabled by default
503 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
508 SYSSTAT_PATH="/var/log/sa"
516 SAR_DIR="$WORKSPACE/archives/sar-reports"
517 mkdir -p "$SAR_DIR"
518 cp "$SYSSTAT_PATH/"* "$_"
519 # convert sar data to ascii format
520 while IFS="" read -r sarfilenum
522 [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}"
523 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
525 # DON'T fail build if script fails.
528 </hudson.tasks.Shell>
529 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
531 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
532 <fileId>jenkins-log-archives-settings</fileId>
534 <variable>SETTINGS_FILE</variable>
535 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
537 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
540 <propertiesContent>SERVER_ID=logs</propertiesContent>
545 # SPDX-License-Identifier: EPL-1.0
546 ##############################################################################
547 # Copyright (c) 2017 The Linux Foundation and others.
549 # All rights reserved. This program and the accompanying materials
550 # are made available under the terms of the Eclipse Public License v1.0
551 # which accompanies this distribution, and is available at
552 # http://www.eclipse.org/legal/epl-v10.html
553 ##############################################################################
554 echo "---> create-netrc.sh"
556 # Ensure we fail the job if any steps fail.
559 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
560 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
561 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
562 -v x:username -o ":" -v x:password \
563 "$SETTINGS_FILE")
565 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
566 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
567 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
569 echo "machine ${machine%:*} login $user password $pass" > ~/.netrc
571 </hudson.tasks.Shell>
574 # SPDX-License-Identifier: EPL-1.0
575 ##############################################################################
576 # Copyright (c) 2017 The Linux Foundation and others.
578 # All rights reserved. This program and the accompanying materials
579 # are made available under the terms of the Eclipse Public License v1.0
580 # which accompanies this distribution, and is available at
581 # http://www.eclipse.org/legal/epl-v10.html
582 ##############################################################################
583 echo "---> lftools-install.sh"
585 # Script to install lftools via a version passed in via lf-infra-parameters
587 # Required parameters:
589 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
590 # set to a strict version number like '1.2.3' or using
591 # PEP-440 definitions.
595 # >=1.0.0,<2.0.0
597 # By default a released version of lftools should always be used.
598 # The purpose of the 2 variables below is so that lftools devs can test
599 # unreleased versions of lftools. There are 2 methods to install a dev version
602 # 1) gerrit patch: Used to test a patch that has not yet been merged.
603 # To do this set something like this:
604 # LFTOOLS_MODE=gerrit
605 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
607 # 2) git branch: Used to install an lftools version from a specific branch.
608 # To use this set the variables as follows:
610 # LFTOOLS_REFSPEC=master
612 # 3) release : The intended use case and default setting.
613 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
615 LFTOOLS_MODE=release # release | git | gerrit
616 LFTOOLS_REFSPEC=master
618 # Ensure we fail the job if any steps fail.
619 # DO NOT set -u as virtualenv's activate script has unbound variables
622 virtualenv --quiet "/tmp/v/lftools"
623 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
624 source "/tmp/v/lftools/bin/activate"
625 pip install --quiet --upgrade pip
627 case $LFTOOLS_MODE in
629 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
631 git fetch origin "$LFTOOLS_REFSPEC"
632 git checkout FETCH_HEAD
633 pip install --quiet --upgrade -r requirements.txt
634 pip install --quiet --upgrade -e .
639 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
643 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
644 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
647 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
653 # pipdeptree prints out a lot of information because lftools pulls in many
654 # dependencies. Let's only print it if we want to debug.
655 # echo "----> Pip Dependency Tree"
656 # pip install --quiet --upgrade pipdeptree
660 # SPDX-License-Identifier: EPL-1.0
661 ##############################################################################
662 # Copyright (c) 2017 The Linux Foundation and others.
664 # All rights reserved. This program and the accompanying materials
665 # are made available under the terms of the Eclipse Public License v1.0
666 # which accompanies this distribution, and is available at
667 # http://www.eclipse.org/legal/epl-v10.html
668 ##############################################################################
669 echo "---> logs-deploy.sh"
671 # Ensure we fail the job if any steps fail.
674 set -x # Trace commands for this script to make debugging easier.
676 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
677 LOGS_SERVER="${LOGS_SERVER:-None}"
679 if [ "${LOGS_SERVER}" == 'None' ]
681 set +x # Disable trace since we no longer need it
683 echo "WARNING: Logging server not set"
685 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
686 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
687 BUILD_URL="${BUILD_URL}"
689 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
690 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
692 set +x # Disable trace since we no longer need it.
694 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
697 </hudson.tasks.Shell>
700 # SPDX-License-Identifier: EPL-1.0
701 ##############################################################################
702 # Copyright (c) 2017 The Linux Foundation and others.
704 # All rights reserved. This program and the accompanying materials
705 # are made available under the terms of the Eclipse Public License v1.0
706 # which accompanies this distribution, and is available at
707 # http://www.eclipse.org/legal/epl-v10.html
708 ##############################################################################
710 # Clear log credential files
711 rm "$SETTINGS_FILE"
714 </hudson.tasks.Shell>
715 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
716 <regexp>^Build logs: .*</regexp>
717 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
719 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
720 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
721 <markBuildUnstable>false</markBuildUnstable>
722 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
723 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
725 <hudson.plugins.ws__cleanup.Pattern>
726 <pattern>**/*.jenkins-trigger</pattern>
728 </hudson.plugins.ws__cleanup.Pattern>
730 <deleteDirs>false</deleteDirs>
731 <cleanupMatrixParent>false</cleanupMatrixParent>
733 <cleanWhenSuccess>true</cleanWhenSuccess>
734 <cleanWhenUnstable>true</cleanWhenUnstable>
735 <cleanWhenFailure>true</cleanWhenFailure>
736 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
737 <cleanWhenAborted>true</cleanWhenAborted>
738 <notFailBuild>true</notFailBuild>
739 </hudson.plugins.ws__cleanup.WsCleanup>
742 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
743 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
744 <timeoutMinutes>60</timeoutMinutes>
745 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
746 <failBuild>true</failBuild>
747 <writingDescription>false</writingDescription>
748 <timeoutPercentage>0</timeoutPercentage>
749 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
750 <timeoutType>absolute</timeoutType>
751 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
752 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
753 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
754 <user>test-credential</user>
755 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
756 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
757 <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
759 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
760 <fileId>npmrc</fileId>
761 <targetLocation>$HOME/.npmrc</targetLocation>
763 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
765 </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>