cee75a7c64241fba1072d553757e4f21099208b7
[releng/global-jjb.git] / jjb-test / expected-xml / github-python-tox-verify-master
1 <?xml version="1.0" encoding="utf-8"?>
2 <project>
3   <actions/>
4   <description>&lt;!-- Managed by Jenkins Job Builder --&gt;</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>
11   <properties>
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>
18           <name>PROJECT</name>
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
22 </description>
23           <defaultValue>releng/ciman</defaultValue>
24         </hudson.model.StringParameterDefinition>
25         <hudson.model.StringParameterDefinition>
26           <name>STREAM</name>
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
29 name.
30 </description>
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
38
39 Note that Gerrit will override this parameter automatically if a
40 job is triggered by Gerrit.
41 </description>
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.
47
48 Note that Gerrit will override this parameter automatically if a
49 job is triggered by Gerrit.
50 </description>
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.
56
57 Note that Gerrit will override this parameter automatically if a
58 job is triggered by Gerrit.
59 </description>
60           <defaultValue/>
61         </hudson.model.StringParameterDefinition>
62         <hudson.model.StringParameterDefinition>
63           <name>TOX_DIR</name>
64           <description>Path to directory containing tox.ini file.
65 </description>
66           <defaultValue/>
67         </hudson.model.StringParameterDefinition>
68         <hudson.model.StringParameterDefinition>
69           <name>TOX_ENVS</name>
70           <description>Tox environments to run build against.
71 Example: docs,py2,py3
72 </description>
73           <defaultValue/>
74         </hudson.model.StringParameterDefinition>
75       </parameterDefinitions>
76     </hudson.model.ParametersDefinitionProperty>
77   </properties>
78   <scm class="hudson.plugins.git.GitSCM">
79     <configVersion>2</configVersion>
80     <userRemoteConfigs>
81       <hudson.plugins.git.UserRemoteConfig>
82         <name>origin</name>
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>
87     </userRemoteConfigs>
88     <branches>
89       <hudson.plugins.git.BranchSpec>
90         <name>**</name>
91       </hudson.plugins.git.BranchSpec>
92     </branches>
93     <excludedUsers/>
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"/>
102     <relativeTargetDir/>
103     <reference/>
104     <gitConfigName/>
105     <gitConfigEmail/>
106     <skipTag>true</skipTag>
107     <scmName/>
108     <useShallowClone>false</useShallowClone>
109     <ignoreNotifyCommit>false</ignoreNotifyCommit>
110     <extensions>
111       <hudson.plugins.git.extensions.impl.SubmoduleOption>
112         <disableSubmodules>false</disableSubmodules>
113         <recursiveSubmodules>true</recursiveSubmodules>
114         <trackingSubmodules>false</trackingSubmodules>
115         <reference/>
116         <timeout>10</timeout>
117       </hudson.plugins.git.extensions.impl.SubmoduleOption>
118       <hudson.plugins.git.extensions.impl.WipeWorkspace/>
119     </extensions>
120   </scm>
121   <triggers class="vector">
122     <org.jenkinsci.plugins.ghprb.GhprbTrigger>
123       <spec/>
124       <adminlist/>
125       <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
126       <whitelist/>
127       <orgslist/>
128       <cron/>
129       <triggerPhrase>^recheck$</triggerPhrase>
130       <onlyTriggerPhrase>false</onlyTriggerPhrase>
131       <useGitHubHooks>true</useGitHubHooks>
132       <permitAll>true</permitAll>
133       <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
134       <extensions>
135         <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
136           <commitStatusContext>JJB Verify</commitStatusContext>
137         </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
138       </extensions>
139     </org.jenkinsci.plugins.ghprb.GhprbTrigger>
140   </triggers>
141   <builders>
142     <hudson.tasks.Shell>
143       <command>#!/bin/bash
144 # SPDX-License-Identifier: EPL-1.0
145 ##############################################################################
146 # Copyright (c) 2017 The Linux Foundation and others.
147 #
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 &quot;---&gt; lftools-install.sh&quot;
154
155 # By default a released version of lftools should always be used.
156 # The purpose of the 2 variables below is so that lftools devs can test
157 # unreleased versions of lftools. There are 2 methods to install a dev version
158 # of lftools:
159 #
160 #     1) gerrit patch: Used to test a patch that has not yet been merged.
161 #                      To do this set something like this:
162 #                          LFTOOLS_MODE=gerrit
163 #                          LFTOOLS_REFSPEC=refs/changes/96/5296/7
164 #
165 #     2) git branch: Used to install an lftools version from a specific branch.
166 #                    To use this set the variables as follows:
167 #                          LFTOOLS_MODE=git
168 #                          LFTOOLS_REFSPEC=master
169 #
170 #     3) release : The intended use case and default setting.
171 #                  Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
172
173 LFTOOLS_MODE=release  # release | git | gerrit
174 LFTOOLS_REFSPEC=master
175
176 # Ensure we fail the job if any steps fail.
177 # DO NOT set -u as virtualenv's activate script has unbound variables
178 set -e -o pipefail
179
180 virtualenv --quiet &quot;/tmp/v/lftools&quot;
181 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
182 source &quot;/tmp/v/lftools/bin/activate&quot;
183 pip install --quiet --upgrade pip
184
185 case $LFTOOLS_MODE in
186     gerrit)
187         git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
188         pushd /tmp/lftools
189         git fetch origin &quot;$LFTOOLS_REFSPEC&quot;
190         git checkout FETCH_HEAD
191         pip install --quiet --upgrade -r requirements.txt
192         pip install --quiet --upgrade -e .
193         popd
194         ;;
195
196     git)
197         pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@&quot;$BRANCH&quot;
198         ;;
199
200     release)
201         pip install --quiet --upgrade &quot;lftools&lt;1.0.0&quot;
202         ;;
203 esac
204
205 # pipdeptree prints out a lot of information because lftools pulls in many
206 # dependencies. Let's only print it if we want to debug.
207 # echo &quot;----&gt; Pip Dependency Tree&quot;
208 # pip install --quiet --upgrade pipdeptree
209 # pipdeptree
210 </command>
211     </hudson.tasks.Shell>
212     <hudson.tasks.Shell>
213       <command>#!/bin/bash
214 # SPDX-License-Identifier: EPL-1.0
215 ##############################################################################
216 # Copyright (c) 2017 The Linux Foundation and others.
217 #
218 # All rights reserved. This program and the accompanying materials
219 # are made available under the terms of the Eclipse Public License v1.0
220 # which accompanies this distribution, and is available at
221 # http://www.eclipse.org/legal/epl-v10.html
222 ##############################################################################
223 echo &quot;---&gt; tox-install.sh&quot;
224
225 # Ensure we fail the job if any steps fail.
226 # DO NOT set -u as virtualenv's activate script has unbound variables
227 set -e -o pipefail
228
229 virtualenv --quiet &quot;/tmp/v/tox&quot;
230 # shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
231 source &quot;/tmp/v/tox/bin/activate&quot;
232 pip install --quiet --upgrade pip
233 pip install --quiet --upgrade pipdeptree
234 pip install --quiet --upgrade tox argparse
235
236 echo &quot;----&gt; Pip Dependency Tree&quot;
237 pipdeptree
238
239 #!/bin/bash
240 # SPDX-License-Identifier: EPL-1.0
241 ##############################################################################
242 # Copyright (c) 2017 The Linux Foundation and others.
243 #
244 # All rights reserved. This program and the accompanying materials
245 # are made available under the terms of the Eclipse Public License v1.0
246 # which accompanies this distribution, and is available at
247 # http://www.eclipse.org/legal/epl-v10.html
248 ##############################################################################
249 echo &quot;---&gt; tox-install.sh&quot;
250
251 # Ensure we fail the job if any steps fail.
252 # DO NOT set -u as virtualenv's activate script has unbound variables
253 set -e -o pipefail
254
255 cd &quot;$WORKSPACE/$TOX_DIR&quot;
256
257 if [ -n &quot;$TOX_ENVS&quot; ];
258 then
259     tox -e &quot;$TOX_ENVS&quot;
260 else
261     tox
262 fi
263 </command>
264     </hudson.tasks.Shell>
265   </builders>
266   <publishers>
267     <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
268       <buildSteps>
269         <hudson.tasks.Shell>
270           <command>#!/bin/bash
271 # SPDX-License-Identifier: EPL-1.0
272 ##############################################################################
273 # Copyright (c) 2017 The Linux Foundation and others.
274 #
275 # All rights reserved. This program and the accompanying materials
276 # are made available under the terms of the Eclipse Public License v1.0
277 # which accompanies this distribution, and is available at
278 # http://www.eclipse.org/legal/epl-v10.html
279 ##############################################################################
280 echo &quot;---&gt; sysstat.sh&quot;
281 set +e  # DON'T fail build if script fails.
282
283 OS=$(facter operatingsystem)
284 case &quot;$OS&quot; in
285     Ubuntu)
286         SYSSTAT_PATH=&quot;/var/log/sysstat&quot;
287
288         # Dont run the script when systat is not enabled by default
289         if ! grep --quiet 'ENABLED=&quot;true&quot;' &quot;/etc/default/sysstat&quot;; then
290             exit 0
291         fi
292     ;;
293     CentOS|RedHat)
294         SYSSTAT_PATH=&quot;/var/log/sa&quot;
295     ;;
296     *)
297         # nothing to do
298         exit 0
299     ;;
300 esac
301
302 SAR_DIR=&quot;$WORKSPACE/archives/sar-reports&quot;
303 mkdir -p &quot;$SAR_DIR&quot;
304 cp &quot;$SYSSTAT_PATH/&quot;* &quot;$_&quot;
305 # convert sar data to ascii format
306 while IFS=&quot;&quot; read -r s
307 do
308     [ -f &quot;$s&quot; ] &amp;&amp; LC_TIME=POSIX sar -A -f &quot;$s&quot; &gt; &quot;$SAR_DIR/sar${s//[!0-9]/}&quot;
309 done &lt; &lt;(find &quot;$SYSSTAT_PATH&quot; -name &quot;sa[0-9]*&quot; || true)
310
311 # DON'T fail build if script fails.
312 exit 0
313 </command>
314         </hudson.tasks.Shell>
315         <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
316           <managedFiles>
317             <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
318               <fileId>jenkins-log-archives-settings</fileId>
319               <targetLocation/>
320               <variable>SETTINGS_FILE</variable>
321             </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
322           </managedFiles>
323         </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
324         <EnvInjectBuilder>
325           <info>
326             <propertiesContent>SERVER_ID=logs</propertiesContent>
327           </info>
328         </EnvInjectBuilder>
329         <hudson.tasks.Shell>
330           <command>#!/bin/bash
331 # SPDX-License-Identifier: EPL-1.0
332 ##############################################################################
333 # Copyright (c) 2017 The Linux Foundation and others.
334 #
335 # All rights reserved. This program and the accompanying materials
336 # are made available under the terms of the Eclipse Public License v1.0
337 # which accompanies this distribution, and is available at
338 # http://www.eclipse.org/legal/epl-v10.html
339 ##############################################################################
340 echo &quot;---&gt; create-netrc.sh&quot;
341
342 # Ensure we fail the job if any steps fail.
343 set -eu -o pipefail
344
345 NEXUS_URL=&quot;${NEXUS_URL:-$NEXUSPROXY}&quot;
346 CREDENTIAL=$(xmlstarlet sel -N &quot;x=http://maven.apache.org/SETTINGS/1.0.0&quot; \
347     -t -m &quot;/x:settings/x:servers/x:server[x:id='${SERVER_ID}']&quot; \
348     -v x:username -o &quot;:&quot; -v x:password \
349     &quot;$SETTINGS_FILE&quot;)
350
351 machine=$(echo &quot;$NEXUS_URL&quot; | awk -F/ '{print $3}')
352 user=$(echo &quot;$CREDENTIAL&quot; | cut -f1 -d:)
353 pass=$(echo &quot;$CREDENTIAL&quot; | cut -f2 -d:)
354
355 echo &quot;machine $machine login $user password $pass&quot; &gt; ~/.netrc
356 </command>
357         </hudson.tasks.Shell>
358         <hudson.tasks.Shell>
359           <command>#!/bin/bash
360 # SPDX-License-Identifier: EPL-1.0
361 ##############################################################################
362 # Copyright (c) 2017 The Linux Foundation and others.
363 #
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 ##############################################################################
369 echo &quot;---&gt; lftools-install.sh&quot;
370
371 # By default a released version of lftools should always be used.
372 # The purpose of the 2 variables below is so that lftools devs can test
373 # unreleased versions of lftools. There are 2 methods to install a dev version
374 # of lftools:
375 #
376 #     1) gerrit patch: Used to test a patch that has not yet been merged.
377 #                      To do this set something like this:
378 #                          LFTOOLS_MODE=gerrit
379 #                          LFTOOLS_REFSPEC=refs/changes/96/5296/7
380 #
381 #     2) git branch: Used to install an lftools version from a specific branch.
382 #                    To use this set the variables as follows:
383 #                          LFTOOLS_MODE=git
384 #                          LFTOOLS_REFSPEC=master
385 #
386 #     3) release : The intended use case and default setting.
387 #                  Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
388
389 LFTOOLS_MODE=release  # release | git | gerrit
390 LFTOOLS_REFSPEC=master
391
392 # Ensure we fail the job if any steps fail.
393 # DO NOT set -u as virtualenv's activate script has unbound variables
394 set -e -o pipefail
395
396 virtualenv --quiet &quot;/tmp/v/lftools&quot;
397 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
398 source &quot;/tmp/v/lftools/bin/activate&quot;
399 pip install --quiet --upgrade pip
400
401 case $LFTOOLS_MODE in
402     gerrit)
403         git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
404         pushd /tmp/lftools
405         git fetch origin &quot;$LFTOOLS_REFSPEC&quot;
406         git checkout FETCH_HEAD
407         pip install --quiet --upgrade -r requirements.txt
408         pip install --quiet --upgrade -e .
409         popd
410         ;;
411
412     git)
413         pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@&quot;$BRANCH&quot;
414         ;;
415
416     release)
417         pip install --quiet --upgrade &quot;lftools&lt;1.0.0&quot;
418         ;;
419 esac
420
421 # pipdeptree prints out a lot of information because lftools pulls in many
422 # dependencies. Let's only print it if we want to debug.
423 # echo &quot;----&gt; Pip Dependency Tree&quot;
424 # pip install --quiet --upgrade pipdeptree
425 # pipdeptree
426
427 #!/bin/bash
428 # SPDX-License-Identifier: EPL-1.0
429 ##############################################################################
430 # Copyright (c) 2017 The Linux Foundation and others.
431 #
432 # All rights reserved. This program and the accompanying materials
433 # are made available under the terms of the Eclipse Public License v1.0
434 # which accompanies this distribution, and is available at
435 # http://www.eclipse.org/legal/epl-v10.html
436 ##############################################################################
437 echo &quot;---&gt; logs-deploy.sh&quot;
438
439 # Ensure we fail the job if any steps fail.
440 set -eu -o pipefail
441
442 set -x  # Trace commands for this script to make debugging easier.
443
444 ARCHIVE_ARTIFACTS=&quot;${ARCHIVE_ARTIFACTS:-}&quot;
445 LOGS_SERVER=&quot;${LOGS_SERVER:-None}&quot;
446
447 if [ &quot;${LOGS_SERVER}&quot; == 'None' ]
448 then
449     set +x # Disable trace since we no longer need it
450
451     echo &quot;WARNING: Logging server not set&quot;
452 else
453     NEXUS_URL=&quot;${NEXUS_URL:-$NEXUSPROXY}&quot;
454     NEXUS_PATH=&quot;${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}&quot;
455     BUILD_URL=&quot;${BUILD_URL}&quot;
456
457     lftools deploy archives -p &quot;$ARCHIVE_ARTIFACTS&quot; &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$WORKSPACE&quot;
458     lftools deploy logs &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$BUILD_URL&quot;
459
460     set +x  # Disable trace since we no longer need it.
461
462     echo &quot;Build logs: &lt;a href=\&quot;$LOGS_SERVER/$NEXUS_PATH\&quot;&gt;$LOGS_SERVER/$NEXUS_PATH&lt;/a&gt;&quot;
463 fi
464 </command>
465         </hudson.tasks.Shell>
466         <hudson.tasks.Shell>
467           <command>#!/bin/bash
468 # SPDX-License-Identifier: EPL-1.0
469 ##############################################################################
470 # Copyright (c) 2017 The Linux Foundation and others.
471 #
472 # All rights reserved. This program and the accompanying materials
473 # are made available under the terms of the Eclipse Public License v1.0
474 # which accompanies this distribution, and is available at
475 # http://www.eclipse.org/legal/epl-v10.html
476 ##############################################################################
477
478 # Clear log credential files
479 rm &quot;$SETTINGS_FILE&quot;
480 rm ~/.netrc
481 </command>
482         </hudson.tasks.Shell>
483         <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
484           <regexp>^Build logs: .*</regexp>
485         </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
486       </buildSteps>
487       <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
488       <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
489       <markBuildUnstable>false</markBuildUnstable>
490     </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
491     <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
492       <patterns>
493         <hudson.plugins.ws__cleanup.Pattern>
494           <pattern>**/*.jenkins-trigger</pattern>
495           <type>EXCLUDE</type>
496         </hudson.plugins.ws__cleanup.Pattern>
497       </patterns>
498       <deleteDirs>false</deleteDirs>
499       <cleanupMatrixParent>false</cleanupMatrixParent>
500       <externalDelete/>
501       <cleanWhenSuccess>true</cleanWhenSuccess>
502       <cleanWhenUnstable>true</cleanWhenUnstable>
503       <cleanWhenFailure>true</cleanWhenFailure>
504       <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
505       <cleanWhenAborted>true</cleanWhenAborted>
506       <notFailBuild>true</notFailBuild>
507     </hudson.plugins.ws__cleanup.WsCleanup>
508   </publishers>
509   <buildWrappers>
510     <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
511     <hudson.plugins.build__timeout.BuildTimeoutWrapper>
512       <timeoutMinutes>10</timeoutMinutes>
513       <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
514       <failBuild>true</failBuild>
515       <writingDescription>false</writingDescription>
516       <timeoutPercentage>0</timeoutPercentage>
517       <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
518       <timeoutType>absolute</timeoutType>
519     </hudson.plugins.build__timeout.BuildTimeoutWrapper>
520     <hudson.plugins.timestamper.TimestamperBuildWrapper/>
521     <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
522       <user>test-credential</user>
523     </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
524     <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
525   </buildWrappers>
526 </project>