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.
66 </hudson.model.StringParameterDefinition>
67 <hudson.model.StringParameterDefinition>
69 <description>Path to directory containing tox.ini file.
72 </hudson.model.StringParameterDefinition>
73 <hudson.model.StringParameterDefinition>
75 <description>Tox environments to run build against.
79 </hudson.model.StringParameterDefinition>
80 </parameterDefinitions>
81 </hudson.model.ParametersDefinitionProperty>
83 <scm class="hudson.plugins.git.GitSCM">
84 <configVersion>2</configVersion>
86 <hudson.plugins.git.UserRemoteConfig>
88 <refspec>$GERRIT_REFSPEC</refspec>
89 <url>$GIT_URL/$GERRIT_PROJECT</url>
90 <credentialsId>test-credential</credentialsId>
91 </hudson.plugins.git.UserRemoteConfig>
94 <hudson.plugins.git.BranchSpec>
95 <name>refs/heads/$GERRIT_BRANCH</name>
96 </hudson.plugins.git.BranchSpec>
99 <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
100 <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
101 <authorOrCommitter>false</authorOrCommitter>
102 <wipeOutWorkspace>true</wipeOutWorkspace>
103 <pruneBranches>false</pruneBranches>
104 <remotePoll>false</remotePoll>
105 <gitTool>Default</gitTool>
106 <submoduleCfg class="list"/>
111 <skipTag>true</skipTag>
113 <useShallowClone>false</useShallowClone>
114 <ignoreNotifyCommit>false</ignoreNotifyCommit>
116 <hudson.plugins.git.extensions.impl.SubmoduleOption>
117 <disableSubmodules>false</disableSubmodules>
118 <recursiveSubmodules>true</recursiveSubmodules>
119 <trackingSubmodules>false</trackingSubmodules>
121 <timeout>10</timeout>
122 </hudson.plugins.git.extensions.impl.SubmoduleOption>
123 <hudson.plugins.git.extensions.impl.WipeWorkspace/>
126 <triggers class="vector">
127 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
130 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
131 <compareType>ANT</compareType>
132 <pattern>releng/ciman</pattern>
134 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
135 <compareType>ANT</compareType>
136 <pattern>**/master</pattern>
137 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
139 <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
140 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
143 <onSuccessful>false</onSuccessful>
144 <onFailed>false</onFailed>
145 <onUnstable>false</onUnstable>
146 <onNotBuilt>false</onNotBuilt>
148 <silentMode>false</silentMode>
149 <silentStartMode>false</silentStartMode>
150 <escapeQuotes>true</escapeQuotes>
151 <noNameAndEmailParameters>false</noNameAndEmailParameters>
152 <readableMessage>false</readableMessage>
153 <dependencyJobsNames/>
155 <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
157 <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
159 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
160 <excludeDrafts>false</excludeDrafts>
161 <excludeTrivialRebase>false</excludeTrivialRebase>
162 <excludeNoCodeChange>false</excludeNoCodeChange>
163 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
164 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginDraftPublishedEvent/>
165 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
166 <commentAddedCommentContains>recheck$</commentAddedCommentContains>
167 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
170 <buildFailureMessage/>
171 <buildSuccessfulMessage/>
172 <buildUnstableMessage/>
173 <buildNotBuiltMessage/>
174 <buildUnsuccessfulFilepath/>
176 <serverName>test-server</serverName>
177 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
182 # SPDX-License-Identifier: EPL-1.0
183 ##############################################################################
184 # Copyright (c) 2017 The Linux Foundation and others.
186 # All rights reserved. This program and the accompanying materials
187 # are made available under the terms of the Eclipse Public License v1.0
188 # which accompanies this distribution, and is available at
189 # http://www.eclipse.org/legal/epl-v10.html
190 ##############################################################################
191 echo "---> lftools-install.sh"
193 # Ensure we fail the job if any steps fail.
194 # DO NOT set -u as virtualenv's activate script has unbound variables
197 virtualenv --quiet "/tmp/v/lftools"
198 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
199 source "/tmp/v/lftools/bin/activate"
200 pip install --quiet --upgrade pip
201 pip install --quiet --upgrade "lftools<1.0.0"
203 # pipdeptree prints out a lot of information because lftools pulls in many
204 # dependencies. Let's only print it if we want to debug.
205 # echo "----> Pip Dependency Tree"
206 # pip install --quiet --upgrade pipdeptree
209 </hudson.tasks.Shell>
212 # SPDX-License-Identifier: EPL-1.0
213 ##############################################################################
214 # Copyright (c) 2017 The Linux Foundation and others.
216 # All rights reserved. This program and the accompanying materials
217 # are made available under the terms of the Eclipse Public License v1.0
218 # which accompanies this distribution, and is available at
219 # http://www.eclipse.org/legal/epl-v10.html
220 ##############################################################################
221 echo "---> tox-install.sh"
223 # Ensure we fail the job if any steps fail.
224 # DO NOT set -u as virtualenv's activate script has unbound variables
227 virtualenv --quiet "/tmp/v/tox"
228 # shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
229 source "/tmp/v/tox/bin/activate"
230 pip install --quiet --upgrade pip
231 pip install --quiet --upgrade pipdeptree
232 pip install --quiet --upgrade tox argparse
234 echo "----> Pip Dependency Tree"
238 # SPDX-License-Identifier: EPL-1.0
239 ##############################################################################
240 # Copyright (c) 2017 The Linux Foundation and others.
242 # All rights reserved. This program and the accompanying materials
243 # are made available under the terms of the Eclipse Public License v1.0
244 # which accompanies this distribution, and is available at
245 # http://www.eclipse.org/legal/epl-v10.html
246 ##############################################################################
247 echo "---> tox-install.sh"
249 # Ensure we fail the job if any steps fail.
250 # DO NOT set -u as virtualenv's activate script has unbound variables
253 cd "$WORKSPACE/$TOX_DIR"
255 if [ -n "$TOX_ENVS" ];
257 tox -e "$TOX_ENVS"
262 </hudson.tasks.Shell>
265 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
269 # SPDX-License-Identifier: EPL-1.0
270 ##############################################################################
271 # Copyright (c) 2017 The Linux Foundation and others.
273 # All rights reserved. This program and the accompanying materials
274 # are made available under the terms of the Eclipse Public License v1.0
275 # which accompanies this distribution, and is available at
276 # http://www.eclipse.org/legal/epl-v10.html
277 ##############################################################################
278 echo "---> sysstat.sh"
279 set +e # DON'T fail build if script fails.
281 OS=$(facter operatingsystem)
282 case "$OS" in
284 SYSSTAT_PATH="/var/log/sysstat"
286 # Dont run the script when systat is not enabled by default
287 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
292 SYSSTAT_PATH="/var/log/sa"
300 SAR_DIR="$WORKSPACE/archives/sar-reports"
301 mkdir -p "$SAR_DIR"
302 cp "$SYSSTAT_PATH/"* "$_"
303 # convert sar data to ascii format
304 while IFS="" read -r s
306 [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/sar${s//[!0-9]/}"
307 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
309 # DON'T fail build if script fails.
312 </hudson.tasks.Shell>
313 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
315 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
316 <fileId>jenkins-log-archives-settings</fileId>
318 <variable>SETTINGS_FILE</variable>
319 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
321 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
324 <propertiesContent>SERVER_ID=logs</propertiesContent>
329 # SPDX-License-Identifier: EPL-1.0
330 ##############################################################################
331 # Copyright (c) 2017 The Linux Foundation and others.
333 # All rights reserved. This program and the accompanying materials
334 # are made available under the terms of the Eclipse Public License v1.0
335 # which accompanies this distribution, and is available at
336 # http://www.eclipse.org/legal/epl-v10.html
337 ##############################################################################
338 echo "---> create-netrc.sh"
340 # Ensure we fail the job if any steps fail.
343 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
344 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
345 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
346 -v x:username -o ":" -v x:password \
347 "$SETTINGS_FILE")
349 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
350 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
351 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
353 echo "machine $machine login $user password $pass" > ~/.netrc
355 </hudson.tasks.Shell>
358 # SPDX-License-Identifier: EPL-1.0
359 ##############################################################################
360 # Copyright (c) 2017 The Linux Foundation and others.
362 # All rights reserved. This program and the accompanying materials
363 # are made available under the terms of the Eclipse Public License v1.0
364 # which accompanies this distribution, and is available at
365 # http://www.eclipse.org/legal/epl-v10.html
366 ##############################################################################
367 echo "---> lftools-install.sh"
369 # Ensure we fail the job if any steps fail.
370 # DO NOT set -u as virtualenv's activate script has unbound variables
373 virtualenv --quiet "/tmp/v/lftools"
374 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
375 source "/tmp/v/lftools/bin/activate"
376 pip install --quiet --upgrade pip
377 pip install --quiet --upgrade "lftools<1.0.0"
379 # pipdeptree prints out a lot of information because lftools pulls in many
380 # dependencies. Let's only print it if we want to debug.
381 # echo "----> Pip Dependency Tree"
382 # pip install --quiet --upgrade pipdeptree
386 # SPDX-License-Identifier: EPL-1.0
387 ##############################################################################
388 # Copyright (c) 2017 The Linux Foundation and others.
390 # All rights reserved. This program and the accompanying materials
391 # are made available under the terms of the Eclipse Public License v1.0
392 # which accompanies this distribution, and is available at
393 # http://www.eclipse.org/legal/epl-v10.html
394 ##############################################################################
395 echo "---> logs-deploy.sh"
397 # Ensure we fail the job if any steps fail.
400 set -x # Trace commands for this script to make debugging easier.
402 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
403 LOGS_SERVER="${LOGS_SERVER:-None}"
405 if [ "${LOGS_SERVER}" == 'None' ]
407 set +x # Disable trace since we no longer need it
409 echo "WARNING: Logging server not set"
411 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
412 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
413 BUILD_URL="${BUILD_URL}"
415 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
416 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
418 set +x # Disable trace since we no longer need it.
420 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
423 </hudson.tasks.Shell>
426 # SPDX-License-Identifier: EPL-1.0
427 ##############################################################################
428 # Copyright (c) 2017 The Linux Foundation and others.
430 # All rights reserved. This program and the accompanying materials
431 # are made available under the terms of the Eclipse Public License v1.0
432 # which accompanies this distribution, and is available at
433 # http://www.eclipse.org/legal/epl-v10.html
434 ##############################################################################
436 # Clear log credential files
437 rm "$SETTINGS_FILE"
440 </hudson.tasks.Shell>
441 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
442 <regexp>^Build logs: .*</regexp>
443 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
445 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
446 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
447 <markBuildUnstable>false</markBuildUnstable>
448 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
449 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
451 <hudson.plugins.ws__cleanup.Pattern>
452 <pattern>**/*.jenkins-trigger</pattern>
454 </hudson.plugins.ws__cleanup.Pattern>
456 <deleteDirs>false</deleteDirs>
457 <cleanupMatrixParent>false</cleanupMatrixParent>
459 <cleanWhenSuccess>true</cleanWhenSuccess>
460 <cleanWhenUnstable>true</cleanWhenUnstable>
461 <cleanWhenFailure>true</cleanWhenFailure>
462 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
463 <cleanWhenAborted>true</cleanWhenAborted>
464 <notFailBuild>true</notFailBuild>
465 </hudson.plugins.ws__cleanup.WsCleanup>
468 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
469 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
470 <timeoutMinutes>10</timeoutMinutes>
471 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
472 <failBuild>true</failBuild>
473 <writingDescription>false</writingDescription>
474 <timeoutPercentage>0</timeoutPercentage>
475 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
476 <timeoutType>absolute</timeoutType>
477 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
478 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
479 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
480 <user>test-credential</user>
481 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
482 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>