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 <com.coravy.hudson.plugins.github.GithubProjectProperty>
13 <projectUrl>$GIT_URL/$GERRIT_PROJECT/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.
61 </hudson.model.StringParameterDefinition>
62 <hudson.model.StringParameterDefinition>
64 <description>Path to directory containing tox.ini file.
67 </hudson.model.StringParameterDefinition>
68 <hudson.model.StringParameterDefinition>
70 <description>Tox environments to run build against.
74 </hudson.model.StringParameterDefinition>
75 </parameterDefinitions>
76 </hudson.model.ParametersDefinitionProperty>
78 <scm class="hudson.plugins.git.GitSCM">
79 <configVersion>2</configVersion>
81 <hudson.plugins.git.UserRemoteConfig>
83 <refspec>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
84 <url>git@github.com:example-org/releng/ciman</url>
85 <credentialsId>test-credential</credentialsId>
86 </hudson.plugins.git.UserRemoteConfig>
89 <hudson.plugins.git.BranchSpec>
91 </hudson.plugins.git.BranchSpec>
94 <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
95 <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
96 <authorOrCommitter>false</authorOrCommitter>
97 <wipeOutWorkspace>true</wipeOutWorkspace>
98 <pruneBranches>false</pruneBranches>
99 <remotePoll>false</remotePoll>
100 <gitTool>Default</gitTool>
101 <submoduleCfg class="list"/>
106 <skipTag>true</skipTag>
108 <useShallowClone>false</useShallowClone>
109 <ignoreNotifyCommit>false</ignoreNotifyCommit>
111 <hudson.plugins.git.extensions.impl.SubmoduleOption>
112 <disableSubmodules>false</disableSubmodules>
113 <recursiveSubmodules>true</recursiveSubmodules>
114 <trackingSubmodules>false</trackingSubmodules>
116 <timeout>10</timeout>
117 </hudson.plugins.git.extensions.impl.SubmoduleOption>
118 <hudson.plugins.git.extensions.impl.WipeWorkspace/>
121 <triggers class="vector">
122 <org.jenkinsci.plugins.ghprb.GhprbTrigger>
125 <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
129 <triggerPhrase>^recheck$</triggerPhrase>
130 <onlyTriggerPhrase>false</onlyTriggerPhrase>
131 <useGitHubHooks>true</useGitHubHooks>
132 <permitAll>true</permitAll>
133 <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
135 <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
136 <commitStatusContext>JJB Verify</commitStatusContext>
137 </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
139 </org.jenkinsci.plugins.ghprb.GhprbTrigger>
144 # SPDX-License-Identifier: EPL-1.0
145 ##############################################################################
146 # Copyright (c) 2017 The Linux Foundation and others.
148 # All rights reserved. This program and the accompanying materials
149 # are made available under the terms of the Eclipse Public License v1.0
150 # which accompanies this distribution, and is available at
151 # http://www.eclipse.org/legal/epl-v10.html
152 ##############################################################################
153 echo "---> lftools-install.sh"
155 # Ensure we fail the job if any steps fail.
156 # DO NOT set -u as virtualenv's activate script has unbound variables
159 virtualenv --quiet "/tmp/v/lftools"
160 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
161 source "/tmp/v/lftools/bin/activate"
162 pip install --quiet --upgrade pip
163 pip install --quiet --upgrade "lftools<1.0.0"
165 # pipdeptree prints out a lot of information because lftools pulls in many
166 # dependencies. Let's only print it if we want to debug.
167 # echo "----> Pip Dependency Tree"
168 # pip install --quiet --upgrade pipdeptree
171 </hudson.tasks.Shell>
174 # SPDX-License-Identifier: EPL-1.0
175 ##############################################################################
176 # Copyright (c) 2017 The Linux Foundation and others.
178 # All rights reserved. This program and the accompanying materials
179 # are made available under the terms of the Eclipse Public License v1.0
180 # which accompanies this distribution, and is available at
181 # http://www.eclipse.org/legal/epl-v10.html
182 ##############################################################################
183 echo "---> tox-install.sh"
185 # Ensure we fail the job if any steps fail.
186 # DO NOT set -u as virtualenv's activate script has unbound variables
189 virtualenv --quiet "/tmp/v/tox"
190 # shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
191 source "/tmp/v/tox/bin/activate"
192 pip install --quiet --upgrade pip
193 pip install --quiet --upgrade pipdeptree
194 pip install --quiet --upgrade tox argparse
196 echo "----> Pip Dependency Tree"
200 # SPDX-License-Identifier: EPL-1.0
201 ##############################################################################
202 # Copyright (c) 2017 The Linux Foundation and others.
204 # All rights reserved. This program and the accompanying materials
205 # are made available under the terms of the Eclipse Public License v1.0
206 # which accompanies this distribution, and is available at
207 # http://www.eclipse.org/legal/epl-v10.html
208 ##############################################################################
209 echo "---> tox-install.sh"
211 # Ensure we fail the job if any steps fail.
212 # DO NOT set -u as virtualenv's activate script has unbound variables
215 cd "$WORKSPACE/$TOX_DIR"
217 if [ -n "$TOX_ENVS" ];
219 tox -e "$TOX_ENVS"
224 </hudson.tasks.Shell>
227 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
231 # SPDX-License-Identifier: EPL-1.0
232 ##############################################################################
233 # Copyright (c) 2017 The Linux Foundation and others.
235 # All rights reserved. This program and the accompanying materials
236 # are made available under the terms of the Eclipse Public License v1.0
237 # which accompanies this distribution, and is available at
238 # http://www.eclipse.org/legal/epl-v10.html
239 ##############################################################################
240 echo "---> sysstat.sh"
241 set +e # DON'T fail build if script fails.
243 OS=$(facter operatingsystem)
244 case "$OS" in
246 SYSSTAT_PATH="/var/log/sysstat"
248 # Dont run the script when systat is not enabled by default
249 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
254 SYSSTAT_PATH="/var/log/sa"
262 SAR_DIR="$WORKSPACE/archives/sar-reports"
263 mkdir -p "$SAR_DIR"
264 cp "$SYSSTAT_PATH/"* "$_"
265 # convert sar data to ascii format
266 while IFS="" read -r s
268 [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/sar${s//[!0-9]/}"
269 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
271 # DON'T fail build if script fails.
274 </hudson.tasks.Shell>
275 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
277 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
278 <fileId>jenkins-log-archives-settings</fileId>
280 <variable>SETTINGS_FILE</variable>
281 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
283 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
286 <propertiesContent>SERVER_ID=logs</propertiesContent>
291 # SPDX-License-Identifier: EPL-1.0
292 ##############################################################################
293 # Copyright (c) 2017 The Linux Foundation and others.
295 # All rights reserved. This program and the accompanying materials
296 # are made available under the terms of the Eclipse Public License v1.0
297 # which accompanies this distribution, and is available at
298 # http://www.eclipse.org/legal/epl-v10.html
299 ##############################################################################
300 echo "---> create-netrc.sh"
302 # Ensure we fail the job if any steps fail.
305 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
306 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
307 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
308 -v x:username -o ":" -v x:password \
309 "$SETTINGS_FILE")
311 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
312 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
313 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
315 echo "machine $machine login $user password $pass" > ~/.netrc
317 </hudson.tasks.Shell>
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 "---> lftools-install.sh"
331 # Ensure we fail the job if any steps fail.
332 # DO NOT set -u as virtualenv's activate script has unbound variables
335 virtualenv --quiet "/tmp/v/lftools"
336 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
337 source "/tmp/v/lftools/bin/activate"
338 pip install --quiet --upgrade pip
339 pip install --quiet --upgrade "lftools<1.0.0"
341 # pipdeptree prints out a lot of information because lftools pulls in many
342 # dependencies. Let's only print it if we want to debug.
343 # echo "----> Pip Dependency Tree"
344 # pip install --quiet --upgrade pipdeptree
348 # SPDX-License-Identifier: EPL-1.0
349 ##############################################################################
350 # Copyright (c) 2017 The Linux Foundation and others.
352 # All rights reserved. This program and the accompanying materials
353 # are made available under the terms of the Eclipse Public License v1.0
354 # which accompanies this distribution, and is available at
355 # http://www.eclipse.org/legal/epl-v10.html
356 ##############################################################################
357 echo "---> logs-deploy.sh"
359 # Ensure we fail the job if any steps fail.
362 set -x # Trace commands for this script to make debugging easier.
364 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
365 LOGS_SERVER="${LOGS_SERVER:-None}"
367 if [ "${LOGS_SERVER}" == 'None' ]
369 set +x # Disable trace since we no longer need it
371 echo "WARNING: Logging server not set"
373 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
374 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
375 BUILD_URL="${BUILD_URL}"
377 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
378 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
380 set +x # Disable trace since we no longer need it.
382 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
385 </hudson.tasks.Shell>
388 # SPDX-License-Identifier: EPL-1.0
389 ##############################################################################
390 # Copyright (c) 2017 The Linux Foundation and others.
392 # All rights reserved. This program and the accompanying materials
393 # are made available under the terms of the Eclipse Public License v1.0
394 # which accompanies this distribution, and is available at
395 # http://www.eclipse.org/legal/epl-v10.html
396 ##############################################################################
398 # Clear log credential files
399 rm "$SETTINGS_FILE"
402 </hudson.tasks.Shell>
403 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
404 <regexp>^Build logs: .*</regexp>
405 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
407 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
408 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
409 <markBuildUnstable>false</markBuildUnstable>
410 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
411 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
413 <hudson.plugins.ws__cleanup.Pattern>
414 <pattern>**/*.jenkins-trigger</pattern>
416 </hudson.plugins.ws__cleanup.Pattern>
418 <deleteDirs>false</deleteDirs>
419 <cleanupMatrixParent>false</cleanupMatrixParent>
421 <cleanWhenSuccess>true</cleanWhenSuccess>
422 <cleanWhenUnstable>true</cleanWhenUnstable>
423 <cleanWhenFailure>true</cleanWhenFailure>
424 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
425 <cleanWhenAborted>true</cleanWhenAborted>
426 <notFailBuild>true</notFailBuild>
427 </hudson.plugins.ws__cleanup.WsCleanup>
430 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
431 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
432 <timeoutMinutes>10</timeoutMinutes>
433 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
434 <failBuild>true</failBuild>
435 <writingDescription>false</writingDescription>
436 <timeoutPercentage>0</timeoutPercentage>
437 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
438 <timeoutType>absolute</timeoutType>
439 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
440 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
441 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
442 <user>test-credential</user>
443 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
444 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>