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.PluginChangeMergedEvent/>
166 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
167 <commentAddedCommentContains>recheck$</commentAddedCommentContains>
168 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
171 <buildFailureMessage/>
172 <buildSuccessfulMessage/>
173 <buildUnstableMessage/>
174 <buildNotBuiltMessage/>
175 <buildUnsuccessfulFilepath/>
177 <serverName>test-server</serverName>
178 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
183 <propertiesContent>DOC_DIR=docs/_build/html</propertiesContent>
188 # SPDX-License-Identifier: EPL-1.0
189 ##############################################################################
190 # Copyright (c) 2017 The Linux Foundation and others.
192 # All rights reserved. This program and the accompanying materials
193 # are made available under the terms of the Eclipse Public License v1.0
194 # which accompanies this distribution, and is available at
195 # http://www.eclipse.org/legal/epl-v10.html
196 ##############################################################################
197 echo "---> tox-install.sh"
199 # Ensure we fail the job if any steps fail.
200 # DO NOT set -u as virtualenv's activate script has unbound variables
203 virtualenv --quiet "/tmp/v/tox"
204 # shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
205 source "/tmp/v/tox/bin/activate"
206 pip install --quiet --upgrade pip
207 pip install --quiet --upgrade pipdeptree
208 pip install --quiet --upgrade tox argparse
210 echo "----> Pip Dependency Tree"
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 ##############################################################################
223 echo "---> rtd-verify.sh"
225 # Ensure we fail the job if any steps fail.
226 # DO NOT set -u as virtualenv's activate script has unbound variables
229 echo "---> Fetching project"
230 if [ "$GERRIT_PROJECT" != "$PROJECT" ]; then
231 cd "docs/submodules/$GERRIT_PROJECT"
234 git fetch origin "$GERRIT_REFSPEC" && git checkout FETCH_HEAD
236 echo "---> Generating docs"
239 echo "---> Archiving generated docs"
240 mkdir -p "$WORKSPACE/archives"
241 mv "$DOC_DIR" archives/
243 </hudson.tasks.Shell>
246 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
250 # SPDX-License-Identifier: EPL-1.0
251 ##############################################################################
252 # Copyright (c) 2017 The Linux Foundation and others.
254 # All rights reserved. This program and the accompanying materials
255 # are made available under the terms of the Eclipse Public License v1.0
256 # which accompanies this distribution, and is available at
257 # http://www.eclipse.org/legal/epl-v10.html
258 ##############################################################################
259 echo "---> sysstat.sh"
260 set +e # DON'T fail build if script fails.
262 OS=$(facter operatingsystem)
263 case "$OS" in
265 SYSSTAT_PATH="/var/log/sysstat"
267 # Dont run the script when systat is not enabled by default
268 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
273 SYSSTAT_PATH="/var/log/sa"
281 SAR_DIR="$WORKSPACE/archives/sar-reports"
282 mkdir -p "$SAR_DIR"
283 cp "$SYSSTAT_PATH/"* "$_"
284 # convert sar data to ascii format
285 while IFS="" read -r s
287 [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/sar${s//[!0-9]/}"
288 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
290 # DON'T fail build if script fails.
293 </hudson.tasks.Shell>
294 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
296 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
297 <fileId>jenkins-log-archives-settings</fileId>
299 <variable>SETTINGS_FILE</variable>
300 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
302 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
305 <propertiesContent>SERVER_ID=logs</propertiesContent>
310 # SPDX-License-Identifier: EPL-1.0
311 ##############################################################################
312 # Copyright (c) 2017 The Linux Foundation and others.
314 # All rights reserved. This program and the accompanying materials
315 # are made available under the terms of the Eclipse Public License v1.0
316 # which accompanies this distribution, and is available at
317 # http://www.eclipse.org/legal/epl-v10.html
318 ##############################################################################
319 echo "---> create-netrc.sh"
321 # Ensure we fail the job if any steps fail.
324 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
325 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
326 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
327 -v x:username -o ":" -v x:password \
328 "$SETTINGS_FILE")
330 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
331 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
332 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
334 echo "machine $machine login $user password $pass" > ~/.netrc
336 </hudson.tasks.Shell>
339 # SPDX-License-Identifier: EPL-1.0
340 ##############################################################################
341 # Copyright (c) 2017 The Linux Foundation and others.
343 # All rights reserved. This program and the accompanying materials
344 # are made available under the terms of the Eclipse Public License v1.0
345 # which accompanies this distribution, and is available at
346 # http://www.eclipse.org/legal/epl-v10.html
347 ##############################################################################
348 echo "---> lftools-install.sh"
350 # Script to install lftools via a version passed in via lf-infra-parameters
352 # Required parameters:
354 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
355 # set to a strict version number like '1.2.3' or using
356 # PEP-440 definitions.
360 # >=1.0.0,<2.0.0
362 # By default a released version of lftools should always be used.
363 # The purpose of the 2 variables below is so that lftools devs can test
364 # unreleased versions of lftools. There are 2 methods to install a dev version
367 # 1) gerrit patch: Used to test a patch that has not yet been merged.
368 # To do this set something like this:
369 # LFTOOLS_MODE=gerrit
370 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
372 # 2) git branch: Used to install an lftools version from a specific branch.
373 # To use this set the variables as follows:
375 # LFTOOLS_REFSPEC=master
377 # 3) release : The intended use case and default setting.
378 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
380 LFTOOLS_MODE=release # release | git | gerrit
381 LFTOOLS_REFSPEC=master
383 # Ensure we fail the job if any steps fail.
384 # DO NOT set -u as virtualenv's activate script has unbound variables
387 virtualenv --quiet "/tmp/v/lftools"
388 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
389 source "/tmp/v/lftools/bin/activate"
390 pip install --quiet --upgrade pip
392 case $LFTOOLS_MODE in
394 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
396 git fetch origin "$LFTOOLS_REFSPEC"
397 git checkout FETCH_HEAD
398 pip install --quiet --upgrade -r requirements.txt
399 pip install --quiet --upgrade -e .
404 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
408 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
409 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
412 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
418 # pipdeptree prints out a lot of information because lftools pulls in many
419 # dependencies. Let's only print it if we want to debug.
420 # echo "----> Pip Dependency Tree"
421 # pip install --quiet --upgrade pipdeptree
425 # SPDX-License-Identifier: EPL-1.0
426 ##############################################################################
427 # Copyright (c) 2017 The Linux Foundation and others.
429 # All rights reserved. This program and the accompanying materials
430 # are made available under the terms of the Eclipse Public License v1.0
431 # which accompanies this distribution, and is available at
432 # http://www.eclipse.org/legal/epl-v10.html
433 ##############################################################################
434 echo "---> logs-deploy.sh"
436 # Ensure we fail the job if any steps fail.
439 set -x # Trace commands for this script to make debugging easier.
441 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
442 LOGS_SERVER="${LOGS_SERVER:-None}"
444 if [ "${LOGS_SERVER}" == 'None' ]
446 set +x # Disable trace since we no longer need it
448 echo "WARNING: Logging server not set"
450 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
451 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
452 BUILD_URL="${BUILD_URL}"
454 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
455 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
457 set +x # Disable trace since we no longer need it.
459 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
462 </hudson.tasks.Shell>
465 # SPDX-License-Identifier: EPL-1.0
466 ##############################################################################
467 # Copyright (c) 2017 The Linux Foundation and others.
469 # All rights reserved. This program and the accompanying materials
470 # are made available under the terms of the Eclipse Public License v1.0
471 # which accompanies this distribution, and is available at
472 # http://www.eclipse.org/legal/epl-v10.html
473 ##############################################################################
475 # Clear log credential files
476 rm "$SETTINGS_FILE"
479 </hudson.tasks.Shell>
480 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
481 <regexp>^Build logs: .*</regexp>
482 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
484 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
485 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
486 <markBuildUnstable>false</markBuildUnstable>
487 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
488 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
490 <hudson.plugins.ws__cleanup.Pattern>
491 <pattern>**/*.jenkins-trigger</pattern>
493 </hudson.plugins.ws__cleanup.Pattern>
495 <deleteDirs>false</deleteDirs>
496 <cleanupMatrixParent>false</cleanupMatrixParent>
498 <cleanWhenSuccess>true</cleanWhenSuccess>
499 <cleanWhenUnstable>true</cleanWhenUnstable>
500 <cleanWhenFailure>true</cleanWhenFailure>
501 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
502 <cleanWhenAborted>true</cleanWhenAborted>
503 <notFailBuild>true</notFailBuild>
504 </hudson.plugins.ws__cleanup.WsCleanup>
507 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
508 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
509 <timeoutMinutes>15</timeoutMinutes>
510 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
511 <failBuild>true</failBuild>
512 <writingDescription>false</writingDescription>
513 <timeoutPercentage>0</timeoutPercentage>
514 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
515 <timeoutType>absolute</timeoutType>
516 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
517 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
518 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
519 <user>test-credential</user>
520 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
521 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>