Add default refspec reference
[releng/global-jjb.git] / jjb-test / expected-xml / gerrit-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     <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>
18       </strategy>
19     </jenkins.model.BuildDiscarderProperty>
20     <hudson.model.ParametersDefinitionProperty>
21       <parameterDefinitions>
22         <hudson.model.StringParameterDefinition>
23           <name>PROJECT</name>
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
27 </description>
28           <defaultValue>releng/ciman</defaultValue>
29         </hudson.model.StringParameterDefinition>
30         <hudson.model.StringParameterDefinition>
31           <name>STREAM</name>
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
34 name.
35 </description>
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
43
44 Note that Gerrit will override this parameter automatically if a
45 job is triggered by Gerrit.
46 </description>
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.
52
53 Note that Gerrit will override this parameter automatically if a
54 job is triggered by Gerrit.
55 </description>
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.
61
62 Note that Gerrit will override this parameter automatically if a
63 job is triggered by Gerrit.
64 </description>
65           <defaultValue>refs/heads/master</defaultValue>
66         </hudson.model.StringParameterDefinition>
67         <hudson.model.StringParameterDefinition>
68           <name>TOX_DIR</name>
69           <description>Path to directory containing tox.ini file.
70 </description>
71           <defaultValue/>
72         </hudson.model.StringParameterDefinition>
73         <hudson.model.StringParameterDefinition>
74           <name>TOX_ENVS</name>
75           <description>Tox environments to run build against.
76 Example: docs,py2,py3
77 </description>
78           <defaultValue/>
79         </hudson.model.StringParameterDefinition>
80       </parameterDefinitions>
81     </hudson.model.ParametersDefinitionProperty>
82   </properties>
83   <scm class="hudson.plugins.git.GitSCM">
84     <configVersion>2</configVersion>
85     <userRemoteConfigs>
86       <hudson.plugins.git.UserRemoteConfig>
87         <name>origin</name>
88         <refspec>$GERRIT_REFSPEC</refspec>
89         <url>$GIT_URL/$GERRIT_PROJECT</url>
90         <credentialsId>test-credential</credentialsId>
91       </hudson.plugins.git.UserRemoteConfig>
92     </userRemoteConfigs>
93     <branches>
94       <hudson.plugins.git.BranchSpec>
95         <name>refs/heads/$GERRIT_BRANCH</name>
96       </hudson.plugins.git.BranchSpec>
97     </branches>
98     <excludedUsers/>
99     <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
100     <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
101     <authorOrCommitter>false</authorOrCommitter>
102     <wipeOutWorkspace>true</wipeOutWorkspace>
103     <pruneBranches>false</pruneBranches>
104     <remotePoll>false</remotePoll>
105     <gitTool>Default</gitTool>
106     <submoduleCfg class="list"/>
107     <relativeTargetDir/>
108     <reference/>
109     <gitConfigName/>
110     <gitConfigEmail/>
111     <skipTag>true</skipTag>
112     <scmName/>
113     <useShallowClone>false</useShallowClone>
114     <ignoreNotifyCommit>false</ignoreNotifyCommit>
115     <extensions>
116       <hudson.plugins.git.extensions.impl.SubmoduleOption>
117         <disableSubmodules>false</disableSubmodules>
118         <recursiveSubmodules>true</recursiveSubmodules>
119         <trackingSubmodules>false</trackingSubmodules>
120         <reference/>
121         <timeout>10</timeout>
122       </hudson.plugins.git.extensions.impl.SubmoduleOption>
123       <hudson.plugins.git.extensions.impl.WipeWorkspace/>
124     </extensions>
125   </scm>
126   <triggers class="vector">
127     <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
128       <spec/>
129       <gerritProjects>
130         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
131           <compareType>ANT</compareType>
132           <pattern>releng/ciman</pattern>
133           <branches>
134             <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
135               <compareType>ANT</compareType>
136               <pattern>**/master</pattern>
137             </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.Branch>
138           </branches>
139           <disableStrictForbiddenFileVerification>false</disableStrictForbiddenFileVerification>
140         </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.GerritProject>
141       </gerritProjects>
142       <skipVote>
143         <onSuccessful>false</onSuccessful>
144         <onFailed>false</onFailed>
145         <onUnstable>false</onUnstable>
146         <onNotBuilt>false</onNotBuilt>
147       </skipVote>
148       <silentMode>false</silentMode>
149       <silentStartMode>false</silentStartMode>
150       <escapeQuotes>true</escapeQuotes>
151       <noNameAndEmailParameters>false</noNameAndEmailParameters>
152       <readableMessage>false</readableMessage>
153       <dependencyJobsNames/>
154       <notificationLevel/>
155       <dynamicTriggerConfiguration>False</dynamicTriggerConfiguration>
156       <triggerConfigURL/>
157       <allowTriggeringUnreviewedPatches>false</allowTriggeringUnreviewedPatches>
158       <triggerOnEvents>
159         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
160           <excludeDrafts>false</excludeDrafts>
161           <excludeTrivialRebase>false</excludeTrivialRebase>
162           <excludeNoCodeChange>false</excludeNoCodeChange>
163         </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent>
164         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginDraftPublishedEvent/>
165         <com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
166           <commentAddedCommentContains>recheck$</commentAddedCommentContains>
167         </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginCommentAddedContainsEvent>
168       </triggerOnEvents>
169       <buildStartMessage/>
170       <buildFailureMessage/>
171       <buildSuccessfulMessage/>
172       <buildUnstableMessage/>
173       <buildNotBuiltMessage/>
174       <buildUnsuccessfulFilepath/>
175       <customUrl/>
176       <serverName>test-server</serverName>
177     </com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTrigger>
178   </triggers>
179   <builders>
180     <hudson.tasks.Shell>
181       <command>#!/bin/bash
182 # SPDX-License-Identifier: EPL-1.0
183 ##############################################################################
184 # Copyright (c) 2017 The Linux Foundation and others.
185 #
186 # All rights reserved. This program and the accompanying materials
187 # are made available under the terms of the Eclipse Public License v1.0
188 # which accompanies this distribution, and is available at
189 # http://www.eclipse.org/legal/epl-v10.html
190 ##############################################################################
191 echo &quot;---&gt; lftools-install.sh&quot;
192
193 # Ensure we fail the job if any steps fail.
194 # DO NOT set -u as virtualenv's activate script has unbound variables
195 set -e -o pipefail
196
197 virtualenv --quiet &quot;/tmp/v/lftools&quot;
198 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
199 source &quot;/tmp/v/lftools/bin/activate&quot;
200 pip install --quiet --upgrade pip
201 pip install --quiet --upgrade &quot;lftools&lt;1.0.0&quot;
202
203 # pipdeptree prints out a lot of information because lftools pulls in many
204 # dependencies. Let's only print it if we want to debug.
205 # echo &quot;----&gt; Pip Dependency Tree&quot;
206 # pip install --quiet --upgrade pipdeptree
207 # pipdeptree
208 </command>
209     </hudson.tasks.Shell>
210     <hudson.tasks.Shell>
211       <command>#!/bin/bash
212 # SPDX-License-Identifier: EPL-1.0
213 ##############################################################################
214 # Copyright (c) 2017 The Linux Foundation and others.
215 #
216 # All rights reserved. This program and the accompanying materials
217 # are made available under the terms of the Eclipse Public License v1.0
218 # which accompanies this distribution, and is available at
219 # http://www.eclipse.org/legal/epl-v10.html
220 ##############################################################################
221 echo &quot;---&gt; tox-install.sh&quot;
222
223 # Ensure we fail the job if any steps fail.
224 # DO NOT set -u as virtualenv's activate script has unbound variables
225 set -e -o pipefail
226
227 virtualenv --quiet &quot;/tmp/v/tox&quot;
228 # shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
229 source &quot;/tmp/v/tox/bin/activate&quot;
230 pip install --quiet --upgrade pip
231 pip install --quiet --upgrade pipdeptree
232 pip install --quiet --upgrade tox argparse
233
234 echo &quot;----&gt; Pip Dependency Tree&quot;
235 pipdeptree
236
237 #!/bin/bash
238 # SPDX-License-Identifier: EPL-1.0
239 ##############################################################################
240 # Copyright (c) 2017 The Linux Foundation and others.
241 #
242 # All rights reserved. This program and the accompanying materials
243 # are made available under the terms of the Eclipse Public License v1.0
244 # which accompanies this distribution, and is available at
245 # http://www.eclipse.org/legal/epl-v10.html
246 ##############################################################################
247 echo &quot;---&gt; tox-install.sh&quot;
248
249 # Ensure we fail the job if any steps fail.
250 # DO NOT set -u as virtualenv's activate script has unbound variables
251 set -e -o pipefail
252
253 cd &quot;$WORKSPACE/$TOX_DIR&quot;
254
255 if [ -n &quot;$TOX_ENVS&quot; ];
256 then
257     tox -e &quot;$TOX_ENVS&quot;
258 else
259     tox
260 fi
261 </command>
262     </hudson.tasks.Shell>
263   </builders>
264   <publishers>
265     <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
266       <buildSteps>
267         <hudson.tasks.Shell>
268           <command>#!/bin/bash
269 # SPDX-License-Identifier: EPL-1.0
270 ##############################################################################
271 # Copyright (c) 2017 The Linux Foundation and others.
272 #
273 # All rights reserved. This program and the accompanying materials
274 # are made available under the terms of the Eclipse Public License v1.0
275 # which accompanies this distribution, and is available at
276 # http://www.eclipse.org/legal/epl-v10.html
277 ##############################################################################
278 echo &quot;---&gt; sysstat.sh&quot;
279 set +e  # DON'T fail build if script fails.
280
281 OS=$(facter operatingsystem)
282 case &quot;$OS&quot; in
283     Ubuntu)
284         SYSSTAT_PATH=&quot;/var/log/sysstat&quot;
285
286         # Dont run the script when systat is not enabled by default
287         if ! grep --quiet 'ENABLED=&quot;true&quot;' &quot;/etc/default/sysstat&quot;; then
288             exit 0
289         fi
290     ;;
291     CentOS|RedHat)
292         SYSSTAT_PATH=&quot;/var/log/sa&quot;
293     ;;
294     *)
295         # nothing to do
296         exit 0
297     ;;
298 esac
299
300 SAR_DIR=&quot;$WORKSPACE/archives/sar-reports&quot;
301 mkdir -p &quot;$SAR_DIR&quot;
302 cp &quot;$SYSSTAT_PATH/&quot;* &quot;$_&quot;
303 # convert sar data to ascii format
304 while IFS=&quot;&quot; read -r s
305 do
306     [ -f &quot;$s&quot; ] &amp;&amp; LC_TIME=POSIX sar -A -f &quot;$s&quot; &gt; &quot;$SAR_DIR/sar${s//[!0-9]/}&quot;
307 done &lt; &lt;(find &quot;$SYSSTAT_PATH&quot; -name &quot;sa[0-9]*&quot; || true)
308
309 # DON'T fail build if script fails.
310 exit 0
311 </command>
312         </hudson.tasks.Shell>
313         <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
314           <managedFiles>
315             <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
316               <fileId>jenkins-log-archives-settings</fileId>
317               <targetLocation/>
318               <variable>SETTINGS_FILE</variable>
319             </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
320           </managedFiles>
321         </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
322         <EnvInjectBuilder>
323           <info>
324             <propertiesContent>SERVER_ID=logs</propertiesContent>
325           </info>
326         </EnvInjectBuilder>
327         <hudson.tasks.Shell>
328           <command>#!/bin/bash
329 # SPDX-License-Identifier: EPL-1.0
330 ##############################################################################
331 # Copyright (c) 2017 The Linux Foundation and others.
332 #
333 # All rights reserved. This program and the accompanying materials
334 # are made available under the terms of the Eclipse Public License v1.0
335 # which accompanies this distribution, and is available at
336 # http://www.eclipse.org/legal/epl-v10.html
337 ##############################################################################
338 echo &quot;---&gt; create-netrc.sh&quot;
339
340 # Ensure we fail the job if any steps fail.
341 set -eu -o pipefail
342
343 NEXUS_URL=&quot;${NEXUS_URL:-$NEXUSPROXY}&quot;
344 CREDENTIAL=$(xmlstarlet sel -N &quot;x=http://maven.apache.org/SETTINGS/1.0.0&quot; \
345     -t -m &quot;/x:settings/x:servers/x:server[x:id='${SERVER_ID}']&quot; \
346     -v x:username -o &quot;:&quot; -v x:password \
347     &quot;$SETTINGS_FILE&quot;)
348
349 machine=$(echo &quot;$NEXUS_URL&quot; | awk -F/ '{print $3}')
350 user=$(echo &quot;$CREDENTIAL&quot; | cut -f1 -d:)
351 pass=$(echo &quot;$CREDENTIAL&quot; | cut -f2 -d:)
352
353 echo &quot;machine $machine login $user password $pass&quot; &gt; ~/.netrc
354 </command>
355         </hudson.tasks.Shell>
356         <hudson.tasks.Shell>
357           <command>#!/bin/bash
358 # SPDX-License-Identifier: EPL-1.0
359 ##############################################################################
360 # Copyright (c) 2017 The Linux Foundation and others.
361 #
362 # All rights reserved. This program and the accompanying materials
363 # are made available under the terms of the Eclipse Public License v1.0
364 # which accompanies this distribution, and is available at
365 # http://www.eclipse.org/legal/epl-v10.html
366 ##############################################################################
367 echo &quot;---&gt; lftools-install.sh&quot;
368
369 # Ensure we fail the job if any steps fail.
370 # DO NOT set -u as virtualenv's activate script has unbound variables
371 set -e -o pipefail
372
373 virtualenv --quiet &quot;/tmp/v/lftools&quot;
374 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
375 source &quot;/tmp/v/lftools/bin/activate&quot;
376 pip install --quiet --upgrade pip
377 pip install --quiet --upgrade &quot;lftools&lt;1.0.0&quot;
378
379 # pipdeptree prints out a lot of information because lftools pulls in many
380 # dependencies. Let's only print it if we want to debug.
381 # echo &quot;----&gt; Pip Dependency Tree&quot;
382 # pip install --quiet --upgrade pipdeptree
383 # pipdeptree
384
385 #!/bin/bash
386 # SPDX-License-Identifier: EPL-1.0
387 ##############################################################################
388 # Copyright (c) 2017 The Linux Foundation and others.
389 #
390 # All rights reserved. This program and the accompanying materials
391 # are made available under the terms of the Eclipse Public License v1.0
392 # which accompanies this distribution, and is available at
393 # http://www.eclipse.org/legal/epl-v10.html
394 ##############################################################################
395 echo &quot;---&gt; logs-deploy.sh&quot;
396
397 # Ensure we fail the job if any steps fail.
398 set -eu -o pipefail
399
400 set -x  # Trace commands for this script to make debugging easier.
401
402 ARCHIVE_ARTIFACTS=&quot;${ARCHIVE_ARTIFACTS:-}&quot;
403 LOGS_SERVER=&quot;${LOGS_SERVER:-None}&quot;
404
405 if [ &quot;${LOGS_SERVER}&quot; == 'None' ]
406 then
407     set +x # Disable trace since we no longer need it
408
409     echo &quot;WARNING: Logging server not set&quot;
410 else
411     NEXUS_URL=&quot;${NEXUS_URL:-$NEXUSPROXY}&quot;
412     NEXUS_PATH=&quot;${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}&quot;
413     BUILD_URL=&quot;${BUILD_URL}&quot;
414
415     lftools deploy archives -p &quot;$ARCHIVE_ARTIFACTS&quot; &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$WORKSPACE&quot;
416     lftools deploy logs &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$BUILD_URL&quot;
417
418     set +x  # Disable trace since we no longer need it.
419
420     echo &quot;Build logs: &lt;a href=\&quot;$LOGS_SERVER/$NEXUS_PATH\&quot;&gt;$LOGS_SERVER/$NEXUS_PATH&lt;/a&gt;&quot;
421 fi
422 </command>
423         </hudson.tasks.Shell>
424         <hudson.tasks.Shell>
425           <command>#!/bin/bash
426 # SPDX-License-Identifier: EPL-1.0
427 ##############################################################################
428 # Copyright (c) 2017 The Linux Foundation and others.
429 #
430 # All rights reserved. This program and the accompanying materials
431 # are made available under the terms of the Eclipse Public License v1.0
432 # which accompanies this distribution, and is available at
433 # http://www.eclipse.org/legal/epl-v10.html
434 ##############################################################################
435
436 # Clear log credential files
437 rm &quot;$SETTINGS_FILE&quot;
438 rm ~/.netrc
439 </command>
440         </hudson.tasks.Shell>
441         <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
442           <regexp>^Build logs: .*</regexp>
443         </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
444       </buildSteps>
445       <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
446       <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
447       <markBuildUnstable>false</markBuildUnstable>
448     </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
449     <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
450       <patterns>
451         <hudson.plugins.ws__cleanup.Pattern>
452           <pattern>**/*.jenkins-trigger</pattern>
453           <type>EXCLUDE</type>
454         </hudson.plugins.ws__cleanup.Pattern>
455       </patterns>
456       <deleteDirs>false</deleteDirs>
457       <cleanupMatrixParent>false</cleanupMatrixParent>
458       <externalDelete/>
459       <cleanWhenSuccess>true</cleanWhenSuccess>
460       <cleanWhenUnstable>true</cleanWhenUnstable>
461       <cleanWhenFailure>true</cleanWhenFailure>
462       <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
463       <cleanWhenAborted>true</cleanWhenAborted>
464       <notFailBuild>true</notFailBuild>
465     </hudson.plugins.ws__cleanup.WsCleanup>
466   </publishers>
467   <buildWrappers>
468     <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
469     <hudson.plugins.build__timeout.BuildTimeoutWrapper>
470       <timeoutMinutes>10</timeoutMinutes>
471       <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
472       <failBuild>true</failBuild>
473       <writingDescription>false</writingDescription>
474       <timeoutPercentage>0</timeoutPercentage>
475       <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
476       <timeoutType>absolute</timeoutType>
477     </hudson.plugins.build__timeout.BuildTimeoutWrapper>
478     <hudson.plugins.timestamper.TimestamperBuildWrapper/>
479     <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
480       <user>test-credential</user>
481     </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
482     <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
483   </buildWrappers>
484 </project>