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>false</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.scm.NullSCM"/>
80 <triggers class="vector">
81 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
84 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
85 <compareType>ANT</compareType>
88 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
89 <compareType>ANT</compareType>
90 <pattern>**/master</pattern>
91 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
94 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
95 <compareType>ANT</compareType>
96 <pattern>**/*.rst</pattern>
97 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
98 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
99 <compareType>ANT</compareType>
100 <pattern>**/conf.py</pattern>
101 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
103 <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
104 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
107 <onSuccessful>false</onSuccessful>
108 <onFailed>false</onFailed>
109 <onUnstable>false</onUnstable>
110 <onNotBuilt>false</onNotBuilt>
112 <silentMode>false</silentMode>
113 <silentStartMode>false</silentStartMode>
114 <escapeQuotes>true</escapeQuotes>
115 <noNameAndEmailParameters>false</noNameAndEmailParameters>
116 <readableMessage>false</readableMessage>
117 <dependencyJobsNames/>
119 <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
121 <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
123 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginChangeMergedEvent/>
124 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
125 <commentAddedCommentContains>remerge$</commentAddedCommentContains>
126 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
129 <buildFailureMessage/>
130 <buildSuccessfulMessage/>
131 <buildUnstableMessage/>
132 <buildNotBuiltMessage/>
133 <buildUnsuccessfulFilepath/>
135 <serverName>test-server</serverName>
136 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
141 <propertiesContent>RTD_PROJECT=gerrit-rtd</propertiesContent>
146 # SPDX-License-Identifier: EPL-1.0
147 ##############################################################################
148 # Copyright (c) 2017 The Linux Foundation and others.
150 # All rights reserved. This program and the accompanying materials
151 # are made available under the terms of the Eclipse Public License v1.0
152 # which accompanies this distribution, and is available at
153 # http://www.eclipse.org/legal/epl-v10.html
154 ##############################################################################
155 echo "---> rtd-trigger-build.sh"
157 if [ "$GERRIT_BRANCH" == "master" ]; then
158 RTD_BUILD_VERSION=latest
160 RTD_BUILD_VERSION="${GERRIT_BRANCH/\//-}"
163 curl -X POST --data "version_slug=$RTD_BUILD_VERSION" "https://readthedocs.org/build/$RTD_PROJECT"
165 </hudson.tasks.Shell>
168 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
172 # SPDX-License-Identifier: EPL-1.0
173 ##############################################################################
174 # Copyright (c) 2017 The Linux Foundation and others.
176 # All rights reserved. This program and the accompanying materials
177 # are made available under the terms of the Eclipse Public License v1.0
178 # which accompanies this distribution, and is available at
179 # http://www.eclipse.org/legal/epl-v10.html
180 ##############################################################################
181 echo "---> sysstat.sh"
182 set +e # DON'T fail build if script fails.
184 OS=$(facter operatingsystem)
185 case "$OS" in
187 SYSSTAT_PATH="/var/log/sysstat"
189 # Dont run the script when systat is not enabled by default
190 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
195 SYSSTAT_PATH="/var/log/sa"
203 SAR_DIR="$WORKSPACE/archives/sar-reports"
204 mkdir -p "$SAR_DIR"
205 cp "$SYSSTAT_PATH/"* "$_"
206 # convert sar data to ascii format
207 while IFS="" read -r s
209 [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/sar${s//[!0-9]/}"
210 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
212 # DON'T fail build if script fails.
215 </hudson.tasks.Shell>
216 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
218 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
219 <fileId>jenkins-log-archives-settings</fileId>
221 <variable>SETTINGS_FILE</variable>
222 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
224 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
227 <propertiesContent>SERVER_ID=logs</propertiesContent>
232 # SPDX-License-Identifier: EPL-1.0
233 ##############################################################################
234 # Copyright (c) 2017 The Linux Foundation and others.
236 # All rights reserved. This program and the accompanying materials
237 # are made available under the terms of the Eclipse Public License v1.0
238 # which accompanies this distribution, and is available at
239 # http://www.eclipse.org/legal/epl-v10.html
240 ##############################################################################
241 echo "---> create-netrc.sh"
243 # Ensure we fail the job if any steps fail.
246 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
247 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
248 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
249 -v x:username -o ":" -v x:password \
250 "$SETTINGS_FILE")
252 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
253 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
254 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
256 echo "machine ${machine%:*} login $user password $pass" > ~/.netrc
258 </hudson.tasks.Shell>
261 # SPDX-License-Identifier: EPL-1.0
262 ##############################################################################
263 # Copyright (c) 2017 The Linux Foundation and others.
265 # All rights reserved. This program and the accompanying materials
266 # are made available under the terms of the Eclipse Public License v1.0
267 # which accompanies this distribution, and is available at
268 # http://www.eclipse.org/legal/epl-v10.html
269 ##############################################################################
270 echo "---> lftools-install.sh"
272 # Script to install lftools via a version passed in via lf-infra-parameters
274 # Required parameters:
276 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
277 # set to a strict version number like '1.2.3' or using
278 # PEP-440 definitions.
282 # >=1.0.0,<2.0.0
284 # By default a released version of lftools should always be used.
285 # The purpose of the 2 variables below is so that lftools devs can test
286 # unreleased versions of lftools. There are 2 methods to install a dev version
289 # 1) gerrit patch: Used to test a patch that has not yet been merged.
290 # To do this set something like this:
291 # LFTOOLS_MODE=gerrit
292 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
294 # 2) git branch: Used to install an lftools version from a specific branch.
295 # To use this set the variables as follows:
297 # LFTOOLS_REFSPEC=master
299 # 3) release : The intended use case and default setting.
300 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
302 LFTOOLS_MODE=release # release | git | gerrit
303 LFTOOLS_REFSPEC=master
305 # Ensure we fail the job if any steps fail.
306 # DO NOT set -u as virtualenv's activate script has unbound variables
309 virtualenv --quiet "/tmp/v/lftools"
310 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
311 source "/tmp/v/lftools/bin/activate"
312 pip install --quiet --upgrade pip
314 case $LFTOOLS_MODE in
316 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
318 git fetch origin "$LFTOOLS_REFSPEC"
319 git checkout FETCH_HEAD
320 pip install --quiet --upgrade -r requirements.txt
321 pip install --quiet --upgrade -e .
326 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
330 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
331 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
334 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
340 # pipdeptree prints out a lot of information because lftools pulls in many
341 # dependencies. Let's only print it if we want to debug.
342 # echo "----> Pip Dependency Tree"
343 # pip install --quiet --upgrade pipdeptree
347 # SPDX-License-Identifier: EPL-1.0
348 ##############################################################################
349 # Copyright (c) 2017 The Linux Foundation and others.
351 # All rights reserved. This program and the accompanying materials
352 # are made available under the terms of the Eclipse Public License v1.0
353 # which accompanies this distribution, and is available at
354 # http://www.eclipse.org/legal/epl-v10.html
355 ##############################################################################
356 echo "---> logs-deploy.sh"
358 # Ensure we fail the job if any steps fail.
361 set -x # Trace commands for this script to make debugging easier.
363 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
364 LOGS_SERVER="${LOGS_SERVER:-None}"
366 if [ "${LOGS_SERVER}" == 'None' ]
368 set +x # Disable trace since we no longer need it
370 echo "WARNING: Logging server not set"
372 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
373 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
374 BUILD_URL="${BUILD_URL}"
376 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
377 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
379 set +x # Disable trace since we no longer need it.
381 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
384 </hudson.tasks.Shell>
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 ##############################################################################
397 # Clear log credential files
398 rm "$SETTINGS_FILE"
401 </hudson.tasks.Shell>
402 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
403 <regexp>^Build logs: .*</regexp>
404 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
406 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
407 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
408 <markBuildUnstable>false</markBuildUnstable>
409 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
410 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
412 <hudson.plugins.ws__cleanup.Pattern>
413 <pattern>**/*.jenkins-trigger</pattern>
415 </hudson.plugins.ws__cleanup.Pattern>
417 <deleteDirs>false</deleteDirs>
418 <cleanupMatrixParent>false</cleanupMatrixParent>
420 <cleanWhenSuccess>true</cleanWhenSuccess>
421 <cleanWhenUnstable>true</cleanWhenUnstable>
422 <cleanWhenFailure>true</cleanWhenFailure>
423 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
424 <cleanWhenAborted>true</cleanWhenAborted>
425 <notFailBuild>true</notFailBuild>
426 </hudson.plugins.ws__cleanup.WsCleanup>
429 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
430 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
431 <timeoutMinutes>15</timeoutMinutes>
432 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
433 <failBuild>true</failBuild>
434 <writingDescription>false</writingDescription>
435 <timeoutPercentage>0</timeoutPercentage>
436 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
437 <timeoutType>absolute</timeoutType>
438 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
439 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
440 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
441 <user>test-credential</user>
442 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
443 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
444 <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
446 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
447 <fileId>npmrc</fileId>
448 <targetLocation>$HOME/.npmrc</targetLocation>
450 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
452 </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>