Refactor tests into jjb-tests directory
[releng/global-jjb.git] / jjb-test / expected-xml / github-python-tox-verify-{stream}
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>{stream}</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 # Ensure we fail the job if any steps fail.
156 # DO NOT set -u as virtualenv's activate script has unbound variables
157 set -e -o pipefail
158
159 virtualenv --quiet &quot;/tmp/v/lftools&quot;
160 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
161 source &quot;/tmp/v/lftools/bin/activate&quot;
162 pip install --quiet --upgrade pip
163 pip install --quiet --upgrade &quot;lftools&lt;1.0.0&quot;
164
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 &quot;----&gt; Pip Dependency Tree&quot;
168 # pip install --quiet --upgrade pipdeptree
169 # pipdeptree
170 </command>
171     </hudson.tasks.Shell>
172     <hudson.tasks.Shell>
173       <command>#!/bin/bash
174 # SPDX-License-Identifier: EPL-1.0
175 ##############################################################################
176 # Copyright (c) 2017 The Linux Foundation and others.
177 #
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 &quot;---&gt; tox-install.sh&quot;
184
185 # Ensure we fail the job if any steps fail.
186 # DO NOT set -u as virtualenv's activate script has unbound variables
187 set -e -o pipefail
188
189 virtualenv --quiet &quot;/tmp/v/tox&quot;
190 # shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
191 source &quot;/tmp/v/tox/bin/activate&quot;
192 pip install --quiet --upgrade pip
193 pip install --quiet --upgrade pipdeptree
194 pip install --quiet --upgrade tox argparse
195
196 echo &quot;----&gt; Pip Dependency Tree&quot;
197 pipdeptree
198
199 #!/bin/bash
200 # SPDX-License-Identifier: EPL-1.0
201 ##############################################################################
202 # Copyright (c) 2017 The Linux Foundation and others.
203 #
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 &quot;---&gt; tox-install.sh&quot;
210
211 # Ensure we fail the job if any steps fail.
212 # DO NOT set -u as virtualenv's activate script has unbound variables
213 set -e -o pipefail
214
215 cd &quot;$WORKSPACE/$TOX_DIR&quot;
216
217 if [ -n &quot;$TOX_ENVS&quot; ];
218 then
219     tox -e &quot;$TOX_ENVS&quot;
220 else
221     tox
222 fi
223 </command>
224     </hudson.tasks.Shell>
225   </builders>
226   <publishers>
227     <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
228       <buildSteps>
229         <hudson.tasks.Shell>
230           <command>#!/bin/bash
231 # SPDX-License-Identifier: EPL-1.0
232 ##############################################################################
233 # Copyright (c) 2017 The Linux Foundation and others.
234 #
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 &quot;---&gt; sysstat.sh&quot;
241 set +e  # DON'T fail build if script fails.
242
243 OS=$(facter operatingsystem)
244 case &quot;$OS&quot; in
245     Ubuntu)
246         SYSSTAT_PATH=&quot;/var/log/sysstat&quot;
247
248         # Dont run the script when systat is not enabled by default
249         if ! grep --quiet 'ENABLED=&quot;true&quot;' &quot;/etc/default/sysstat&quot;; then
250             exit 0
251         fi
252     ;;
253     CentOS|RedHat)
254         SYSSTAT_PATH=&quot;/var/log/sa&quot;
255     ;;
256     *)
257         # nothing to do
258         exit 0
259     ;;
260 esac
261
262 SAR_DIR=&quot;$WORKSPACE/archives/sar-reports&quot;
263 mkdir -p &quot;$SAR_DIR&quot;
264 cp &quot;$SYSSTAT_PATH/&quot;* &quot;$_&quot;
265 # convert sar data to ascii format
266 while IFS=&quot;&quot; read -r s
267 do
268     [ -f &quot;$s&quot; ] &amp;&amp; LC_TIME=POSIX sar -A -f &quot;$s&quot; &gt; &quot;$SAR_DIR/sar${s//[!0-9]/}&quot;
269 done &lt; &lt;(find &quot;$SYSSTAT_PATH&quot; -name &quot;sa[0-9]*&quot; || true)
270
271 # DON'T fail build if script fails.
272 exit 0
273 </command>
274         </hudson.tasks.Shell>
275         <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
276           <managedFiles>
277             <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
278               <fileId>jenkins-log-archives-settings</fileId>
279               <targetLocation/>
280               <variable>SETTINGS_FILE</variable>
281             </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
282           </managedFiles>
283         </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
284         <EnvInjectBuilder>
285           <info>
286             <propertiesContent>SERVER_ID=logs</propertiesContent>
287           </info>
288         </EnvInjectBuilder>
289         <hudson.tasks.Shell>
290           <command>#!/bin/bash
291 # SPDX-License-Identifier: EPL-1.0
292 ##############################################################################
293 # Copyright (c) 2017 The Linux Foundation and others.
294 #
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 &quot;---&gt; create-netrc.sh&quot;
301
302 # Ensure we fail the job if any steps fail.
303 set -eu -o pipefail
304
305 NEXUS_URL=&quot;${NEXUS_URL:-$NEXUSPROXY}&quot;
306 CREDENTIAL=$(xmlstarlet sel -N &quot;x=http://maven.apache.org/SETTINGS/1.0.0&quot; \
307     -t -m &quot;/x:settings/x:servers/x:server[x:id='${SERVER_ID}']&quot; \
308     -v x:username -o &quot;:&quot; -v x:password \
309     &quot;$SETTINGS_FILE&quot;)
310
311 machine=$(echo &quot;$NEXUS_URL&quot; | awk -F/ '{print $3}')
312 user=$(echo &quot;$CREDENTIAL&quot; | cut -f1 -d:)
313 pass=$(echo &quot;$CREDENTIAL&quot; | cut -f2 -d:)
314
315 echo &quot;machine $machine login $user password $pass&quot; &gt; ~/.netrc
316 </command>
317         </hudson.tasks.Shell>
318         <hudson.tasks.Shell>
319           <command>#!/bin/bash
320 # SPDX-License-Identifier: EPL-1.0
321 ##############################################################################
322 # Copyright (c) 2017 The Linux Foundation and others.
323 #
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 &quot;---&gt; lftools-install.sh&quot;
330
331 # Ensure we fail the job if any steps fail.
332 # DO NOT set -u as virtualenv's activate script has unbound variables
333 set -e -o pipefail
334
335 virtualenv --quiet &quot;/tmp/v/lftools&quot;
336 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
337 source &quot;/tmp/v/lftools/bin/activate&quot;
338 pip install --quiet --upgrade pip
339 pip install --quiet --upgrade &quot;lftools&lt;1.0.0&quot;
340
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 &quot;----&gt; Pip Dependency Tree&quot;
344 # pip install --quiet --upgrade pipdeptree
345 # pipdeptree
346
347 #!/bin/bash
348 # SPDX-License-Identifier: EPL-1.0
349 ##############################################################################
350 # Copyright (c) 2017 The Linux Foundation and others.
351 #
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 &quot;---&gt; logs-deploy.sh&quot;
358
359 # Ensure we fail the job if any steps fail.
360 set -eu -o pipefail
361
362 set -x  # Trace commands for this script to make debugging easier.
363
364 ARCHIVE_ARTIFACTS=&quot;${ARCHIVE_ARTIFACTS:-}&quot;
365 LOGS_SERVER=&quot;${LOGS_SERVER:-None}&quot;
366
367 if [ &quot;${LOGS_SERVER}&quot; == 'None' ]
368 then
369     set +x # Disable trace since we no longer need it
370
371     echo &quot;WARNING: Logging server not set&quot;
372 else
373     NEXUS_URL=&quot;${NEXUS_URL:-$NEXUSPROXY}&quot;
374     NEXUS_PATH=&quot;${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}&quot;
375     BUILD_URL=&quot;${BUILD_URL}&quot;
376
377     lftools deploy archives -p &quot;$ARCHIVE_ARTIFACTS&quot; &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$WORKSPACE&quot;
378     lftools deploy logs &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$BUILD_URL&quot;
379
380     set +x  # Disable trace since we no longer need it.
381
382     echo &quot;Build logs: &lt;a href=\&quot;$LOGS_SERVER/$NEXUS_PATH\&quot;&gt;$LOGS_SERVER/$NEXUS_PATH&lt;/a&gt;&quot;
383 fi
384 </command>
385         </hudson.tasks.Shell>
386         <hudson.tasks.Shell>
387           <command>#!/bin/bash
388 # SPDX-License-Identifier: EPL-1.0
389 ##############################################################################
390 # Copyright (c) 2017 The Linux Foundation and others.
391 #
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 ##############################################################################
397
398 # Clear log credential files
399 rm &quot;$SETTINGS_FILE&quot;
400 rm ~/.netrc
401 </command>
402         </hudson.tasks.Shell>
403         <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
404           <regexp>^Build logs: .*</regexp>
405         </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
406       </buildSteps>
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">
412       <patterns>
413         <hudson.plugins.ws__cleanup.Pattern>
414           <pattern>**/*.jenkins-trigger</pattern>
415           <type>EXCLUDE</type>
416         </hudson.plugins.ws__cleanup.Pattern>
417       </patterns>
418       <deleteDirs>false</deleteDirs>
419       <cleanupMatrixParent>false</cleanupMatrixParent>
420       <externalDelete/>
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>
428   </publishers>
429   <buildWrappers>
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/>
445   </buildWrappers>
446 </project>