1 <?xml version="1.0" encoding="utf-8"?>
4 <description><!-- Managed by Jenkins Job Builder --></description>
5 <keepDependencies>false</keepDependencies>
6 <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
7 <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
8 <concurrentBuild>true</concurrentBuild>
9 <assignedNode>build-vm</assignedNode>
10 <canRoam>false</canRoam>
12 <jenkins.model.BuildDiscarderProperty>
13 <strategy class="hudson.tasks.LogRotator">
14 <daysToKeep>7</daysToKeep>
15 <numToKeep>-1</numToKeep>
16 <artifactDaysToKeep>-1</artifactDaysToKeep>
17 <artifactNumToKeep>0</artifactNumToKeep>
19 </jenkins.model.BuildDiscarderProperty>
20 <hudson.model.ParametersDefinitionProperty>
21 <parameterDefinitions>
22 <hudson.model.StringParameterDefinition>
24 <description>Parameter to identify a Gerrit project. This is typically the
25 project repo path as exists in Gerrit.
26 For example: ofextensions/circuitsw
28 <defaultValue>releng/ciman</defaultValue>
29 </hudson.model.StringParameterDefinition>
30 <hudson.model.StringParameterDefinition>
32 <description>Stream is often set to the same name as 'branch' but can
33 sometimes be used as a name representing a project's release code
36 <defaultValue>master</defaultValue>
37 </hudson.model.StringParameterDefinition>
38 <hudson.model.StringParameterDefinition>
39 <name>GERRIT_PROJECT</name>
40 <description>Parameter to identify Gerrit project. This is typically the
41 project repo path as exists in Gerrit.
42 For example: ofextensions/circuitsw
44 Note that Gerrit will override this parameter automatically if a
45 job is triggered by Gerrit.
47 <defaultValue>releng/ciman</defaultValue>
48 </hudson.model.StringParameterDefinition>
49 <hudson.model.StringParameterDefinition>
50 <name>GERRIT_BRANCH</name>
51 <description>Parameter to identify a Gerrit branch.
53 Note that Gerrit will override this parameter automatically if a
54 job is triggered by Gerrit.
56 <defaultValue>master</defaultValue>
57 </hudson.model.StringParameterDefinition>
58 <hudson.model.StringParameterDefinition>
59 <name>GERRIT_REFSPEC</name>
60 <description>Parameter to identify a refspec when pulling from Gerrit.
62 Note that Gerrit will override this parameter automatically if a
63 job is triggered by Gerrit.
65 <defaultValue>refs/heads/master</defaultValue>
66 </hudson.model.StringParameterDefinition>
67 <hudson.model.StringParameterDefinition>
68 <name>LFTOOLS_VERSION</name>
69 <description>Version of lftools to install. Can be a specific version like
70 '0.6.0' or a PEP-440 definition.
71 https://www.python.org/dev/peps/pep-0440/
72 For example '<1.0.0' or '>=1.0.0,<2.0.0'.
74 <defaultValue><1.0.0</defaultValue>
75 </hudson.model.StringParameterDefinition>
76 </parameterDefinitions>
77 </hudson.model.ParametersDefinitionProperty>
79 <scm class="hudson.plugins.git.GitSCM">
80 <configVersion>2</configVersion>
82 <hudson.plugins.git.UserRemoteConfig>
85 <url>$GIT_URL/$PROJECT</url>
86 <credentialsId>test-credential</credentialsId>
87 </hudson.plugins.git.UserRemoteConfig>
90 <hudson.plugins.git.BranchSpec>
91 <name>refs/heads/master</name>
92 </hudson.plugins.git.BranchSpec>
95 <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
96 <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
97 <authorOrCommitter>false</authorOrCommitter>
98 <wipeOutWorkspace>true</wipeOutWorkspace>
99 <pruneBranches>false</pruneBranches>
100 <remotePoll>false</remotePoll>
101 <gitTool>Default</gitTool>
102 <submoduleCfg class="list"/>
107 <skipTag>true</skipTag>
109 <useShallowClone>false</useShallowClone>
110 <ignoreNotifyCommit>false</ignoreNotifyCommit>
112 <hudson.plugins.git.extensions.impl.SubmoduleOption>
113 <disableSubmodules>false</disableSubmodules>
114 <recursiveSubmodules>true</recursiveSubmodules>
115 <trackingSubmodules>false</trackingSubmodules>
117 <timeout>10</timeout>
118 </hudson.plugins.git.extensions.impl.SubmoduleOption>
119 <hudson.plugins.git.extensions.impl.WipeWorkspace/>
122 <triggers class="vector">
123 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
126 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
127 <compareType>ANT</compareType>
128 <pattern>**</pattern>
130 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
131 <compareType>ANT</compareType>
132 <pattern>**/master</pattern>
133 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
136 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
137 <compareType>ANT</compareType>
138 <pattern>**/*.rst</pattern>
139 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
140 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
141 <compareType>ANT</compareType>
142 <pattern>**/conf.py</pattern>
143 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
145 <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
146 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
149 <onSuccessful>false</onSuccessful>
150 <onFailed>false</onFailed>
151 <onUnstable>false</onUnstable>
152 <onNotBuilt>false</onNotBuilt>
154 <silentMode>false</silentMode>
155 <silentStartMode>false</silentStartMode>
156 <escapeQuotes>true</escapeQuotes>
157 <noNameAndEmailParameters>false</noNameAndEmailParameters>
158 <readableMessage>false</readableMessage>
159 <dependencyJobsNames/>
161 <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
163 <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
165 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
166 <excludeDrafts>false</excludeDrafts>
167 <excludeTrivialRebase>false</excludeTrivialRebase>
168 <excludeNoCodeChange>false</excludeNoCodeChange>
169 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
170 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginDraftPublishedEvent/>
171 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
172 <commentAddedCommentContains>recheck$</commentAddedCommentContains>
173 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
176 <buildFailureMessage/>
177 <buildSuccessfulMessage/>
178 <buildUnstableMessage/>
179 <buildNotBuiltMessage/>
180 <buildUnsuccessfulFilepath/>
182 <serverName>test-server</serverName>
183 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
188 <propertiesContent>DOC_DIR=docs/_build/html</propertiesContent>
193 # SPDX-License-Identifier: EPL-1.0
194 ##############################################################################
195 # Copyright (c) 2017 The Linux Foundation and others.
197 # All rights reserved. This program and the accompanying materials
198 # are made available under the terms of the Eclipse Public License v1.0
199 # which accompanies this distribution, and is available at
200 # http://www.eclipse.org/legal/epl-v10.html
201 ##############################################################################
202 echo "---> tox-install.sh"
204 # Ensure we fail the job if any steps fail.
205 # DO NOT set -u as virtualenv's activate script has unbound variables
208 virtualenv --quiet "/tmp/v/tox"
209 # shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
210 source "/tmp/v/tox/bin/activate"
211 pip install --quiet --upgrade pip
212 pip install --quiet --upgrade pipdeptree
213 pip install --quiet --upgrade tox argparse
215 echo "----> Pip Dependency Tree"
219 # SPDX-License-Identifier: EPL-1.0
220 ##############################################################################
221 # Copyright (c) 2017 The Linux Foundation and others.
223 # All rights reserved. This program and the accompanying materials
224 # are made available under the terms of the Eclipse Public License v1.0
225 # which accompanies this distribution, and is available at
226 # http://www.eclipse.org/legal/epl-v10.html
227 ##############################################################################
228 echo "---> rtd-verify.sh"
230 # Ensure we fail the job if any steps fail.
231 # DO NOT set -u as virtualenv's activate script has unbound variables
234 echo "---> Fetching project"
235 if [ "$GERRIT_PROJECT" != "$PROJECT" ]; then
236 cd "docs/submodules/$GERRIT_PROJECT"
239 git fetch origin "$GERRIT_REFSPEC" && git checkout FETCH_HEAD
241 echo "---> Generating docs"
242 cd "$WORKSPACE"
245 echo "---> Archiving generated docs"
246 mkdir -p "$WORKSPACE/archives"
247 mv "$DOC_DIR" archives/
249 </hudson.tasks.Shell>
252 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
256 # SPDX-License-Identifier: EPL-1.0
257 ##############################################################################
258 # Copyright (c) 2017 The Linux Foundation and others.
260 # All rights reserved. This program and the accompanying materials
261 # are made available under the terms of the Eclipse Public License v1.0
262 # which accompanies this distribution, and is available at
263 # http://www.eclipse.org/legal/epl-v10.html
264 ##############################################################################
265 echo "---> sysstat.sh"
266 set +e # DON'T fail build if script fails.
268 OS=$(facter operatingsystem)
269 case "$OS" in
271 SYSSTAT_PATH="/var/log/sysstat"
273 # Dont run the script when systat is not enabled by default
274 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
279 SYSSTAT_PATH="/var/log/sa"
287 SAR_DIR="$WORKSPACE/archives/sar-reports"
288 mkdir -p "$SAR_DIR"
289 cp "$SYSSTAT_PATH/"* "$_"
290 # convert sar data to ascii format
291 while IFS="" read -r s
293 [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/sar${s//[!0-9]/}"
294 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
296 # DON'T fail build if script fails.
299 </hudson.tasks.Shell>
300 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
302 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
303 <fileId>jenkins-log-archives-settings</fileId>
305 <variable>SETTINGS_FILE</variable>
306 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
308 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
311 <propertiesContent>SERVER_ID=logs</propertiesContent>
316 # SPDX-License-Identifier: EPL-1.0
317 ##############################################################################
318 # Copyright (c) 2017 The Linux Foundation and others.
320 # All rights reserved. This program and the accompanying materials
321 # are made available under the terms of the Eclipse Public License v1.0
322 # which accompanies this distribution, and is available at
323 # http://www.eclipse.org/legal/epl-v10.html
324 ##############################################################################
325 echo "---> create-netrc.sh"
327 # Ensure we fail the job if any steps fail.
330 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
331 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
332 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
333 -v x:username -o ":" -v x:password \
334 "$SETTINGS_FILE")
336 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
337 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
338 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
340 echo "machine $machine login $user password $pass" > ~/.netrc
342 </hudson.tasks.Shell>
345 # SPDX-License-Identifier: EPL-1.0
346 ##############################################################################
347 # Copyright (c) 2017 The Linux Foundation and others.
349 # All rights reserved. This program and the accompanying materials
350 # are made available under the terms of the Eclipse Public License v1.0
351 # which accompanies this distribution, and is available at
352 # http://www.eclipse.org/legal/epl-v10.html
353 ##############################################################################
354 echo "---> lftools-install.sh"
356 # Script to install lftools via a version passed in via lf-infra-parameters
358 # Required parameters:
360 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
361 # set to a strict version number like '1.2.3' or using
362 # PEP-440 definitions.
366 # >=1.0.0,<2.0.0
368 # By default a released version of lftools should always be used.
369 # The purpose of the 2 variables below is so that lftools devs can test
370 # unreleased versions of lftools. There are 2 methods to install a dev version
373 # 1) gerrit patch: Used to test a patch that has not yet been merged.
374 # To do this set something like this:
375 # LFTOOLS_MODE=gerrit
376 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
378 # 2) git branch: Used to install an lftools version from a specific branch.
379 # To use this set the variables as follows:
381 # LFTOOLS_REFSPEC=master
383 # 3) release : The intended use case and default setting.
384 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
386 LFTOOLS_MODE=release # release | git | gerrit
387 LFTOOLS_REFSPEC=master
389 # Ensure we fail the job if any steps fail.
390 # DO NOT set -u as virtualenv's activate script has unbound variables
393 virtualenv --quiet "/tmp/v/lftools"
394 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
395 source "/tmp/v/lftools/bin/activate"
396 pip install --quiet --upgrade pip
398 case $LFTOOLS_MODE in
400 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
402 git fetch origin "$LFTOOLS_REFSPEC"
403 git checkout FETCH_HEAD
404 pip install --quiet --upgrade -r requirements.txt
405 pip install --quiet --upgrade -e .
410 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
414 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
415 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
418 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
424 # pipdeptree prints out a lot of information because lftools pulls in many
425 # dependencies. Let's only print it if we want to debug.
426 # echo "----> Pip Dependency Tree"
427 # pip install --quiet --upgrade pipdeptree
431 # SPDX-License-Identifier: EPL-1.0
432 ##############################################################################
433 # Copyright (c) 2017 The Linux Foundation and others.
435 # All rights reserved. This program and the accompanying materials
436 # are made available under the terms of the Eclipse Public License v1.0
437 # which accompanies this distribution, and is available at
438 # http://www.eclipse.org/legal/epl-v10.html
439 ##############################################################################
440 echo "---> logs-deploy.sh"
442 # Ensure we fail the job if any steps fail.
445 set -x # Trace commands for this script to make debugging easier.
447 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
448 LOGS_SERVER="${LOGS_SERVER:-None}"
450 if [ "${LOGS_SERVER}" == 'None' ]
452 set +x # Disable trace since we no longer need it
454 echo "WARNING: Logging server not set"
456 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
457 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
458 BUILD_URL="${BUILD_URL}"
460 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
461 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
463 set +x # Disable trace since we no longer need it.
465 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
468 </hudson.tasks.Shell>
471 # SPDX-License-Identifier: EPL-1.0
472 ##############################################################################
473 # Copyright (c) 2017 The Linux Foundation and others.
475 # All rights reserved. This program and the accompanying materials
476 # are made available under the terms of the Eclipse Public License v1.0
477 # which accompanies this distribution, and is available at
478 # http://www.eclipse.org/legal/epl-v10.html
479 ##############################################################################
481 # Clear log credential files
482 rm "$SETTINGS_FILE"
485 </hudson.tasks.Shell>
486 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
487 <regexp>^Build logs: .*</regexp>
488 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
490 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
491 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
492 <markBuildUnstable>false</markBuildUnstable>
493 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
494 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
496 <hudson.plugins.ws__cleanup.Pattern>
497 <pattern>**/*.jenkins-trigger</pattern>
499 </hudson.plugins.ws__cleanup.Pattern>
501 <deleteDirs>false</deleteDirs>
502 <cleanupMatrixParent>false</cleanupMatrixParent>
504 <cleanWhenSuccess>true</cleanWhenSuccess>
505 <cleanWhenUnstable>true</cleanWhenUnstable>
506 <cleanWhenFailure>true</cleanWhenFailure>
507 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
508 <cleanWhenAborted>true</cleanWhenAborted>
509 <notFailBuild>true</notFailBuild>
510 </hudson.plugins.ws__cleanup.WsCleanup>
513 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
514 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
515 <timeoutMinutes>15</timeoutMinutes>
516 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
517 <failBuild>true</failBuild>
518 <writingDescription>false</writingDescription>
519 <timeoutPercentage>0</timeoutPercentage>
520 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
521 <timeoutType>absolute</timeoutType>
522 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
523 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
524 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
525 <user>test-credential</user>
526 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
527 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>