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_OPTIONS $MAVEN_PARAMS
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 IFS=" " read -r -a metadata_files <<< "$(diff -s -r "$m2repo_dir" "$WORKSPACE/m2repo-backup" \
453 | grep 'Files .* and .* are identical' \
454 | awk '{print $2}')"
457 set +u # $metadata_files could be unbound if project is new.
458 if [ -n "${metadata_files[*]}" ]; then
459 for i in "${metadata_files[@]}"; do
465 find "$m2repo_dir" -type d -empty -delete
467 lftools deploy nexus -s "$nexus_repo_url" "$m2repo_dir"
469 </hudson.tasks.Shell>
472 set +e # DO NOT cause build failure if any of the rm calls fail.
474 rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
476 # In some cases we use the lf-provide-maven-settings macro to produce
477 # a "$HOME/.netrc" file containing credentials. Remove that file here
479 rm "$HOME/.netrc"
481 # DO NOT fail build if any of the above lines fail.
484 </hudson.tasks.Shell>
487 <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs">
488 <isRankActivated>false</isRankActivated>
493 <thresholdLimit>low</thresholdLimit>
494 <pluginName>[FINDBUGS] </pluginName>
496 <canRunOnFailed>false</canRunOnFailed>
497 <useStableBuildAsReference>false</useStableBuildAsReference>
498 <usePreviousBuildAsReference>false</usePreviousBuildAsReference>
499 <useDeltaValues>false</useDeltaValues>
503 <unstableTotalNormal/>
510 <shouldDetectModules>false</shouldDetectModules>
511 <dontComputeNew>true</dontComputeNew>
512 <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
514 </hudson.plugins.findbugs.FindBugsPublisher>
515 <hudson.plugins.jacoco.JacocoPublisher>
516 <execPattern>**/**.exec</execPattern>
517 <classPattern>**/classes</classPattern>
518 <sourcePattern>**/src/main/java</sourcePattern>
521 <exclusionPattern>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</exclusionPattern>
522 <maximumBranchCoverage>10</maximumBranchCoverage>
523 <minimumBranchCoverage>20</minimumBranchCoverage>
524 <maximumMethodCoverage>50</maximumMethodCoverage>
525 <minimumMethodCoverage>40</minimumMethodCoverage>
526 </hudson.plugins.jacoco.JacocoPublisher>
527 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
531 # SPDX-License-Identifier: EPL-1.0
532 ##############################################################################
533 # Copyright (c) 2017 The Linux Foundation and others.
535 # All rights reserved. This program and the accompanying materials
536 # are made available under the terms of the Eclipse Public License v1.0
537 # which accompanies this distribution, and is available at
538 # http://www.eclipse.org/legal/epl-v10.html
539 ##############################################################################
540 echo "---> sysstat.sh"
541 set +e # DON'T fail build if script fails.
543 OS=$(facter operatingsystem)
544 case "$OS" in
546 SYSSTAT_PATH="/var/log/sysstat"
548 # Dont run the script when systat is not enabled by default
549 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
554 SYSSTAT_PATH="/var/log/sa"
562 SAR_DIR="$WORKSPACE/archives/sar-reports"
563 mkdir -p "$SAR_DIR"
564 cp "$SYSSTAT_PATH/"* "$_"
565 # convert sar data to ascii format
566 while IFS="" read -r sarfilenum
568 [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}"
569 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
571 # DON'T fail build if script fails.
574 </hudson.tasks.Shell>
575 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
577 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
578 <fileId>jenkins-log-archives-settings</fileId>
580 <variable>SETTINGS_FILE</variable>
581 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
583 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
586 <propertiesContent>SERVER_ID=logs</propertiesContent>
591 # SPDX-License-Identifier: EPL-1.0
592 ##############################################################################
593 # Copyright (c) 2017 The Linux Foundation and others.
595 # All rights reserved. This program and the accompanying materials
596 # are made available under the terms of the Eclipse Public License v1.0
597 # which accompanies this distribution, and is available at
598 # http://www.eclipse.org/legal/epl-v10.html
599 ##############################################################################
600 echo "---> create-netrc.sh"
602 # Ensure we fail the job if any steps fail.
605 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
606 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
607 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
608 -v x:username -o ":" -v x:password \
609 "$SETTINGS_FILE")
611 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
612 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
613 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
615 echo "machine ${machine%:*} login $user password $pass" > ~/.netrc
617 </hudson.tasks.Shell>
620 # SPDX-License-Identifier: EPL-1.0
621 ##############################################################################
622 # Copyright (c) 2017 The Linux Foundation and others.
624 # All rights reserved. This program and the accompanying materials
625 # are made available under the terms of the Eclipse Public License v1.0
626 # which accompanies this distribution, and is available at
627 # http://www.eclipse.org/legal/epl-v10.html
628 ##############################################################################
629 echo "---> lftools-install.sh"
631 # Script to install lftools via a version passed in via lf-infra-parameters
633 # Required parameters:
635 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
636 # set to a strict version number like '1.2.3' or using
637 # PEP-440 definitions.
641 # >=1.0.0,<2.0.0
643 # By default a released version of lftools should always be used.
644 # The purpose of the 2 variables below is so that lftools devs can test
645 # unreleased versions of lftools. There are 2 methods to install a dev version
648 # 1) gerrit patch: Used to test a patch that has not yet been merged.
649 # To do this set something like this:
650 # LFTOOLS_MODE=gerrit
651 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
653 # 2) git branch: Used to install an lftools version from a specific branch.
654 # To use this set the variables as follows:
656 # LFTOOLS_REFSPEC=master
658 # 3) release : The intended use case and default setting.
659 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
661 LFTOOLS_MODE=release # release | git | gerrit
662 LFTOOLS_REFSPEC=master
664 # Ensure we fail the job if any steps fail.
665 # DO NOT set -u as virtualenv's activate script has unbound variables
668 virtualenv --quiet "/tmp/v/lftools"
669 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
670 source "/tmp/v/lftools/bin/activate"
671 pip install --quiet --upgrade pip
673 case $LFTOOLS_MODE in
675 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
677 git fetch origin "$LFTOOLS_REFSPEC"
678 git checkout FETCH_HEAD
679 pip install --quiet --upgrade -r requirements.txt
680 pip install --quiet --upgrade -e .
685 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
689 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
690 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
693 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
699 # pipdeptree prints out a lot of information because lftools pulls in many
700 # dependencies. Let's only print it if we want to debug.
701 # echo "----> Pip Dependency Tree"
702 # pip install --quiet --upgrade pipdeptree
706 # SPDX-License-Identifier: EPL-1.0
707 ##############################################################################
708 # Copyright (c) 2017 The Linux Foundation and others.
710 # All rights reserved. This program and the accompanying materials
711 # are made available under the terms of the Eclipse Public License v1.0
712 # which accompanies this distribution, and is available at
713 # http://www.eclipse.org/legal/epl-v10.html
714 ##############################################################################
715 echo "---> logs-deploy.sh"
717 # Ensure we fail the job if any steps fail.
720 set -x # Trace commands for this script to make debugging easier.
722 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
723 LOGS_SERVER="${LOGS_SERVER:-None}"
725 if [ "${LOGS_SERVER}" == 'None' ]
727 set +x # Disable trace since we no longer need it
729 echo "WARNING: Logging server not set"
731 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
732 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
733 BUILD_URL="${BUILD_URL}"
735 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
736 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
738 set +x # Disable trace since we no longer need it.
740 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
743 </hudson.tasks.Shell>
746 # SPDX-License-Identifier: EPL-1.0
747 ##############################################################################
748 # Copyright (c) 2017 The Linux Foundation and others.
750 # All rights reserved. This program and the accompanying materials
751 # are made available under the terms of the Eclipse Public License v1.0
752 # which accompanies this distribution, and is available at
753 # http://www.eclipse.org/legal/epl-v10.html
754 ##############################################################################
756 # Clear log credential files
757 rm "$SETTINGS_FILE"
760 </hudson.tasks.Shell>
761 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
762 <regexp>^Build logs: .*</regexp>
763 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
765 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
766 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
767 <markBuildUnstable>false</markBuildUnstable>
768 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
769 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
771 <hudson.plugins.ws__cleanup.Pattern>
772 <pattern>**/*.jenkins-trigger</pattern>
774 </hudson.plugins.ws__cleanup.Pattern>
776 <deleteDirs>false</deleteDirs>
777 <cleanupMatrixParent>false</cleanupMatrixParent>
779 <cleanWhenSuccess>true</cleanWhenSuccess>
780 <cleanWhenUnstable>true</cleanWhenUnstable>
781 <cleanWhenFailure>true</cleanWhenFailure>
782 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
783 <cleanWhenAborted>true</cleanWhenAborted>
784 <notFailBuild>true</notFailBuild>
785 </hudson.plugins.ws__cleanup.WsCleanup>
786 <hudson.plugins.parameterizedtrigger.BuildTrigger>
788 </hudson.plugins.parameterizedtrigger.BuildTrigger>
791 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
792 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
793 <timeoutMinutes>30</timeoutMinutes>
794 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
795 <failBuild>true</failBuild>
796 <writingDescription>false</writingDescription>
797 <timeoutPercentage>0</timeoutPercentage>
798 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
799 <timeoutType>absolute</timeoutType>
800 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
801 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
802 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
803 <user>test-credential</user>
804 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
805 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
806 <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
808 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
809 <fileId>npmrc</fileId>
810 <targetLocation>$HOME/.npmrc</targetLocation>
812 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
814 </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>