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 <com.coravy.hudson.plugins.github.GithubProjectProperty>
14 <projectUrl>$GIT_URL/$PROJECT/example-org/releng/ciman</projectUrl>
15 </com.coravy.hudson.plugins.github.GithubProjectProperty>
16 <hudson.model.ParametersDefinitionProperty>
17 <parameterDefinitions>
18 <hudson.model.StringParameterDefinition>
20 <description>Parameter to identify a Gerrit project. This is typically the
21 project repo path as exists in Gerrit.
22 For example: ofextensions/circuitsw
24 <defaultValue>releng/ciman</defaultValue>
25 </hudson.model.StringParameterDefinition>
26 <hudson.model.StringParameterDefinition>
28 <description>Stream is often set to the same name as 'branch' but can
29 sometimes be used as a name representing a project's release code
32 <defaultValue>master</defaultValue>
33 </hudson.model.StringParameterDefinition>
34 <hudson.model.StringParameterDefinition>
35 <name>GERRIT_PROJECT</name>
36 <description>Parameter to identify Gerrit project. This is typically the
37 project repo path as exists in Gerrit.
38 For example: ofextensions/circuitsw
40 Note that Gerrit will override this parameter automatically if a
41 job is triggered by Gerrit.
43 <defaultValue>releng/ciman</defaultValue>
44 </hudson.model.StringParameterDefinition>
45 <hudson.model.StringParameterDefinition>
46 <name>GERRIT_BRANCH</name>
47 <description>Parameter to identify a Gerrit branch.
49 Note that Gerrit will override this parameter automatically if a
50 job is triggered by Gerrit.
52 <defaultValue>master</defaultValue>
53 </hudson.model.StringParameterDefinition>
54 <hudson.model.StringParameterDefinition>
55 <name>GERRIT_REFSPEC</name>
56 <description>Parameter to identify a refspec when pulling from Gerrit.
58 Note that Gerrit will override this parameter automatically if a
59 job is triggered by Gerrit.
61 <defaultValue>refs/heads/master</defaultValue>
62 </hudson.model.StringParameterDefinition>
63 <hudson.model.StringParameterDefinition>
64 <name>LFTOOLS_VERSION</name>
65 <description>Version of lftools to install. Can be a specific version like
66 '0.6.0' or a PEP-440 definition.
67 https://www.python.org/dev/peps/pep-0440/
68 For example '<1.0.0' or '>=1.0.0,<2.0.0'.
70 <defaultValue><1.0.0</defaultValue>
71 </hudson.model.StringParameterDefinition>
72 <hudson.model.StringParameterDefinition>
74 <description>Maven selector to be used by shell scripts</description>
75 <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33</defaultValue>
76 </hudson.model.StringParameterDefinition>
77 <hudson.model.StringParameterDefinition>
78 <name>MAVEN_OPTS</name>
79 <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
82 </hudson.model.StringParameterDefinition>
83 <hudson.model.StringParameterDefinition>
84 <name>MAVEN_PARAMS</name>
85 <description>Maven parameters to pass to the mvn command.
87 <defaultValue>-Dmerge</defaultValue>
88 </hudson.model.StringParameterDefinition>
89 <hudson.model.StringParameterDefinition>
91 <description>Maven selector to be used by shell scripts</description>
92 <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
93 </hudson.model.StringParameterDefinition>
94 <hudson.model.StringParameterDefinition>
95 <name>STAGING_PROFILE_ID</name>
96 <description>Nexus staging profile ID.
98 <defaultValue>uuddlrlrba</defaultValue>
99 </hudson.model.StringParameterDefinition>
100 <hudson.model.StringParameterDefinition>
101 <name>ARCHIVE_ARTIFACTS</name>
102 <description>Artifacts to archive to the logs server.</description>
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>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
114 <url>git@github.com:example-org/releng/ciman</url>
115 <credentialsId>test-credential</credentialsId>
116 </hudson.plugins.git.UserRemoteConfig>
119 <hudson.plugins.git.BranchSpec>
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 <org.jenkinsci.plugins.ghprb.GhprbTrigger>
155 <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
159 <triggerPhrase>^remerge$</triggerPhrase>
160 <onlyTriggerPhrase>false</onlyTriggerPhrase>
161 <useGitHubHooks>true</useGitHubHooks>
162 <permitAll>true</permitAll>
163 <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
165 <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
166 <commitStatusContext>Maven Merge</commitStatusContext>
167 </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
169 </org.jenkinsci.plugins.ghprb.GhprbTrigger>
173 <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
174 </hudson.tasks.Shell>
176 <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
177 </hudson.tasks.Shell>
179 <targets>--version</targets>
181 <mavenName>mvn33</mavenName>
182 <usePrivateRepository>false</usePrivateRepository>
183 <settings class="jenkins.mvn.DefaultSettingsProvider"/>
184 <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
185 </hudson.tasks.Maven>
187 <command>rm "$HOME/.wgetrc"</command>
188 </hudson.tasks.Shell>
189 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
191 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
192 <fileId>global-settings</fileId>
194 <variable>GLOBAL_SETTINGS_FILE</variable>
195 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
196 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
197 <fileId>aproject-settings</fileId>
199 <variable>SETTINGS_FILE</variable>
200 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
202 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
205 <propertiesContent>SERVER_ID=fakeproject-snapshots</propertiesContent>
210 # SPDX-License-Identifier: EPL-1.0
211 ##############################################################################
212 # Copyright (c) 2017 The Linux Foundation and others.
214 # All rights reserved. This program and the accompanying materials
215 # are made available under the terms of the Eclipse Public License v1.0
216 # which accompanies this distribution, and is available at
217 # http://www.eclipse.org/legal/epl-v10.html
218 ##############################################################################
219 echo "---> create-netrc.sh"
221 # Ensure we fail the job if any steps fail.
224 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
225 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
226 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
227 -v x:username -o ":" -v x:password \
228 "$SETTINGS_FILE")
230 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
231 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
232 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
234 echo "machine ${machine%:*} login $user password $pass" > ~/.netrc
236 </hudson.tasks.Shell>
239 <propertiesContent>NEXUS_CUT_DIRS=6
240 NEXUS_REPO=fakeproject-snapshots
246 # SPDX-License-Identifier: EPL-1.0
247 ##############################################################################
248 # Copyright (c) 2017 The Linux Foundation and others.
250 # All rights reserved. This program and the accompanying materials
251 # are made available under the terms of the Eclipse Public License v1.0
252 # which accompanies this distribution, and is available at
253 # http://www.eclipse.org/legal/epl-v10.html
254 ##############################################################################
255 echo "---> lftools-install.sh"
257 # Script to install lftools via a version passed in via lf-infra-parameters
259 # Required parameters:
261 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
262 # set to a strict version number like '1.2.3' or using
263 # PEP-440 definitions.
267 # >=1.0.0,<2.0.0
269 # By default a released version of lftools should always be used.
270 # The purpose of the 2 variables below is so that lftools devs can test
271 # unreleased versions of lftools. There are 2 methods to install a dev version
274 # 1) gerrit patch: Used to test a patch that has not yet been merged.
275 # To do this set something like this:
276 # LFTOOLS_MODE=gerrit
277 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
279 # 2) git branch: Used to install an lftools version from a specific branch.
280 # To use this set the variables as follows:
282 # LFTOOLS_REFSPEC=master
284 # 3) release : The intended use case and default setting.
285 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
287 LFTOOLS_MODE=release # release | git | gerrit
288 LFTOOLS_REFSPEC=master
290 # Ensure we fail the job if any steps fail.
291 # DO NOT set -u as virtualenv's activate script has unbound variables
294 virtualenv --quiet "/tmp/v/lftools"
295 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
296 source "/tmp/v/lftools/bin/activate"
297 pip install --quiet --upgrade pip
299 case $LFTOOLS_MODE in
301 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
303 git fetch origin "$LFTOOLS_REFSPEC"
304 git checkout FETCH_HEAD
305 pip install --quiet --upgrade -r requirements.txt
306 pip install --quiet --upgrade -e .
311 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
315 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
316 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
319 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
325 # pipdeptree prints out a lot of information because lftools pulls in many
326 # dependencies. Let's only print it if we want to debug.
327 # echo "----> Pip Dependency Tree"
328 # pip install --quiet --upgrade pipdeptree
332 # SPDX-License-Identifier: EPL-1.0
333 ##############################################################################
334 # Copyright (c) 2017 The Linux Foundation and others.
336 # All rights reserved. This program and the accompanying materials
337 # are made available under the terms of the Eclipse Public License v1.0
338 # which accompanies this distribution, and is available at
339 # http://www.eclipse.org/legal/epl-v10.html
340 ##############################################################################
342 # This file contains a list of variables that are generally useful in many
343 # scripts. It is meant to be sourced in other scripts so that the variables can
346 MAVEN_OPTIONS="$(echo --show-version \
349 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
350 -Dmaven.repo.local=/tmp/r \
351 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)"
352 echo "$MAVEN_OPTIONS"
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 # Uses wget to fetch a project's maven-metadata.xml files from a Maven repository.
367 # Ensure we fail the job if any steps fail.
370 project=$(xmlstarlet sel \
371 -N "x=http://maven.apache.org/POM/4.0.0" -t \
372 --if "/x:project/x:groupId" \
373 -v "/x:project/x:groupId" \
374 --elif "/x:project/x:parent/x:groupId" \
375 -v "/x:project/x:parent/x:groupId" \
376 --else -o "" pom.xml)
377 project_path="${project//.//}"
379 mkdir -p "$WORKSPACE/m2repo/$project_path"
380 pushd "$WORKSPACE/m2repo/$project_path"
381 # Temporarily disable failing for wget
382 # If 404 happens we don't care because it might be a new project.
384 wget -nv --recursive \
385 --accept maven-metadata.xml \
386 -R "index.html*" \
387 --execute robots=off \
389 --no-host-directories \
390 --cut-dirs="$NEXUS_CUT_DIRS" \
391 "$NEXUS_URL/content/repositories/$NEXUS_REPO/$project_path/"
395 # Backup metadata - Used later to find metadata files that have not been modified
396 mkdir -p "$WORKSPACE/m2repo-backup"
397 cp -a "$WORKSPACE/m2repo/"* "$WORKSPACE/m2repo-backup"
400 # SPDX-License-Identifier: EPL-1.0
401 ##############################################################################
402 # Copyright (c) 2017 The Linux Foundation and others.
404 # All rights reserved. This program and the accompanying materials
405 # are made available under the terms of the Eclipse Public License v1.0
406 # which accompanies this distribution, and is available at
407 # http://www.eclipse.org/legal/epl-v10.html
408 ##############################################################################
410 # This script builds a Maven project and deploys it into a staging repo which
411 # can be used to deploy elsewhere later eg. Nexus staging / snapshot repos.
413 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
414 # Ensure we fail the job if any steps fail.
420 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
421 # shellcheck disable=SC2086
423 --global-settings "$GLOBAL_SETTINGS_FILE" \
424 --settings "$SETTINGS_FILE" \
425 -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \
426 $MAVEN_PARAMS $MAVEN_OPTIONS
429 # SPDX-License-Identifier: EPL-1.0
430 ##############################################################################
431 # Copyright (c) 2017 The Linux Foundation and others.
433 # All rights reserved. This program and the accompanying materials
434 # are made available under the terms of the Eclipse Public License v1.0
435 # which accompanies this distribution, and is available at
436 # http://www.eclipse.org/legal/epl-v10.html
437 ##############################################################################
438 # Upload the snapshot files to a snapshot repo.
440 # Requires the existance of $WORKSPACE/m2repo and $WORKSPACE/m2repo-backup to
441 # compare if maven metadata files have changed. Unchanged files are then
442 # removed from $WORKSPACE/m2repo before uploading to the snapshot repo.
444 # Ensure we fail the job if any steps fail.
447 m2repo_dir="$WORKSPACE/m2repo"
448 nexus_repo_url="$NEXUS_URL/content/repositories/$NEXUS_REPO"
450 # Remove metadata files that were not updated.
451 set +e # Temporarily disable to run diff command.
452 metadata_files=($(diff -s -r "$m2repo_dir" "$WORKSPACE/m2repo-backup" \
453 | grep 'Files .* and .* are identical' | awk '{print $2}'))
456 set +u # $metadata_files could be unbound if project is new.
457 if [ -n "${metadata_files[*]}" ]; then
458 for i in "${metadata_files[@]}"; do
464 find "$m2repo_dir" -type d -empty -delete
466 lftools deploy nexus -s "$nexus_repo_url" "$m2repo_dir"
468 </hudson.tasks.Shell>
471 set +e # DO NOT cause build failure if any of the rm calls fail.
473 rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
475 # In some cases we use the lf-provide-maven-settings macro to produce
476 # a "$HOME/.netrc" file containing credentials. Remove that file here
478 rm "$HOME/.netrc"
480 # DO NOT fail build if any of the above lines fail.
483 </hudson.tasks.Shell>
486 <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs">
487 <isRankActivated>false</isRankActivated>
492 <thresholdLimit>low</thresholdLimit>
493 <pluginName>[FINDBUGS] </pluginName>
495 <canRunOnFailed>false</canRunOnFailed>
496 <useStableBuildAsReference>false</useStableBuildAsReference>
497 <usePreviousBuildAsReference>false</usePreviousBuildAsReference>
498 <useDeltaValues>false</useDeltaValues>
502 <unstableTotalNormal/>
509 <shouldDetectModules>false</shouldDetectModules>
510 <dontComputeNew>true</dontComputeNew>
511 <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
513 </hudson.plugins.findbugs.FindBugsPublisher>
514 <hudson.plugins.jacoco.JacocoPublisher>
515 <execPattern>**/**.exec</execPattern>
516 <classPattern>**/classes</classPattern>
517 <sourcePattern>**/src/main/java</sourcePattern>
520 <exclusionPattern>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</exclusionPattern>
521 <maximumBranchCoverage>10</maximumBranchCoverage>
522 <minimumBranchCoverage>20</minimumBranchCoverage>
523 <maximumMethodCoverage>50</maximumMethodCoverage>
524 <minimumMethodCoverage>40</minimumMethodCoverage>
525 </hudson.plugins.jacoco.JacocoPublisher>
526 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
530 # SPDX-License-Identifier: EPL-1.0
531 ##############################################################################
532 # Copyright (c) 2017 The Linux Foundation and others.
534 # All rights reserved. This program and the accompanying materials
535 # are made available under the terms of the Eclipse Public License v1.0
536 # which accompanies this distribution, and is available at
537 # http://www.eclipse.org/legal/epl-v10.html
538 ##############################################################################
539 echo "---> sysstat.sh"
540 set +e # DON'T fail build if script fails.
542 OS=$(facter operatingsystem)
543 case "$OS" in
545 SYSSTAT_PATH="/var/log/sysstat"
547 # Dont run the script when systat is not enabled by default
548 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
553 SYSSTAT_PATH="/var/log/sa"
561 SAR_DIR="$WORKSPACE/archives/sar-reports"
562 mkdir -p "$SAR_DIR"
563 cp "$SYSSTAT_PATH/"* "$_"
564 # convert sar data to ascii format
565 while IFS="" read -r sarfilenum
567 [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}"
568 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
570 # DON'T fail build if script fails.
573 </hudson.tasks.Shell>
574 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
576 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
577 <fileId>jenkins-log-archives-settings</fileId>
579 <variable>SETTINGS_FILE</variable>
580 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
582 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
585 <propertiesContent>SERVER_ID=logs</propertiesContent>
590 # SPDX-License-Identifier: EPL-1.0
591 ##############################################################################
592 # Copyright (c) 2017 The Linux Foundation and others.
594 # All rights reserved. This program and the accompanying materials
595 # are made available under the terms of the Eclipse Public License v1.0
596 # which accompanies this distribution, and is available at
597 # http://www.eclipse.org/legal/epl-v10.html
598 ##############################################################################
599 echo "---> create-netrc.sh"
601 # Ensure we fail the job if any steps fail.
604 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
605 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
606 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
607 -v x:username -o ":" -v x:password \
608 "$SETTINGS_FILE")
610 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
611 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
612 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
614 echo "machine ${machine%:*} login $user password $pass" > ~/.netrc
616 </hudson.tasks.Shell>
619 # SPDX-License-Identifier: EPL-1.0
620 ##############################################################################
621 # Copyright (c) 2017 The Linux Foundation and others.
623 # All rights reserved. This program and the accompanying materials
624 # are made available under the terms of the Eclipse Public License v1.0
625 # which accompanies this distribution, and is available at
626 # http://www.eclipse.org/legal/epl-v10.html
627 ##############################################################################
628 echo "---> lftools-install.sh"
630 # Script to install lftools via a version passed in via lf-infra-parameters
632 # Required parameters:
634 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
635 # set to a strict version number like '1.2.3' or using
636 # PEP-440 definitions.
640 # >=1.0.0,<2.0.0
642 # By default a released version of lftools should always be used.
643 # The purpose of the 2 variables below is so that lftools devs can test
644 # unreleased versions of lftools. There are 2 methods to install a dev version
647 # 1) gerrit patch: Used to test a patch that has not yet been merged.
648 # To do this set something like this:
649 # LFTOOLS_MODE=gerrit
650 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
652 # 2) git branch: Used to install an lftools version from a specific branch.
653 # To use this set the variables as follows:
655 # LFTOOLS_REFSPEC=master
657 # 3) release : The intended use case and default setting.
658 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
660 LFTOOLS_MODE=release # release | git | gerrit
661 LFTOOLS_REFSPEC=master
663 # Ensure we fail the job if any steps fail.
664 # DO NOT set -u as virtualenv's activate script has unbound variables
667 virtualenv --quiet "/tmp/v/lftools"
668 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
669 source "/tmp/v/lftools/bin/activate"
670 pip install --quiet --upgrade pip
672 case $LFTOOLS_MODE in
674 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
676 git fetch origin "$LFTOOLS_REFSPEC"
677 git checkout FETCH_HEAD
678 pip install --quiet --upgrade -r requirements.txt
679 pip install --quiet --upgrade -e .
684 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
688 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
689 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
692 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
698 # pipdeptree prints out a lot of information because lftools pulls in many
699 # dependencies. Let's only print it if we want to debug.
700 # echo "----> Pip Dependency Tree"
701 # pip install --quiet --upgrade pipdeptree
705 # SPDX-License-Identifier: EPL-1.0
706 ##############################################################################
707 # Copyright (c) 2017 The Linux Foundation and others.
709 # All rights reserved. This program and the accompanying materials
710 # are made available under the terms of the Eclipse Public License v1.0
711 # which accompanies this distribution, and is available at
712 # http://www.eclipse.org/legal/epl-v10.html
713 ##############################################################################
714 echo "---> logs-deploy.sh"
716 # Ensure we fail the job if any steps fail.
719 set -x # Trace commands for this script to make debugging easier.
721 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
722 LOGS_SERVER="${LOGS_SERVER:-None}"
724 if [ "${LOGS_SERVER}" == 'None' ]
726 set +x # Disable trace since we no longer need it
728 echo "WARNING: Logging server not set"
730 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
731 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
732 BUILD_URL="${BUILD_URL}"
734 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
735 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
737 set +x # Disable trace since we no longer need it.
739 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
742 </hudson.tasks.Shell>
745 # SPDX-License-Identifier: EPL-1.0
746 ##############################################################################
747 # Copyright (c) 2017 The Linux Foundation and others.
749 # All rights reserved. This program and the accompanying materials
750 # are made available under the terms of the Eclipse Public License v1.0
751 # which accompanies this distribution, and is available at
752 # http://www.eclipse.org/legal/epl-v10.html
753 ##############################################################################
755 # Clear log credential files
756 rm "$SETTINGS_FILE"
759 </hudson.tasks.Shell>
760 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
761 <regexp>^Build logs: .*</regexp>
762 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
764 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
765 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
766 <markBuildUnstable>false</markBuildUnstable>
767 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
768 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
770 <hudson.plugins.ws__cleanup.Pattern>
771 <pattern>**/*.jenkins-trigger</pattern>
773 </hudson.plugins.ws__cleanup.Pattern>
775 <deleteDirs>false</deleteDirs>
776 <cleanupMatrixParent>false</cleanupMatrixParent>
778 <cleanWhenSuccess>true</cleanWhenSuccess>
779 <cleanWhenUnstable>true</cleanWhenUnstable>
780 <cleanWhenFailure>true</cleanWhenFailure>
781 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
782 <cleanWhenAborted>true</cleanWhenAborted>
783 <notFailBuild>true</notFailBuild>
784 </hudson.plugins.ws__cleanup.WsCleanup>
785 <hudson.plugins.parameterizedtrigger.BuildTrigger>
787 </hudson.plugins.parameterizedtrigger.BuildTrigger>
790 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
791 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
792 <timeoutMinutes>30</timeoutMinutes>
793 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
794 <failBuild>true</failBuild>
795 <writingDescription>false</writingDescription>
796 <timeoutPercentage>0</timeoutPercentage>
797 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
798 <timeoutType>absolute</timeoutType>
799 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
800 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
801 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
802 <user>test-credential</user>
803 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
804 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
805 <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
807 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
808 <fileId>npmrc</fileId>
809 <targetLocation>$HOME/.npmrc</targetLocation>
811 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
813 </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>