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