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 <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.
62 </hudson.model.StringParameterDefinition>
63 <hudson.model.StringParameterDefinition>
64 <name>MAVEN_OPTS</name>
65 <description>Maven Java opts. Example: -Xmx1024m -XX:MaxPermSize=256m
68 </hudson.model.StringParameterDefinition>
69 <hudson.model.StringParameterDefinition>
70 <name>MAVEN_PARAMS</name>
71 <description>Maven parameters to pass to the mvn command.
73 <defaultValue>-Dstream=$STREAM</defaultValue>
74 </hudson.model.StringParameterDefinition>
75 <hudson.model.StringParameterDefinition>
77 <description>Maven selector to be used by shell scripts</description>
78 <defaultValue>/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn</defaultValue>
79 </hudson.model.StringParameterDefinition>
80 <hudson.model.StringParameterDefinition>
81 <name>STAGING_PROFILE_ID</name>
82 <description>Nexus staging profile ID.
84 <defaultValue>uuddlrlrba</defaultValue>
85 </hudson.model.StringParameterDefinition>
86 </parameterDefinitions>
87 </hudson.model.ParametersDefinitionProperty>
89 <scm class="hudson.plugins.git.GitSCM">
90 <configVersion>2</configVersion>
92 <hudson.plugins.git.UserRemoteConfig>
94 <refspec>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
95 <url>git@github.com:example-org/releng/ciman</url>
96 <credentialsId>test-credential</credentialsId>
97 </hudson.plugins.git.UserRemoteConfig>
100 <hudson.plugins.git.BranchSpec>
102 </hudson.plugins.git.BranchSpec>
105 <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
106 <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
107 <authorOrCommitter>false</authorOrCommitter>
108 <wipeOutWorkspace>true</wipeOutWorkspace>
109 <pruneBranches>false</pruneBranches>
110 <remotePoll>false</remotePoll>
111 <gitTool>Default</gitTool>
112 <submoduleCfg class="list"/>
117 <skipTag>true</skipTag>
119 <useShallowClone>false</useShallowClone>
120 <ignoreNotifyCommit>false</ignoreNotifyCommit>
122 <hudson.plugins.git.extensions.impl.SubmoduleOption>
123 <disableSubmodules>false</disableSubmodules>
124 <recursiveSubmodules>true</recursiveSubmodules>
125 <trackingSubmodules>false</trackingSubmodules>
127 <timeout>10</timeout>
128 </hudson.plugins.git.extensions.impl.SubmoduleOption>
129 <hudson.plugins.git.extensions.impl.WipeWorkspace/>
132 <triggers class="vector">
133 <org.jenkinsci.plugins.ghprb.GhprbTrigger>
136 <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
140 <triggerPhrase>^recheck$</triggerPhrase>
141 <onlyTriggerPhrase>false</onlyTriggerPhrase>
142 <useGitHubHooks>true</useGitHubHooks>
143 <permitAll>true</permitAll>
144 <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
146 <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
147 <commitStatusContext>Maven Verify</commitStatusContext>
148 </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
150 </org.jenkinsci.plugins.ghprb.GhprbTrigger>
154 <command>mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes</command>
155 </hudson.tasks.Shell>
157 <command>echo "quiet=on" > "$HOME/.wgetrc"</command>
158 </hudson.tasks.Shell>
160 <targets>--version</targets>
162 <mavenName>mvn33</mavenName>
163 <usePrivateRepository>false</usePrivateRepository>
164 <settings class="jenkins.mvn.DefaultSettingsProvider"/>
165 <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
166 </hudson.tasks.Maven>
168 <command>rm "$HOME/.wgetrc"</command>
169 </hudson.tasks.Shell>
170 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
172 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
173 <fileId>global-settings</fileId>
175 <variable>GLOBAL_SETTINGS_FILE</variable>
176 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
177 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
178 <fileId>aproject-settings</fileId>
180 <variable>SETTINGS_FILE</variable>
181 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
183 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
186 # SPDX-License-Identifier: EPL-1.0
187 ##############################################################################
188 # Copyright (c) 2017 The Linux Foundation and others.
190 # All rights reserved. This program and the accompanying materials
191 # are made available under the terms of the Eclipse Public License v1.0
192 # which accompanies this distribution, and is available at
193 # http://www.eclipse.org/legal/epl-v10.html
194 ##############################################################################
195 echo "---> lftools-install.sh"
197 # Ensure we fail the job if any steps fail.
198 # DO NOT set -u as virtualenv's activate script has unbound variables
201 virtualenv --quiet "/tmp/v/lftools"
202 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
203 source "/tmp/v/lftools/bin/activate"
204 pip install --quiet --upgrade pip
205 pip install --quiet --upgrade "lftools<1.0.0"
207 # pipdeptree prints out a lot of information because lftools pulls in many
208 # dependencies. Let's only print it if we want to debug.
209 # echo "----> Pip Dependency Tree"
210 # pip install --quiet --upgrade pipdeptree
214 # SPDX-License-Identifier: EPL-1.0
215 ##############################################################################
216 # Copyright (c) 2017 The Linux Foundation and others.
218 # All rights reserved. This program and the accompanying materials
219 # are made available under the terms of the Eclipse Public License v1.0
220 # which accompanies this distribution, and is available at
221 # http://www.eclipse.org/legal/epl-v10.html
222 ##############################################################################
224 # This file contains a list of variables that are generally useful in many
225 # scripts. It is meant to be sourced in other scripts so that the variables can
228 MAVEN_OPTIONS="$(echo --show-version \
231 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
232 -Dmaven.repo.local=/tmp/r \
233 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)"
234 echo "$MAVEN_OPTIONS"
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 ##############################################################################
247 # This script builds a Maven project and deploys it into a staging repo which
248 # can be used to deploy elsewhere later eg. Nexus staging / snapshot repos.
250 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
251 # Ensure we fail the job if any steps fail.
257 # Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
258 # shellcheck disable=SC2086
260 --global-settings "$GLOBAL_SETTINGS_FILE" \
261 --settings "$SETTINGS_FILE" \
262 -DaltDeploymentRepository=staging::default::file:"$WORKSPACE"/m2repo \
263 $MAVEN_PARAMS $MAVEN_OPTIONS
265 </hudson.tasks.Shell>
268 set +e # DO NOT cause build failure if any of the rm calls fail.
270 rm "$GLOBAL_SETTINGS_FILE" "$SETTINGS_FILE"
272 # In some cases we use the lf-provide-maven-settings macro to produce
273 # a "$HOME/.netrc" file containing credentials. Remove that file here
275 rm "$HOME/.netrc"
277 # DO NOT fail build if any of the above lines fail.
280 </hudson.tasks.Shell>
283 <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs">
284 <isRankActivated>false</isRankActivated>
289 <thresholdLimit>low</thresholdLimit>
290 <pluginName>[FINDBUGS] </pluginName>
292 <canRunOnFailed>false</canRunOnFailed>
293 <useStableBuildAsReference>false</useStableBuildAsReference>
294 <usePreviousBuildAsReference>false</usePreviousBuildAsReference>
295 <useDeltaValues>false</useDeltaValues>
299 <unstableTotalNormal/>
306 <shouldDetectModules>false</shouldDetectModules>
307 <dontComputeNew>true</dontComputeNew>
308 <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
310 </hudson.plugins.findbugs.FindBugsPublisher>
311 <hudson.plugins.jacoco.JacocoPublisher>
312 <execPattern>**/**.exec</execPattern>
313 <classPattern>**/classes</classPattern>
314 <sourcePattern>**/src/main/java</sourcePattern>
317 <exclusionPattern>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</exclusionPattern>
318 <maximumBranchCoverage>10</maximumBranchCoverage>
319 <minimumBranchCoverage>20</minimumBranchCoverage>
320 <maximumMethodCoverage>50</maximumMethodCoverage>
321 <minimumMethodCoverage>40</minimumMethodCoverage>
322 </hudson.plugins.jacoco.JacocoPublisher>
323 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
327 # SPDX-License-Identifier: EPL-1.0
328 ##############################################################################
329 # Copyright (c) 2017 The Linux Foundation and others.
331 # All rights reserved. This program and the accompanying materials
332 # are made available under the terms of the Eclipse Public License v1.0
333 # which accompanies this distribution, and is available at
334 # http://www.eclipse.org/legal/epl-v10.html
335 ##############################################################################
336 echo "---> sysstat.sh"
337 set +e # DON'T fail build if script fails.
339 OS=$(facter operatingsystem)
340 case "$OS" in
342 SYSSTAT_PATH="/var/log/sysstat"
344 # Dont run the script when systat is not enabled by default
345 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
350 SYSSTAT_PATH="/var/log/sa"
358 SAR_DIR="$WORKSPACE/archives/sar-reports"
359 mkdir -p "$SAR_DIR"
360 cp "$SYSSTAT_PATH/"* "$_"
361 # convert sar data to ascii format
362 while IFS="" read -r s
364 [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/sar${s//[!0-9]/}"
365 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
367 # DON'T fail build if script fails.
370 </hudson.tasks.Shell>
371 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
373 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
374 <fileId>jenkins-log-archives-settings</fileId>
376 <variable>SETTINGS_FILE</variable>
377 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
379 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
382 <propertiesContent>SERVER_ID=logs</propertiesContent>
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 ##############################################################################
396 echo "---> create-netrc.sh"
398 # Ensure we fail the job if any steps fail.
401 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
402 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
403 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
404 -v x:username -o ":" -v x:password \
405 "$SETTINGS_FILE")
407 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
408 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
409 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
411 echo "machine $machine login $user password $pass" > ~/.netrc
413 </hudson.tasks.Shell>
416 # SPDX-License-Identifier: EPL-1.0
417 ##############################################################################
418 # Copyright (c) 2017 The Linux Foundation and others.
420 # All rights reserved. This program and the accompanying materials
421 # are made available under the terms of the Eclipse Public License v1.0
422 # which accompanies this distribution, and is available at
423 # http://www.eclipse.org/legal/epl-v10.html
424 ##############################################################################
425 echo "---> lftools-install.sh"
427 # Ensure we fail the job if any steps fail.
428 # DO NOT set -u as virtualenv's activate script has unbound variables
431 virtualenv --quiet "/tmp/v/lftools"
432 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
433 source "/tmp/v/lftools/bin/activate"
434 pip install --quiet --upgrade pip
435 pip install --quiet --upgrade "lftools<1.0.0"
437 # pipdeptree prints out a lot of information because lftools pulls in many
438 # dependencies. Let's only print it if we want to debug.
439 # echo "----> Pip Dependency Tree"
440 # pip install --quiet --upgrade pipdeptree
444 # SPDX-License-Identifier: EPL-1.0
445 ##############################################################################
446 # Copyright (c) 2017 The Linux Foundation and others.
448 # All rights reserved. This program and the accompanying materials
449 # are made available under the terms of the Eclipse Public License v1.0
450 # which accompanies this distribution, and is available at
451 # http://www.eclipse.org/legal/epl-v10.html
452 ##############################################################################
453 echo "---> logs-deploy.sh"
455 # Ensure we fail the job if any steps fail.
458 set -x # Trace commands for this script to make debugging easier.
460 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
461 LOGS_SERVER="${LOGS_SERVER:-None}"
463 if [ "${LOGS_SERVER}" == 'None' ]
465 set +x # Disable trace since we no longer need it
467 echo "WARNING: Logging server not set"
469 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
470 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
471 BUILD_URL="${BUILD_URL}"
473 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
474 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
476 set +x # Disable trace since we no longer need it.
478 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
481 </hudson.tasks.Shell>
484 # SPDX-License-Identifier: EPL-1.0
485 ##############################################################################
486 # Copyright (c) 2017 The Linux Foundation and others.
488 # All rights reserved. This program and the accompanying materials
489 # are made available under the terms of the Eclipse Public License v1.0
490 # which accompanies this distribution, and is available at
491 # http://www.eclipse.org/legal/epl-v10.html
492 ##############################################################################
494 # Clear log credential files
495 rm "$SETTINGS_FILE"
498 </hudson.tasks.Shell>
499 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
500 <regexp>^Build logs: .*</regexp>
501 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
503 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
504 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
505 <markBuildUnstable>false</markBuildUnstable>
506 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
507 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
509 <hudson.plugins.ws__cleanup.Pattern>
510 <pattern>**/*.jenkins-trigger</pattern>
512 </hudson.plugins.ws__cleanup.Pattern>
514 <deleteDirs>false</deleteDirs>
515 <cleanupMatrixParent>false</cleanupMatrixParent>
517 <cleanWhenSuccess>true</cleanWhenSuccess>
518 <cleanWhenUnstable>true</cleanWhenUnstable>
519 <cleanWhenFailure>true</cleanWhenFailure>
520 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
521 <cleanWhenAborted>true</cleanWhenAborted>
522 <notFailBuild>true</notFailBuild>
523 </hudson.plugins.ws__cleanup.WsCleanup>
526 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
527 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
528 <timeoutMinutes>60</timeoutMinutes>
529 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
530 <failBuild>true</failBuild>
531 <writingDescription>false</writingDescription>
532 <timeoutPercentage>0</timeoutPercentage>
533 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
534 <timeoutType>absolute</timeoutType>
535 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
536 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
537 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
538 <user>test-credential</user>
539 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
540 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>