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>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>
141 <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
142 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
145 <onSuccessful>false</onSuccessful>
146 <onFailed>false</onFailed>
147 <onUnstable>false</onUnstable>
148 <onNotBuilt>false</onNotBuilt>
150 <silentMode>false</silentMode>
151 <silentStartMode>false</silentStartMode>
152 <escapeQuotes>true</escapeQuotes>
153 <noNameAndEmailParameters>false</noNameAndEmailParameters>
154 <readableMessage>false</readableMessage>
155 <dependencyJobsNames/>
157 <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
159 <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
161 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
162 <excludeDrafts>false</excludeDrafts>
163 <excludeTrivialRebase>false</excludeTrivialRebase>
164 <excludeNoCodeChange>false</excludeNoCodeChange>
165 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
166 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginDraftPublishedEvent/>
167 <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
168 <commentAddedCommentContains>recheck$</commentAddedCommentContains>
169 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
172 <buildFailureMessage/>
173 <buildSuccessfulMessage/>
174 <buildUnstableMessage/>
175 <buildNotBuiltMessage/>
176 <buildUnsuccessfulFilepath/>
178 <serverName>test-server</serverName>
179 </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
182 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
184 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
185 <fileId>jjbini</fileId>
186 <targetLocation>$HOME/.config/jenkins_jobs/jenkins_jobs.ini</targetLocation>
188 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
190 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
193 # SPDX-License-Identifier: EPL-1.0
194 ##############################################################################
195 # Copyright (c) 2017 The Linux Foundation and others.
197 # All rights reserved. This program and the accompanying materials
198 # are made available under the terms of the Eclipse Public License v1.0
199 # which accompanies this distribution, and is available at
200 # http://www.eclipse.org/legal/epl-v10.html
201 ##############################################################################
203 # This script will make sure that there are no JIRA URLs in the commit
204 # message. JIRA URLs will break the its-jira plugin
206 # Ensure we fail the job if any steps fail.
207 # Do not treat undefined variables as errors as in this case we are allowed
208 # to have JIRA_URL undefined
212 if [ -n "${JIRA_URL}" ];
214 BASE_URL=$(echo $JIRA_URL | awk -F'/' '{print $3}')
215 JIRA_LINK=$(git rev-list --format=%B --max-count=1 HEAD | grep -io "http[s]*://$BASE_URL/" || true)
216 if [[ ! -z "$JIRA_LINK" ]]
218 echo 'Remove JIRA URLs from commit message'
219 echo 'Add jira references as: Issue: <JIRAKEY>-<ISSUE#>, instead of URLs'
225 # SPDX-License-Identifier: EPL-1.0
226 ##############################################################################
227 # Copyright (c) 2017 The Linux Foundation and others.
229 # All rights reserved. This program and the accompanying materials
230 # are made available under the terms of the Eclipse Public License v1.0
231 # which accompanies this distribution, and is available at
232 # http://www.eclipse.org/legal/epl-v10.html
233 ##############################################################################
234 echo "---> jjb-install.sh"
236 # Ensure we fail the job if any steps fail.
237 # DO NOT set -u as virtualenv's activate script has unbound variables
240 virtualenv "/tmp/v/jjb"
241 # shellcheck source=/tmp/v/jjb/bin/activate disable=SC1091
242 source "/tmp/v/jjb/bin/activate"
243 pip install --quiet --upgrade pip
244 pip install --quiet --upgrade pipdeptree
245 pip install --quiet --upgrade "jenkins-job-builder==$JJB_VERSION"
247 echo "----> Pip Dependency Tree"
251 # SPDX-License-Identifier: EPL-1.0
252 ##############################################################################
253 # Copyright (c) 2017 The Linux Foundation and others.
255 # All rights reserved. This program and the accompanying materials
256 # are made available under the terms of the Eclipse Public License v1.0
257 # which accompanies this distribution, and is available at
258 # http://www.eclipse.org/legal/epl-v10.html
259 ##############################################################################
260 echo "---> jjb-verify-job.sh"
262 # Ensure we fail the job if any steps fail.
265 jenkins-jobs -l DEBUG test --recursive -o archives/job-configs --exclude jjb-test jjb
267 # Sort job output into sub-directories. On large Jenkins systems that have
268 # many jobs archiving so many files into the same directory makes NGINX return
269 # the directory list slow.
270 pushd archives/job-configs
273 if [[ $(ls "$letter"* > /dev/null 2>&1) -eq 0 ]]
275 mkdir "$letter"
276 find . -maxdepth 1 -type f -name "$letter*" -exec mv {} "$letter" \;
282 # SPDX-License-Identifier: EPL-1.0
283 ##############################################################################
284 # Copyright (c) 2015 The Linux Foundation and others.
286 # All rights reserved. This program and the accompanying materials
287 # are made available under the terms of the Eclipse Public License v1.0
288 # which accompanies this distribution, and is available at
289 # http://www.eclipse.org/legal/epl-v10.html
290 ##############################################################################
291 echo "---> jjb-check-unicode.sh"
293 if LC_ALL=C grep -r '[^[:print:][:space:]]' jjb/; then
294 echo "Found files containing non-ascii characters."
298 echo "All files are ASCII only"
300 </hudson.tasks.Shell>
303 # SPDX-License-Identifier: EPL-1.0
304 ##############################################################################
305 # Copyright (c) 2016 The Linux Foundation and others.
307 # All rights reserved. This program and the accompanying materials
308 # are made available under the terms of the Eclipse Public License v1.0
309 # which accompanies this distribution, and is available at
310 # http://www.eclipse.org/legal/epl-v10.html
311 ##############################################################################
312 echo "---> gpg-verify-git-signature.sh"
314 if git log --show-signature -1 | grep -E -q 'gpg: Signature made.*key ID'; then
315 echo "Git commit is GPG signed."
317 echo "WARNING: GPG signature missing for the commit."
320 # Do NOT fail the job for unsigned commits
323 </hudson.tasks.Shell>
326 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
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 "---> sysstat.sh"
340 set +e # DON'T fail build if script fails.
342 OS=$(facter operatingsystem)
343 case "$OS" in
345 SYSSTAT_PATH="/var/log/sysstat"
347 # Dont run the script when systat is not enabled by default
348 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
353 SYSSTAT_PATH="/var/log/sa"
361 SAR_DIR="$WORKSPACE/archives/sar-reports"
362 mkdir -p "$SAR_DIR"
363 cp "$SYSSTAT_PATH/"* "$_"
364 # convert sar data to ascii format
365 while IFS="" read -r s
367 [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/sar${s//[!0-9]/}"
368 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
370 # DON'T fail build if script fails.
373 </hudson.tasks.Shell>
374 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
376 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
377 <fileId>jenkins-log-archives-settings</fileId>
379 <variable>SETTINGS_FILE</variable>
380 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
382 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
385 <propertiesContent>SERVER_ID=logs</propertiesContent>
390 # SPDX-License-Identifier: EPL-1.0
391 ##############################################################################
392 # Copyright (c) 2017 The Linux Foundation and others.
394 # All rights reserved. This program and the accompanying materials
395 # are made available under the terms of the Eclipse Public License v1.0
396 # which accompanies this distribution, and is available at
397 # http://www.eclipse.org/legal/epl-v10.html
398 ##############################################################################
399 echo "---> create-netrc.sh"
401 # Ensure we fail the job if any steps fail.
404 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
405 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
406 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
407 -v x:username -o ":" -v x:password \
408 "$SETTINGS_FILE")
410 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
411 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
412 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
414 echo "machine $machine login $user password $pass" > ~/.netrc
416 </hudson.tasks.Shell>
419 # SPDX-License-Identifier: EPL-1.0
420 ##############################################################################
421 # Copyright (c) 2017 The Linux Foundation and others.
423 # All rights reserved. This program and the accompanying materials
424 # are made available under the terms of the Eclipse Public License v1.0
425 # which accompanies this distribution, and is available at
426 # http://www.eclipse.org/legal/epl-v10.html
427 ##############################################################################
428 echo "---> lftools-install.sh"
430 # Ensure we fail the job if any steps fail.
431 # DO NOT set -u as virtualenv's activate script has unbound variables
434 virtualenv --quiet "/tmp/v/lftools"
435 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
436 source "/tmp/v/lftools/bin/activate"
437 pip install --quiet --upgrade pip
438 pip install --quiet --upgrade "lftools<1.0.0"
440 # pipdeptree prints out a lot of information because lftools pulls in many
441 # dependencies. Let's only print it if we want to debug.
442 # echo "----> Pip Dependency Tree"
443 # pip install --quiet --upgrade pipdeptree
447 # SPDX-License-Identifier: EPL-1.0
448 ##############################################################################
449 # Copyright (c) 2017 The Linux Foundation and others.
451 # All rights reserved. This program and the accompanying materials
452 # are made available under the terms of the Eclipse Public License v1.0
453 # which accompanies this distribution, and is available at
454 # http://www.eclipse.org/legal/epl-v10.html
455 ##############################################################################
456 echo "---> logs-deploy.sh"
458 # Ensure we fail the job if any steps fail.
461 set -x # Trace commands for this script to make debugging easier.
463 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
464 LOGS_SERVER="${LOGS_SERVER:-None}"
466 if [ "${LOGS_SERVER}" == 'None' ]
468 set +x # Disable trace since we no longer need it
470 echo "WARNING: Logging server not set"
472 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
473 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
474 BUILD_URL="${BUILD_URL}"
476 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
477 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
479 set +x # Disable trace since we no longer need it.
481 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
484 </hudson.tasks.Shell>
487 # SPDX-License-Identifier: EPL-1.0
488 ##############################################################################
489 # Copyright (c) 2017 The Linux Foundation and others.
491 # All rights reserved. This program and the accompanying materials
492 # are made available under the terms of the Eclipse Public License v1.0
493 # which accompanies this distribution, and is available at
494 # http://www.eclipse.org/legal/epl-v10.html
495 ##############################################################################
497 # Clear log credential files
498 rm "$SETTINGS_FILE"
501 </hudson.tasks.Shell>
502 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
503 <regexp>^Build logs: .*</regexp>
504 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
506 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
507 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
508 <markBuildUnstable>false</markBuildUnstable>
509 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
510 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
512 <hudson.plugins.ws__cleanup.Pattern>
513 <pattern>**/*.jenkins-trigger</pattern>
515 </hudson.plugins.ws__cleanup.Pattern>
517 <deleteDirs>false</deleteDirs>
518 <cleanupMatrixParent>false</cleanupMatrixParent>
520 <cleanWhenSuccess>true</cleanWhenSuccess>
521 <cleanWhenUnstable>true</cleanWhenUnstable>
522 <cleanWhenFailure>true</cleanWhenFailure>
523 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
524 <cleanWhenAborted>true</cleanWhenAborted>
525 <notFailBuild>true</notFailBuild>
526 </hudson.plugins.ws__cleanup.WsCleanup>
529 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
530 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
531 <timeoutMinutes>10</timeoutMinutes>
532 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
533 <failBuild>true</failBuild>
534 <writingDescription>false</writingDescription>
535 <timeoutPercentage>0</timeoutPercentage>
536 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
537 <timeoutType>absolute</timeoutType>
538 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
539 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
540 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
541 <user>test-credential</user>
542 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
543 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>