Generalize odl rtd jobs for global-jjb
[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>**</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 tox argparse
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 tox -edocs
195
196 echo &quot;---&gt; Archiving generated docs&quot;
197 mkdir -p &quot;$WORKSPACE/archives&quot;
198 mv &quot;$DOC_DIR&quot; archives/
199 </command>
200     </hudson.tasks.Shell>
201   </builders>
202   <publishers>
203     <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
204       <buildSteps>
205         <hudson.tasks.Shell>
206           <command>#!/bin/bash
207 # SPDX-License-Identifier: EPL-1.0
208 ##############################################################################
209 # Copyright (c) 2017 The Linux Foundation and others.
210 #
211 # All rights reserved. This program and the accompanying materials
212 # are made available under the terms of the Eclipse Public License v1.0
213 # which accompanies this distribution, and is available at
214 # http://www.eclipse.org/legal/epl-v10.html
215 ##############################################################################
216 echo &quot;---&gt; sysstat.sh&quot;
217 set +e  # DON'T fail build if script fails.
218
219 OS=$(facter operatingsystem)
220 case &quot;$OS&quot; in
221     Ubuntu)
222         SYSSTAT_PATH=&quot;/var/log/sysstat&quot;
223
224         # Dont run the script when systat is not enabled by default
225         if ! grep --quiet 'ENABLED=&quot;true&quot;' &quot;/etc/default/sysstat&quot;; then
226             exit 0
227         fi
228     ;;
229     CentOS|RedHat)
230         SYSSTAT_PATH=&quot;/var/log/sa&quot;
231     ;;
232     *)
233         # nothing to do
234         exit 0
235     ;;
236 esac
237
238 SAR_DIR=&quot;$WORKSPACE/archives/sar-reports&quot;
239 mkdir -p &quot;$SAR_DIR&quot;
240 cp &quot;$SYSSTAT_PATH/&quot;* &quot;$_&quot;
241 # convert sar data to ascii format
242 while IFS=&quot;&quot; read -r s
243 do
244     [ -f &quot;$s&quot; ] &amp;&amp; LC_TIME=POSIX sar -A -f &quot;$s&quot; &gt; &quot;$SAR_DIR/sar${s//[!0-9]/}&quot;
245 done &lt; &lt;(find &quot;$SYSSTAT_PATH&quot; -name &quot;sa[0-9]*&quot; || true)
246
247 # DON'T fail build if script fails.
248 exit 0
249 </command>
250         </hudson.tasks.Shell>
251         <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
252           <managedFiles>
253             <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
254               <fileId>jenkins-log-archives-settings</fileId>
255               <targetLocation/>
256               <variable>SETTINGS_FILE</variable>
257             </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
258           </managedFiles>
259         </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
260         <EnvInjectBuilder>
261           <info>
262             <propertiesContent>SERVER_ID=logs</propertiesContent>
263           </info>
264         </EnvInjectBuilder>
265         <hudson.tasks.Shell>
266           <command>#!/bin/bash
267 # SPDX-License-Identifier: EPL-1.0
268 ##############################################################################
269 # Copyright (c) 2017 The Linux Foundation and others.
270 #
271 # All rights reserved. This program and the accompanying materials
272 # are made available under the terms of the Eclipse Public License v1.0
273 # which accompanies this distribution, and is available at
274 # http://www.eclipse.org/legal/epl-v10.html
275 ##############################################################################
276 echo &quot;---&gt; create-netrc.sh&quot;
277
278 # Ensure we fail the job if any steps fail.
279 set -eu -o pipefail
280
281 NEXUS_URL=&quot;${NEXUS_URL:-$NEXUSPROXY}&quot;
282 CREDENTIAL=$(xmlstarlet sel -N &quot;x=http://maven.apache.org/SETTINGS/1.0.0&quot; \
283     -t -m &quot;/x:settings/x:servers/x:server[x:id='${SERVER_ID}']&quot; \
284     -v x:username -o &quot;:&quot; -v x:password \
285     &quot;$SETTINGS_FILE&quot;)
286
287 machine=$(echo &quot;$NEXUS_URL&quot; | awk -F/ '{print $3}')
288 user=$(echo &quot;$CREDENTIAL&quot; | cut -f1 -d:)
289 pass=$(echo &quot;$CREDENTIAL&quot; | cut -f2 -d:)
290
291 echo &quot;machine $machine login $user password $pass&quot; &gt; ~/.netrc
292 </command>
293         </hudson.tasks.Shell>
294         <hudson.tasks.Shell>
295           <command>#!/bin/bash
296 # SPDX-License-Identifier: EPL-1.0
297 ##############################################################################
298 # Copyright (c) 2017 The Linux Foundation and others.
299 #
300 # All rights reserved. This program and the accompanying materials
301 # are made available under the terms of the Eclipse Public License v1.0
302 # which accompanies this distribution, and is available at
303 # http://www.eclipse.org/legal/epl-v10.html
304 ##############################################################################
305 echo &quot;---&gt; lftools-install.sh&quot;
306
307 # Script to install lftools via a version passed in via lf-infra-parameters
308 #
309 # Required parameters:
310 #
311 #     LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
312 #                      set to a strict version number like '1.2.3' or using
313 #                      PEP-440 definitions.
314 #
315 #                      Examples:
316 #                          &lt;1.0.0
317 #                          &gt;=1.0.0,&lt;2.0.0
318 #
319 # By default a released version of lftools should always be used.
320 # The purpose of the 2 variables below is so that lftools devs can test
321 # unreleased versions of lftools. There are 2 methods to install a dev version
322 # of lftools:
323 #
324 #     1) gerrit patch: Used to test a patch that has not yet been merged.
325 #                      To do this set something like this:
326 #                          LFTOOLS_MODE=gerrit
327 #                          LFTOOLS_REFSPEC=refs/changes/96/5296/7
328 #
329 #     2) git branch: Used to install an lftools version from a specific branch.
330 #                    To use this set the variables as follows:
331 #                          LFTOOLS_MODE=git
332 #                          LFTOOLS_REFSPEC=master
333 #
334 #     3) release : The intended use case and default setting.
335 #                  Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
336
337 LFTOOLS_MODE=release  # release | git | gerrit
338 LFTOOLS_REFSPEC=master
339
340 # Ensure we fail the job if any steps fail.
341 # DO NOT set -u as virtualenv's activate script has unbound variables
342 set -e -o pipefail
343
344 virtualenv --quiet &quot;/tmp/v/lftools&quot;
345 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
346 source &quot;/tmp/v/lftools/bin/activate&quot;
347 pip install --quiet --upgrade pip
348
349 case $LFTOOLS_MODE in
350     gerrit)
351         git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
352         pushd /tmp/lftools
353         git fetch origin &quot;$LFTOOLS_REFSPEC&quot;
354         git checkout FETCH_HEAD
355         pip install --quiet --upgrade -r requirements.txt
356         pip install --quiet --upgrade -e .
357         popd
358         ;;
359
360     git)
361         pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@&quot;$BRANCH&quot;
362         ;;
363
364     release)
365         if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
366             LFTOOLS_VERSION=&quot;==$LFTOOLS_VERSION&quot;
367         fi
368
369         pip install --quiet --upgrade &quot;lftools${LFTOOLS_VERSION}&quot;
370         ;;
371 esac
372
373 lftools --version
374
375 # pipdeptree prints out a lot of information because lftools pulls in many
376 # dependencies. Let's only print it if we want to debug.
377 # echo &quot;----&gt; Pip Dependency Tree&quot;
378 # pip install --quiet --upgrade pipdeptree
379 # pipdeptree
380
381 #!/bin/bash
382 # SPDX-License-Identifier: EPL-1.0
383 ##############################################################################
384 # Copyright (c) 2017 The Linux Foundation and others.
385 #
386 # All rights reserved. This program and the accompanying materials
387 # are made available under the terms of the Eclipse Public License v1.0
388 # which accompanies this distribution, and is available at
389 # http://www.eclipse.org/legal/epl-v10.html
390 ##############################################################################
391 echo &quot;---&gt; logs-deploy.sh&quot;
392
393 # Ensure we fail the job if any steps fail.
394 set -eu -o pipefail
395
396 set -x  # Trace commands for this script to make debugging easier.
397
398 ARCHIVE_ARTIFACTS=&quot;${ARCHIVE_ARTIFACTS:-}&quot;
399 LOGS_SERVER=&quot;${LOGS_SERVER:-None}&quot;
400
401 if [ &quot;${LOGS_SERVER}&quot; == 'None' ]
402 then
403     set +x # Disable trace since we no longer need it
404
405     echo &quot;WARNING: Logging server not set&quot;
406 else
407     NEXUS_URL=&quot;${NEXUS_URL:-$NEXUSPROXY}&quot;
408     NEXUS_PATH=&quot;${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}&quot;
409     BUILD_URL=&quot;${BUILD_URL}&quot;
410
411     lftools deploy archives -p &quot;$ARCHIVE_ARTIFACTS&quot; &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$WORKSPACE&quot;
412     lftools deploy logs &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$BUILD_URL&quot;
413
414     set +x  # Disable trace since we no longer need it.
415
416     echo &quot;Build logs: &lt;a href=\&quot;$LOGS_SERVER/$NEXUS_PATH\&quot;&gt;$LOGS_SERVER/$NEXUS_PATH&lt;/a&gt;&quot;
417 fi
418 </command>
419         </hudson.tasks.Shell>
420         <hudson.tasks.Shell>
421           <command>#!/bin/bash
422 # SPDX-License-Identifier: EPL-1.0
423 ##############################################################################
424 # Copyright (c) 2017 The Linux Foundation and others.
425 #
426 # All rights reserved. This program and the accompanying materials
427 # are made available under the terms of the Eclipse Public License v1.0
428 # which accompanies this distribution, and is available at
429 # http://www.eclipse.org/legal/epl-v10.html
430 ##############################################################################
431
432 # Clear log credential files
433 rm &quot;$SETTINGS_FILE&quot;
434 rm ~/.netrc
435 </command>
436         </hudson.tasks.Shell>
437         <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
438           <regexp>^Build logs: .*</regexp>
439         </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
440       </buildSteps>
441       <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
442       <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
443       <markBuildUnstable>false</markBuildUnstable>
444     </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
445     <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
446       <patterns>
447         <hudson.plugins.ws__cleanup.Pattern>
448           <pattern>**/*.jenkins-trigger</pattern>
449           <type>EXCLUDE</type>
450         </hudson.plugins.ws__cleanup.Pattern>
451       </patterns>
452       <deleteDirs>false</deleteDirs>
453       <cleanupMatrixParent>false</cleanupMatrixParent>
454       <externalDelete/>
455       <cleanWhenSuccess>true</cleanWhenSuccess>
456       <cleanWhenUnstable>true</cleanWhenUnstable>
457       <cleanWhenFailure>true</cleanWhenFailure>
458       <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
459       <cleanWhenAborted>true</cleanWhenAborted>
460       <notFailBuild>true</notFailBuild>
461     </hudson.plugins.ws__cleanup.WsCleanup>
462   </publishers>
463   <buildWrappers>
464     <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
465     <hudson.plugins.build__timeout.BuildTimeoutWrapper>
466       <timeoutMinutes>15</timeoutMinutes>
467       <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
468       <failBuild>true</failBuild>
469       <writingDescription>false</writingDescription>
470       <timeoutPercentage>0</timeoutPercentage>
471       <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
472       <timeoutType>absolute</timeoutType>
473     </hudson.plugins.build__timeout.BuildTimeoutWrapper>
474     <hudson.plugins.timestamper.TimestamperBuildWrapper/>
475     <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
476       <user>test-credential</user>
477     </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
478     <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
479   </buildWrappers>
480 </project>