Refactor tests into jjb-tests directory
[releng/global-jjb.git] / jjb-test / expected-xml / github-ciman-jjb-merge
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>false</concurrentBuild>
9   <assignedNode>build-vm</assignedNode>
10   <canRoam>false</canRoam>
11   <properties>
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>
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>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>
69   </properties>
70   <scm class="hudson.plugins.git.GitSCM">
71     <configVersion>2</configVersion>
72     <userRemoteConfigs>
73       <hudson.plugins.git.UserRemoteConfig>
74         <name>origin</name>
75         <refspec/>
76         <url>git@github.com:example-org/releng/ciman</url>
77         <credentialsId>test-credential</credentialsId>
78       </hudson.plugins.git.UserRemoteConfig>
79     </userRemoteConfigs>
80     <branches>
81       <hudson.plugins.git.BranchSpec>
82         <name>**</name>
83       </hudson.plugins.git.BranchSpec>
84     </branches>
85     <excludedUsers/>
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"/>
94     <relativeTargetDir/>
95     <reference/>
96     <gitConfigName/>
97     <gitConfigEmail/>
98     <skipTag>true</skipTag>
99     <scmName/>
100     <useShallowClone>false</useShallowClone>
101     <ignoreNotifyCommit>false</ignoreNotifyCommit>
102     <extensions>
103       <hudson.plugins.git.extensions.impl.SubmoduleOption>
104         <disableSubmodules>false</disableSubmodules>
105         <recursiveSubmodules>true</recursiveSubmodules>
106         <trackingSubmodules>false</trackingSubmodules>
107         <reference/>
108         <timeout>10</timeout>
109       </hudson.plugins.git.extensions.impl.SubmoduleOption>
110       <hudson.plugins.git.extensions.impl.WipeWorkspace/>
111     </extensions>
112   </scm>
113   <triggers class="vector">
114     <com.cloudbees.jenkins.GitHubPushTrigger>
115       <spec/>
116     </com.cloudbees.jenkins.GitHubPushTrigger>
117     <hudson.triggers.SCMTrigger>
118       <spec/>
119       <ignorePostCommitHooks>false</ignorePostCommitHooks>
120     </hudson.triggers.SCMTrigger>
121     <org.jenkinsci.plugins.ghprb.GhprbTrigger>
122       <spec/>
123       <adminlist>tykeal</adminlist>
124       <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
125       <whitelist>jpwku
126 tykeal
127 zxiiro</whitelist>
128       <orgslist>example-org</orgslist>
129       <cron/>
130       <triggerPhrase>^remerge$</triggerPhrase>
131       <onlyTriggerPhrase>true</onlyTriggerPhrase>
132       <useGitHubHooks>true</useGitHubHooks>
133       <permitAll>false</permitAll>
134       <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
135       <extensions>
136         <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
137           <commitStatusContext>JJB Merge</commitStatusContext>
138         </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
139       </extensions>
140     </org.jenkinsci.plugins.ghprb.GhprbTrigger>
141   </triggers>
142   <builders>
143     <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
144       <managedFiles>
145         <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
146           <fileId>jjbini</fileId>
147           <targetLocation>$HOME/.config/jenkins_jobs/jenkins_jobs.ini</targetLocation>
148           <variable/>
149         </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
150       </managedFiles>
151     </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
152     <hudson.tasks.Shell>
153       <command>#!/bin/bash
154 # SPDX-License-Identifier: EPL-1.0
155 ##############################################################################
156 # Copyright (c) 2017 The Linux Foundation and others.
157 #
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 &quot;---&gt; jjb-install.sh&quot;
164
165 # Ensure we fail the job if any steps fail.
166 # DO NOT set -u as virtualenv's activate script has unbound variables
167 set -e -o pipefail
168
169 virtualenv &quot;/tmp/v/jjb&quot;
170 # shellcheck source=/tmp/v/jjb/bin/activate disable=SC1091
171 source &quot;/tmp/v/jjb/bin/activate&quot;
172 pip install --quiet --upgrade pip
173 pip install --quiet --upgrade pipdeptree
174 pip install --quiet --upgrade &quot;jenkins-job-builder==$JJB_VERSION&quot;
175
176 echo &quot;----&gt; Pip Dependency Tree&quot;
177 pipdeptree
178
179 #!/bin/bash
180 # SPDX-License-Identifier: EPL-1.0
181 ##############################################################################
182 # Copyright (c) 2017 The Linux Foundation and others.
183 #
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 &quot;---&gt; jjb-merge-job.sh&quot;
190
191 # Ensure we fail the job if any steps fail.
192 set -eu -o pipefail
193
194 jenkins-jobs update --recursive --delete-old --workers 4 --exclude jjb-test jjb
195 </command>
196     </hudson.tasks.Shell>
197   </builders>
198   <publishers>
199     <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
200       <buildSteps>
201         <hudson.tasks.Shell>
202           <command>#!/bin/bash
203 # SPDX-License-Identifier: EPL-1.0
204 ##############################################################################
205 # Copyright (c) 2017 The Linux Foundation and others.
206 #
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 &quot;---&gt; sysstat.sh&quot;
213 set +e  # DON'T fail build if script fails.
214
215 OS=$(facter operatingsystem)
216 case &quot;$OS&quot; in
217     Ubuntu)
218         SYSSTAT_PATH=&quot;/var/log/sysstat&quot;
219
220         # Dont run the script when systat is not enabled by default
221         if ! grep --quiet 'ENABLED=&quot;true&quot;' &quot;/etc/default/sysstat&quot;; then
222             exit 0
223         fi
224     ;;
225     CentOS|RedHat)
226         SYSSTAT_PATH=&quot;/var/log/sa&quot;
227     ;;
228     *)
229         # nothing to do
230         exit 0
231     ;;
232 esac
233
234 SAR_DIR=&quot;$WORKSPACE/archives/sar-reports&quot;
235 mkdir -p &quot;$SAR_DIR&quot;
236 cp &quot;$SYSSTAT_PATH/&quot;* &quot;$_&quot;
237 # convert sar data to ascii format
238 while IFS=&quot;&quot; read -r s
239 do
240     [ -f &quot;$s&quot; ] &amp;&amp; LC_TIME=POSIX sar -A -f &quot;$s&quot; &gt; &quot;$SAR_DIR/sar${s//[!0-9]/}&quot;
241 done &lt; &lt;(find &quot;$SYSSTAT_PATH&quot; -name &quot;sa[0-9]*&quot; || true)
242
243 # DON'T fail build if script fails.
244 exit 0
245 </command>
246         </hudson.tasks.Shell>
247         <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
248           <managedFiles>
249             <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
250               <fileId>jenkins-log-archives-settings</fileId>
251               <targetLocation/>
252               <variable>SETTINGS_FILE</variable>
253             </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
254           </managedFiles>
255         </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
256         <EnvInjectBuilder>
257           <info>
258             <propertiesContent>SERVER_ID=logs</propertiesContent>
259           </info>
260         </EnvInjectBuilder>
261         <hudson.tasks.Shell>
262           <command>#!/bin/bash
263 # SPDX-License-Identifier: EPL-1.0
264 ##############################################################################
265 # Copyright (c) 2017 The Linux Foundation and others.
266 #
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 &quot;---&gt; create-netrc.sh&quot;
273
274 # Ensure we fail the job if any steps fail.
275 set -eu -o pipefail
276
277 NEXUS_URL=&quot;${NEXUS_URL:-$NEXUSPROXY}&quot;
278 CREDENTIAL=$(xmlstarlet sel -N &quot;x=http://maven.apache.org/SETTINGS/1.0.0&quot; \
279     -t -m &quot;/x:settings/x:servers/x:server[x:id='${SERVER_ID}']&quot; \
280     -v x:username -o &quot;:&quot; -v x:password \
281     &quot;$SETTINGS_FILE&quot;)
282
283 machine=$(echo &quot;$NEXUS_URL&quot; | awk -F/ '{print $3}')
284 user=$(echo &quot;$CREDENTIAL&quot; | cut -f1 -d:)
285 pass=$(echo &quot;$CREDENTIAL&quot; | cut -f2 -d:)
286
287 echo &quot;machine $machine login $user password $pass&quot; &gt; ~/.netrc
288 </command>
289         </hudson.tasks.Shell>
290         <hudson.tasks.Shell>
291           <command>#!/bin/bash
292 # SPDX-License-Identifier: EPL-1.0
293 ##############################################################################
294 # Copyright (c) 2017 The Linux Foundation and others.
295 #
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 &quot;---&gt; lftools-install.sh&quot;
302
303 # Ensure we fail the job if any steps fail.
304 # DO NOT set -u as virtualenv's activate script has unbound variables
305 set -e -o pipefail
306
307 virtualenv --quiet &quot;/tmp/v/lftools&quot;
308 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
309 source &quot;/tmp/v/lftools/bin/activate&quot;
310 pip install --quiet --upgrade pip
311 pip install --quiet --upgrade &quot;lftools&lt;1.0.0&quot;
312
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 &quot;----&gt; Pip Dependency Tree&quot;
316 # pip install --quiet --upgrade pipdeptree
317 # pipdeptree
318
319 #!/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; logs-deploy.sh&quot;
330
331 # Ensure we fail the job if any steps fail.
332 set -eu -o pipefail
333
334 set -x  # Trace commands for this script to make debugging easier.
335
336 ARCHIVE_ARTIFACTS=&quot;${ARCHIVE_ARTIFACTS:-}&quot;
337 LOGS_SERVER=&quot;${LOGS_SERVER:-None}&quot;
338
339 if [ &quot;${LOGS_SERVER}&quot; == 'None' ]
340 then
341     set +x # Disable trace since we no longer need it
342
343     echo &quot;WARNING: Logging server not set&quot;
344 else
345     NEXUS_URL=&quot;${NEXUS_URL:-$NEXUSPROXY}&quot;
346     NEXUS_PATH=&quot;${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}&quot;
347     BUILD_URL=&quot;${BUILD_URL}&quot;
348
349     lftools deploy archives -p &quot;$ARCHIVE_ARTIFACTS&quot; &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$WORKSPACE&quot;
350     lftools deploy logs &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$BUILD_URL&quot;
351
352     set +x  # Disable trace since we no longer need it.
353
354     echo &quot;Build logs: &lt;a href=\&quot;$LOGS_SERVER/$NEXUS_PATH\&quot;&gt;$LOGS_SERVER/$NEXUS_PATH&lt;/a&gt;&quot;
355 fi
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
370 # Clear log credential files
371 rm &quot;$SETTINGS_FILE&quot;
372 rm ~/.netrc
373 </command>
374         </hudson.tasks.Shell>
375         <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
376           <regexp>^Build logs: .*</regexp>
377         </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
378       </buildSteps>
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">
384       <patterns>
385         <hudson.plugins.ws__cleanup.Pattern>
386           <pattern>**/*.jenkins-trigger</pattern>
387           <type>EXCLUDE</type>
388         </hudson.plugins.ws__cleanup.Pattern>
389       </patterns>
390       <deleteDirs>false</deleteDirs>
391       <cleanupMatrixParent>false</cleanupMatrixParent>
392       <externalDelete/>
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>
400   </publishers>
401   <buildWrappers>
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/>
417   </buildWrappers>
418 </project>