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 <com.coravy.hudson.plugins.github.GithubProjectProperty>
13 <projectUrl>https://github.com/example-org/releng/ciman</projectUrl>
14 </com.coravy.hudson.plugins.github.GithubProjectProperty>
15 <hudson.model.ParametersDefinitionProperty>
16 <parameterDefinitions>
17 <hudson.model.StringParameterDefinition>
19 <description>Parameter to identify a Gerrit project. This is typically the
20 project repo path as exists in Gerrit.
21 For example: ofextensions/circuitsw
23 <defaultValue>releng/ciman</defaultValue>
24 </hudson.model.StringParameterDefinition>
25 <hudson.model.StringParameterDefinition>
27 <description>Stream is often set to the same name as 'branch' but can
28 sometimes be used as a name representing a project's release code
31 <defaultValue>master</defaultValue>
32 </hudson.model.StringParameterDefinition>
33 <hudson.model.StringParameterDefinition>
34 <name>GERRIT_PROJECT</name>
35 <description>Parameter to identify Gerrit project. This is typically the
36 project repo path as exists in Gerrit.
37 For example: ofextensions/circuitsw
39 Note that Gerrit will override this parameter automatically if a
40 job is triggered by Gerrit.
42 <defaultValue>releng/ciman</defaultValue>
43 </hudson.model.StringParameterDefinition>
44 <hudson.model.StringParameterDefinition>
45 <name>GERRIT_BRANCH</name>
46 <description>Parameter to identify a Gerrit branch.
48 Note that Gerrit will override this parameter automatically if a
49 job is triggered by Gerrit.
51 <defaultValue>master</defaultValue>
52 </hudson.model.StringParameterDefinition>
53 <hudson.model.StringParameterDefinition>
54 <name>GERRIT_REFSPEC</name>
55 <description>Parameter to identify a refspec when pulling from Gerrit.
57 Note that Gerrit will override this parameter automatically if a
58 job is triggered by Gerrit.
60 <defaultValue>refs/heads/master</defaultValue>
61 </hudson.model.StringParameterDefinition>
62 <hudson.model.StringParameterDefinition>
63 <name>JJB_VERSION</name>
64 <description>Jenkins Job Builder version to download and install.</description>
65 <defaultValue>1.6.2</defaultValue>
66 </hudson.model.StringParameterDefinition>
67 </parameterDefinitions>
68 </hudson.model.ParametersDefinitionProperty>
70 <scm class="hudson.plugins.git.GitSCM">
71 <configVersion>2</configVersion>
73 <hudson.plugins.git.UserRemoteConfig>
76 <url>git@github.com:example-org/releng/ciman</url>
77 <credentialsId>test-credential</credentialsId>
78 </hudson.plugins.git.UserRemoteConfig>
81 <hudson.plugins.git.BranchSpec>
83 </hudson.plugins.git.BranchSpec>
86 <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
87 <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
88 <authorOrCommitter>false</authorOrCommitter>
89 <wipeOutWorkspace>true</wipeOutWorkspace>
90 <pruneBranches>false</pruneBranches>
91 <remotePoll>false</remotePoll>
92 <gitTool>Default</gitTool>
93 <submoduleCfg class="list"/>
98 <skipTag>true</skipTag>
100 <useShallowClone>false</useShallowClone>
101 <ignoreNotifyCommit>false</ignoreNotifyCommit>
103 <hudson.plugins.git.extensions.impl.SubmoduleOption>
104 <disableSubmodules>false</disableSubmodules>
105 <recursiveSubmodules>true</recursiveSubmodules>
106 <trackingSubmodules>false</trackingSubmodules>
108 <timeout>10</timeout>
109 </hudson.plugins.git.extensions.impl.SubmoduleOption>
110 <hudson.plugins.git.extensions.impl.WipeWorkspace/>
113 <triggers class="vector">
114 <com.cloudbees.jenkins.GitHubPushTrigger>
116 </com.cloudbees.jenkins.GitHubPushTrigger>
117 <hudson.triggers.SCMTrigger>
119 <ignorePostCommitHooks>false</ignorePostCommitHooks>
120 </hudson.triggers.SCMTrigger>
121 <org.jenkinsci.plugins.ghprb.GhprbTrigger>
123 <adminlist>tykeal</adminlist>
124 <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
128 <orgslist>example-org</orgslist>
130 <triggerPhrase>^remerge$</triggerPhrase>
131 <onlyTriggerPhrase>true</onlyTriggerPhrase>
132 <useGitHubHooks>true</useGitHubHooks>
133 <permitAll>false</permitAll>
134 <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
136 <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
137 <commitStatusContext>JJB Merge</commitStatusContext>
138 </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
140 </org.jenkinsci.plugins.ghprb.GhprbTrigger>
143 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
145 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
146 <fileId>jjbini</fileId>
147 <targetLocation>$HOME/.config/jenkins_jobs/jenkins_jobs.ini</targetLocation>
149 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
151 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
154 # SPDX-License-Identifier: EPL-1.0
155 ##############################################################################
156 # Copyright (c) 2017 The Linux Foundation and others.
158 # All rights reserved. This program and the accompanying materials
159 # are made available under the terms of the Eclipse Public License v1.0
160 # which accompanies this distribution, and is available at
161 # http://www.eclipse.org/legal/epl-v10.html
162 ##############################################################################
163 echo "---> jjb-install.sh"
165 # Ensure we fail the job if any steps fail.
166 # DO NOT set -u as virtualenv's activate script has unbound variables
169 virtualenv "/tmp/v/jjb"
170 # shellcheck source=/tmp/v/jjb/bin/activate disable=SC1091
171 source "/tmp/v/jjb/bin/activate"
172 pip install --quiet --upgrade pip
173 pip install --quiet --upgrade pipdeptree
174 pip install --quiet --upgrade "jenkins-job-builder==$JJB_VERSION"
176 echo "----> Pip Dependency Tree"
180 # SPDX-License-Identifier: EPL-1.0
181 ##############################################################################
182 # Copyright (c) 2017 The Linux Foundation and others.
184 # All rights reserved. This program and the accompanying materials
185 # are made available under the terms of the Eclipse Public License v1.0
186 # which accompanies this distribution, and is available at
187 # http://www.eclipse.org/legal/epl-v10.html
188 ##############################################################################
189 echo "---> jjb-merge-job.sh"
191 # Ensure we fail the job if any steps fail.
194 jenkins-jobs update --recursive --delete-old --workers 4 --exclude jjb-test jjb
196 </hudson.tasks.Shell>
199 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
203 # SPDX-License-Identifier: EPL-1.0
204 ##############################################################################
205 # Copyright (c) 2017 The Linux Foundation and others.
207 # All rights reserved. This program and the accompanying materials
208 # are made available under the terms of the Eclipse Public License v1.0
209 # which accompanies this distribution, and is available at
210 # http://www.eclipse.org/legal/epl-v10.html
211 ##############################################################################
212 echo "---> sysstat.sh"
213 set +e # DON'T fail build if script fails.
215 OS=$(facter operatingsystem)
216 case "$OS" in
218 SYSSTAT_PATH="/var/log/sysstat"
220 # Dont run the script when systat is not enabled by default
221 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
226 SYSSTAT_PATH="/var/log/sa"
234 SAR_DIR="$WORKSPACE/archives/sar-reports"
235 mkdir -p "$SAR_DIR"
236 cp "$SYSSTAT_PATH/"* "$_"
237 # convert sar data to ascii format
238 while IFS="" read -r s
240 [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/sar${s//[!0-9]/}"
241 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
243 # DON'T fail build if script fails.
246 </hudson.tasks.Shell>
247 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
249 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
250 <fileId>jenkins-log-archives-settings</fileId>
252 <variable>SETTINGS_FILE</variable>
253 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
255 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
258 <propertiesContent>SERVER_ID=logs</propertiesContent>
263 # SPDX-License-Identifier: EPL-1.0
264 ##############################################################################
265 # Copyright (c) 2017 The Linux Foundation and others.
267 # All rights reserved. This program and the accompanying materials
268 # are made available under the terms of the Eclipse Public License v1.0
269 # which accompanies this distribution, and is available at
270 # http://www.eclipse.org/legal/epl-v10.html
271 ##############################################################################
272 echo "---> create-netrc.sh"
274 # Ensure we fail the job if any steps fail.
277 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
278 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
279 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
280 -v x:username -o ":" -v x:password \
281 "$SETTINGS_FILE")
283 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
284 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
285 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
287 echo "machine $machine login $user password $pass" > ~/.netrc
289 </hudson.tasks.Shell>
292 # SPDX-License-Identifier: EPL-1.0
293 ##############################################################################
294 # Copyright (c) 2017 The Linux Foundation and others.
296 # All rights reserved. This program and the accompanying materials
297 # are made available under the terms of the Eclipse Public License v1.0
298 # which accompanies this distribution, and is available at
299 # http://www.eclipse.org/legal/epl-v10.html
300 ##############################################################################
301 echo "---> lftools-install.sh"
303 # Ensure we fail the job if any steps fail.
304 # DO NOT set -u as virtualenv's activate script has unbound variables
307 virtualenv --quiet "/tmp/v/lftools"
308 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
309 source "/tmp/v/lftools/bin/activate"
310 pip install --quiet --upgrade pip
311 pip install --quiet --upgrade "lftools<1.0.0"
313 # pipdeptree prints out a lot of information because lftools pulls in many
314 # dependencies. Let's only print it if we want to debug.
315 # echo "----> Pip Dependency Tree"
316 # pip install --quiet --upgrade pipdeptree
320 # SPDX-License-Identifier: EPL-1.0
321 ##############################################################################
322 # Copyright (c) 2017 The Linux Foundation and others.
324 # All rights reserved. This program and the accompanying materials
325 # are made available under the terms of the Eclipse Public License v1.0
326 # which accompanies this distribution, and is available at
327 # http://www.eclipse.org/legal/epl-v10.html
328 ##############################################################################
329 echo "---> logs-deploy.sh"
331 # Ensure we fail the job if any steps fail.
334 set -x # Trace commands for this script to make debugging easier.
336 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
337 LOGS_SERVER="${LOGS_SERVER:-None}"
339 if [ "${LOGS_SERVER}" == 'None' ]
341 set +x # Disable trace since we no longer need it
343 echo "WARNING: Logging server not set"
345 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
346 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
347 BUILD_URL="${BUILD_URL}"
349 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
350 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
352 set +x # Disable trace since we no longer need it.
354 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
357 </hudson.tasks.Shell>
360 # SPDX-License-Identifier: EPL-1.0
361 ##############################################################################
362 # Copyright (c) 2017 The Linux Foundation and others.
364 # All rights reserved. This program and the accompanying materials
365 # are made available under the terms of the Eclipse Public License v1.0
366 # which accompanies this distribution, and is available at
367 # http://www.eclipse.org/legal/epl-v10.html
368 ##############################################################################
370 # Clear log credential files
371 rm "$SETTINGS_FILE"
374 </hudson.tasks.Shell>
375 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
376 <regexp>^Build logs: .*</regexp>
377 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
379 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
380 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
381 <markBuildUnstable>false</markBuildUnstable>
382 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
383 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
385 <hudson.plugins.ws__cleanup.Pattern>
386 <pattern>**/*.jenkins-trigger</pattern>
388 </hudson.plugins.ws__cleanup.Pattern>
390 <deleteDirs>false</deleteDirs>
391 <cleanupMatrixParent>false</cleanupMatrixParent>
393 <cleanWhenSuccess>true</cleanWhenSuccess>
394 <cleanWhenUnstable>true</cleanWhenUnstable>
395 <cleanWhenFailure>true</cleanWhenFailure>
396 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
397 <cleanWhenAborted>true</cleanWhenAborted>
398 <notFailBuild>true</notFailBuild>
399 </hudson.plugins.ws__cleanup.WsCleanup>
402 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
403 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
404 <timeoutMinutes>10</timeoutMinutes>
405 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
406 <failBuild>true</failBuild>
407 <writingDescription>false</writingDescription>
408 <timeoutPercentage>0</timeoutPercentage>
409 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
410 <timeoutType>absolute</timeoutType>
411 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
412 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
413 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
414 <user>test-credential</user>
415 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
416 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>