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>
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>
80 <refspec>$GERRIT_REFSPEC</refspec>
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/$GERRIT_BRANCH</name>
88 </hudson.plugins.git.BranchSpec>
91 <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
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.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>
186 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
188 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
189 <fileId>jjbini</fileId>
190 <targetLocation>$HOME/.config/jenkins_jobs/jenkins_jobs.ini</targetLocation>
192 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
194 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
197 # SPDX-License-Identifier: EPL-1.0
198 ##############################################################################
199 # Copyright (c) 2017 The Linux Foundation and others.
201 # All rights reserved. This program and the accompanying materials
202 # are made available under the terms of the Eclipse Public License v1.0
203 # which accompanies this distribution, and is available at
204 # http://www.eclipse.org/legal/epl-v10.html
205 ##############################################################################
207 # This script will make sure that there are no JIRA URLs in the commit
208 # message. JIRA URLs will break the its-jira plugin
210 # Ensure we fail the job if any steps fail.
211 # Do not treat undefined variables as errors as in this case we are allowed
212 # to have JIRA_URL undefined
216 if [ -n "${JIRA_URL}" ];
218 BASE_URL=$(echo $JIRA_URL | awk -F'/' '{print $3}')
219 JIRA_LINK=$(git rev-list --format=%B --max-count=1 HEAD | grep -io "http[s]*://$BASE_URL/" || true)
220 if [[ ! -z "$JIRA_LINK" ]]
222 echo 'Remove JIRA URLs from commit message'
223 echo 'Add jira references as: Issue: <JIRAKEY>-<ISSUE#>, instead of URLs'
229 # SPDX-License-Identifier: EPL-1.0
230 ##############################################################################
231 # Copyright (c) 2017 The Linux Foundation and others.
233 # All rights reserved. This program and the accompanying materials
234 # are made available under the terms of the Eclipse Public License v1.0
235 # which accompanies this distribution, and is available at
236 # http://www.eclipse.org/legal/epl-v10.html
237 ##############################################################################
238 echo "---> jjb-install.sh"
240 # Ensure we fail the job if any steps fail.
241 # DO NOT set -u as virtualenv's activate script has unbound variables
244 virtualenv "/tmp/v/jjb"
245 # shellcheck source=/tmp/v/jjb/bin/activate disable=SC1091
246 source "/tmp/v/jjb/bin/activate"
247 pip install --quiet --upgrade pip
248 pip install --quiet --upgrade pipdeptree
249 pip install --quiet --upgrade "jenkins-job-builder==$JJB_VERSION"
251 echo "----> Pip Dependency Tree"
255 # SPDX-License-Identifier: EPL-1.0
256 ##############################################################################
257 # Copyright (c) 2017 The Linux Foundation and others.
259 # All rights reserved. This program and the accompanying materials
260 # are made available under the terms of the Eclipse Public License v1.0
261 # which accompanies this distribution, and is available at
262 # http://www.eclipse.org/legal/epl-v10.html
263 ##############################################################################
264 echo "---> jjb-verify-job.sh"
266 # Ensure we fail the job if any steps fail.
269 jenkins-jobs -l DEBUG test --recursive -o archives/job-configs --exclude jjb-test jjb
271 # Sort job output into sub-directories. On large Jenkins systems that have
272 # many jobs archiving so many files into the same directory makes NGINX return
273 # the directory list slow.
274 pushd archives/job-configs
277 if [[ $(ls "$letter"* > /dev/null 2>&1) -eq 0 ]]
279 mkdir "$letter"
280 find . -maxdepth 1 -type f -name "$letter*" -exec mv {} "$letter" \;
286 # SPDX-License-Identifier: EPL-1.0
287 ##############################################################################
288 # Copyright (c) 2015 The Linux Foundation and others.
290 # All rights reserved. This program and the accompanying materials
291 # are made available under the terms of the Eclipse Public License v1.0
292 # which accompanies this distribution, and is available at
293 # http://www.eclipse.org/legal/epl-v10.html
294 ##############################################################################
295 echo "---> jjb-check-unicode.sh"
297 if LC_ALL=C grep -r '[^[:print:][:space:]]' jjb/; then
298 echo "Found files containing non-ascii characters."
302 echo "All files are ASCII only"
304 </hudson.tasks.Shell>
307 # SPDX-License-Identifier: EPL-1.0
308 ##############################################################################
309 # Copyright (c) 2016 The Linux Foundation and others.
311 # All rights reserved. This program and the accompanying materials
312 # are made available under the terms of the Eclipse Public License v1.0
313 # which accompanies this distribution, and is available at
314 # http://www.eclipse.org/legal/epl-v10.html
315 ##############################################################################
316 echo "---> gpg-verify-git-signature.sh"
318 if git log --show-signature -1 | grep -E -q 'gpg: Signature made.*key ID'; then
319 echo "Git commit is GPG signed."
321 echo "WARNING: GPG signature missing for the commit."
324 # Do NOT fail the job for unsigned commits
327 </hudson.tasks.Shell>
330 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
334 # SPDX-License-Identifier: EPL-1.0
335 ##############################################################################
336 # Copyright (c) 2017 The Linux Foundation and others.
338 # All rights reserved. This program and the accompanying materials
339 # are made available under the terms of the Eclipse Public License v1.0
340 # which accompanies this distribution, and is available at
341 # http://www.eclipse.org/legal/epl-v10.html
342 ##############################################################################
343 echo "---> sysstat.sh"
344 set +e # DON'T fail build if script fails.
346 OS=$(facter operatingsystem)
347 case "$OS" in
349 SYSSTAT_PATH="/var/log/sysstat"
351 # Dont run the script when systat is not enabled by default
352 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
357 SYSSTAT_PATH="/var/log/sa"
365 SAR_DIR="$WORKSPACE/archives/sar-reports"
366 mkdir -p "$SAR_DIR"
367 cp "$SYSSTAT_PATH/"* "$_"
368 # convert sar data to ascii format
369 while IFS="" read -r s
371 [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/sar${s//[!0-9]/}"
372 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
374 # DON'T fail build if script fails.
377 </hudson.tasks.Shell>
378 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
380 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
381 <fileId>jenkins-log-archives-settings</fileId>
383 <variable>SETTINGS_FILE</variable>
384 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
386 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
389 <propertiesContent>SERVER_ID=logs</propertiesContent>
394 # SPDX-License-Identifier: EPL-1.0
395 ##############################################################################
396 # Copyright (c) 2017 The Linux Foundation and others.
398 # All rights reserved. This program and the accompanying materials
399 # are made available under the terms of the Eclipse Public License v1.0
400 # which accompanies this distribution, and is available at
401 # http://www.eclipse.org/legal/epl-v10.html
402 ##############################################################################
403 echo "---> create-netrc.sh"
405 # Ensure we fail the job if any steps fail.
408 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
409 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
410 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
411 -v x:username -o ":" -v x:password \
412 "$SETTINGS_FILE")
414 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
415 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
416 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
418 echo "machine $machine login $user password $pass" > ~/.netrc
420 </hudson.tasks.Shell>
423 # SPDX-License-Identifier: EPL-1.0
424 ##############################################################################
425 # Copyright (c) 2017 The Linux Foundation and others.
427 # All rights reserved. This program and the accompanying materials
428 # are made available under the terms of the Eclipse Public License v1.0
429 # which accompanies this distribution, and is available at
430 # http://www.eclipse.org/legal/epl-v10.html
431 ##############################################################################
432 echo "---> lftools-install.sh"
434 # Ensure we fail the job if any steps fail.
435 # DO NOT set -u as virtualenv's activate script has unbound variables
438 virtualenv --quiet "/tmp/v/lftools"
439 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
440 source "/tmp/v/lftools/bin/activate"
441 pip install --quiet --upgrade pip
442 pip install --quiet --upgrade "lftools<1.0.0"
444 # pipdeptree prints out a lot of information because lftools pulls in many
445 # dependencies. Let's only print it if we want to debug.
446 # echo "----> Pip Dependency Tree"
447 # pip install --quiet --upgrade pipdeptree
451 # SPDX-License-Identifier: EPL-1.0
452 ##############################################################################
453 # Copyright (c) 2017 The Linux Foundation and others.
455 # All rights reserved. This program and the accompanying materials
456 # are made available under the terms of the Eclipse Public License v1.0
457 # which accompanies this distribution, and is available at
458 # http://www.eclipse.org/legal/epl-v10.html
459 ##############################################################################
460 echo "---> logs-deploy.sh"
462 # Ensure we fail the job if any steps fail.
465 set -x # Trace commands for this script to make debugging easier.
467 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
468 LOGS_SERVER="${LOGS_SERVER:-None}"
470 if [ "${LOGS_SERVER}" == 'None' ]
472 set +x # Disable trace since we no longer need it
474 echo "WARNING: Logging server not set"
476 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
477 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
478 BUILD_URL="${BUILD_URL}"
480 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
481 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
483 set +x # Disable trace since we no longer need it.
485 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
488 </hudson.tasks.Shell>
491 # SPDX-License-Identifier: EPL-1.0
492 ##############################################################################
493 # Copyright (c) 2017 The Linux Foundation and others.
495 # All rights reserved. This program and the accompanying materials
496 # are made available under the terms of the Eclipse Public License v1.0
497 # which accompanies this distribution, and is available at
498 # http://www.eclipse.org/legal/epl-v10.html
499 ##############################################################################
501 # Clear log credential files
502 rm "$SETTINGS_FILE"
505 </hudson.tasks.Shell>
506 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
507 <regexp>^Build logs: .*</regexp>
508 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
510 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
511 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
512 <markBuildUnstable>false</markBuildUnstable>
513 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
514 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
516 <hudson.plugins.ws__cleanup.Pattern>
517 <pattern>**/*.jenkins-trigger</pattern>
519 </hudson.plugins.ws__cleanup.Pattern>
521 <deleteDirs>false</deleteDirs>
522 <cleanupMatrixParent>false</cleanupMatrixParent>
524 <cleanWhenSuccess>true</cleanWhenSuccess>
525 <cleanWhenUnstable>true</cleanWhenUnstable>
526 <cleanWhenFailure>true</cleanWhenFailure>
527 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
528 <cleanWhenAborted>true</cleanWhenAborted>
529 <notFailBuild>true</notFailBuild>
530 </hudson.plugins.ws__cleanup.WsCleanup>
533 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
534 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
535 <timeoutMinutes>10</timeoutMinutes>
536 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
537 <failBuild>true</failBuild>
538 <writingDescription>false</writingDescription>
539 <timeoutPercentage>0</timeoutPercentage>
540 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
541 <timeoutType>absolute</timeoutType>
542 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
543 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
544 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
545 <user>test-credential</user>
546 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
547 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>