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.
66 </hudson.model.StringParameterDefinition>
67 <hudson.model.StringParameterDefinition>
68 <name>JJB_VERSION</name>
69 <description>Jenkins Job Builder version to download and install.</description>
70 <defaultValue>1.6.2</defaultValue>
71 </hudson.model.StringParameterDefinition>
72 </parameterDefinitions>
73 </hudson.model.ParametersDefinitionProperty>
75 <scm class="hudson.plugins.git.GitSCM">
76 <configVersion>2</configVersion>
78 <hudson.plugins.git.UserRemoteConfig>
81 <url>$GIT_URL/$GERRIT_PROJECT</url>
82 <credentialsId>test-credential</credentialsId>
83 </hudson.plugins.git.UserRemoteConfig>
86 <hudson.plugins.git.BranchSpec>
87 <name>refs/heads/master</name>
88 </hudson.plugins.git.BranchSpec>
91 <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
92 <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
93 <authorOrCommitter>false</authorOrCommitter>
94 <wipeOutWorkspace>true</wipeOutWorkspace>
95 <pruneBranches>false</pruneBranches>
96 <remotePoll>false</remotePoll>
97 <gitTool>Default</gitTool>
98 <submoduleCfg class="list"/>
103 <skipTag>true</skipTag>
105 <useShallowClone>false</useShallowClone>
106 <ignoreNotifyCommit>false</ignoreNotifyCommit>
108 <hudson.plugins.git.extensions.impl.SubmoduleOption>
109 <disableSubmodules>false</disableSubmodules>
110 <recursiveSubmodules>true</recursiveSubmodules>
111 <trackingSubmodules>false</trackingSubmodules>
113 <timeout>10</timeout>
114 </hudson.plugins.git.extensions.impl.SubmoduleOption>
115 <hudson.plugins.git.extensions.impl.WipeWorkspace/>
118 <triggers class="vector">
119 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
122 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
123 <compareType>ANT</compareType>
124 <pattern>releng/ciman</pattern>
126 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
127 <compareType>ANT</compareType>
128 <pattern>**/master</pattern>
129 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
132 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
133 <compareType>ANT</compareType>
134 <pattern>**/*.sh</pattern>
135 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
136 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.FilePath>
137 <compareType>ANT</compareType>
138 <pattern>**/*.yaml</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>**/global-jjb</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>remerge$</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>
181 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
183 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
184 <fileId>jjbini</fileId>
185 <targetLocation>$HOME/.config/jenkins_jobs/jenkins_jobs.ini</targetLocation>
187 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
189 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
192 # SPDX-License-Identifier: EPL-1.0
193 ##############################################################################
194 # Copyright (c) 2017 The Linux Foundation and others.
196 # All rights reserved. This program and the accompanying materials
197 # are made available under the terms of the Eclipse Public License v1.0
198 # which accompanies this distribution, and is available at
199 # http://www.eclipse.org/legal/epl-v10.html
200 ##############################################################################
201 echo "---> jjb-install.sh"
203 # Ensure we fail the job if any steps fail.
204 # DO NOT set -u as virtualenv's activate script has unbound variables
207 virtualenv "/tmp/v/jjb"
208 # shellcheck source=/tmp/v/jjb/bin/activate disable=SC1091
209 source "/tmp/v/jjb/bin/activate"
210 pip install --quiet --upgrade pip
211 pip install --quiet --upgrade pipdeptree
212 pip install --quiet --upgrade "jenkins-job-builder==$JJB_VERSION"
214 echo "----> Pip Dependency Tree"
218 # SPDX-License-Identifier: EPL-1.0
219 ##############################################################################
220 # Copyright (c) 2017 The Linux Foundation and others.
222 # All rights reserved. This program and the accompanying materials
223 # are made available under the terms of the Eclipse Public License v1.0
224 # which accompanies this distribution, and is available at
225 # http://www.eclipse.org/legal/epl-v10.html
226 ##############################################################################
227 echo "---> jjb-merge-job.sh"
229 # Ensure we fail the job if any steps fail.
232 jenkins-jobs update --recursive --delete-old --workers 4 --exclude jjb-test jjb
234 </hudson.tasks.Shell>
237 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
241 # SPDX-License-Identifier: EPL-1.0
242 ##############################################################################
243 # Copyright (c) 2017 The Linux Foundation and others.
245 # All rights reserved. This program and the accompanying materials
246 # are made available under the terms of the Eclipse Public License v1.0
247 # which accompanies this distribution, and is available at
248 # http://www.eclipse.org/legal/epl-v10.html
249 ##############################################################################
250 echo "---> sysstat.sh"
251 set +e # DON'T fail build if script fails.
253 OS=$(facter operatingsystem)
254 case "$OS" in
256 SYSSTAT_PATH="/var/log/sysstat"
258 # Dont run the script when systat is not enabled by default
259 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
264 SYSSTAT_PATH="/var/log/sa"
272 SAR_DIR="$WORKSPACE/archives/sar-reports"
273 mkdir -p "$SAR_DIR"
274 cp "$SYSSTAT_PATH/"* "$_"
275 # convert sar data to ascii format
276 while IFS="" read -r s
278 [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/sar${s//[!0-9]/}"
279 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
281 # DON'T fail build if script fails.
284 </hudson.tasks.Shell>
285 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
287 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
288 <fileId>jenkins-log-archives-settings</fileId>
290 <variable>SETTINGS_FILE</variable>
291 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
293 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
296 <propertiesContent>SERVER_ID=logs</propertiesContent>
301 # SPDX-License-Identifier: EPL-1.0
302 ##############################################################################
303 # Copyright (c) 2017 The Linux Foundation and others.
305 # All rights reserved. This program and the accompanying materials
306 # are made available under the terms of the Eclipse Public License v1.0
307 # which accompanies this distribution, and is available at
308 # http://www.eclipse.org/legal/epl-v10.html
309 ##############################################################################
310 echo "---> create-netrc.sh"
312 # Ensure we fail the job if any steps fail.
315 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
316 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
317 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
318 -v x:username -o ":" -v x:password \
319 "$SETTINGS_FILE")
321 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
322 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
323 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
325 echo "machine $machine login $user password $pass" > ~/.netrc
327 </hudson.tasks.Shell>
330 # SPDX-License-Identifier: EPL-1.0
331 ##############################################################################
332 # Copyright (c) 2017 The Linux Foundation and others.
334 # All rights reserved. This program and the accompanying materials
335 # are made available under the terms of the Eclipse Public License v1.0
336 # which accompanies this distribution, and is available at
337 # http://www.eclipse.org/legal/epl-v10.html
338 ##############################################################################
339 echo "---> lftools-install.sh"
341 # Ensure we fail the job if any steps fail.
342 # DO NOT set -u as virtualenv's activate script has unbound variables
345 virtualenv --quiet "/tmp/v/lftools"
346 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
347 source "/tmp/v/lftools/bin/activate"
348 pip install --quiet --upgrade pip
349 pip install --quiet --upgrade "lftools<1.0.0"
351 # pipdeptree prints out a lot of information because lftools pulls in many
352 # dependencies. Let's only print it if we want to debug.
353 # echo "----> Pip Dependency Tree"
354 # pip install --quiet --upgrade pipdeptree
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 "---> logs-deploy.sh"
369 # Ensure we fail the job if any steps fail.
372 set -x # Trace commands for this script to make debugging easier.
374 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
375 LOGS_SERVER="${LOGS_SERVER:-None}"
377 if [ "${LOGS_SERVER}" == 'None' ]
379 set +x # Disable trace since we no longer need it
381 echo "WARNING: Logging server not set"
383 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
384 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
385 BUILD_URL="${BUILD_URL}"
387 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
388 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
390 set +x # Disable trace since we no longer need it.
392 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
395 </hudson.tasks.Shell>
398 # SPDX-License-Identifier: EPL-1.0
399 ##############################################################################
400 # Copyright (c) 2017 The Linux Foundation and others.
402 # All rights reserved. This program and the accompanying materials
403 # are made available under the terms of the Eclipse Public License v1.0
404 # which accompanies this distribution, and is available at
405 # http://www.eclipse.org/legal/epl-v10.html
406 ##############################################################################
408 # Clear log credential files
409 rm "$SETTINGS_FILE"
412 </hudson.tasks.Shell>
413 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
414 <regexp>^Build logs: .*</regexp>
415 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
417 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
418 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
419 <markBuildUnstable>false</markBuildUnstable>
420 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
421 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
423 <hudson.plugins.ws__cleanup.Pattern>
424 <pattern>**/*.jenkins-trigger</pattern>
426 </hudson.plugins.ws__cleanup.Pattern>
428 <deleteDirs>false</deleteDirs>
429 <cleanupMatrixParent>false</cleanupMatrixParent>
431 <cleanWhenSuccess>true</cleanWhenSuccess>
432 <cleanWhenUnstable>true</cleanWhenUnstable>
433 <cleanWhenFailure>true</cleanWhenFailure>
434 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
435 <cleanWhenAborted>true</cleanWhenAborted>
436 <notFailBuild>true</notFailBuild>
437 </hudson.plugins.ws__cleanup.WsCleanup>
440 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
441 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
442 <timeoutMinutes>10</timeoutMinutes>
443 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
444 <failBuild>true</failBuild>
445 <writingDescription>false</writingDescription>
446 <timeoutPercentage>0</timeoutPercentage>
447 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
448 <timeoutType>absolute</timeoutType>
449 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
450 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
451 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
452 <user>test-credential</user>
453 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
454 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>