943ab357d9d058284cd87d4769144b71d1eacd49
[releng/global-jjb.git] / .jjb-test / expected-xml / github-rtd-rtd-merge-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>false</concurrentBuild>
9   <assignedNode>build-vm</assignedNode>
10   <canRoam>false</canRoam>
11   <properties>
12     <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
13       <projectUrl>https://github.com/example-org/releng/ciman</projectUrl>
14       <displayName/>
15     </com.coravy.hudson.plugins.github.GithubProjectProperty>
16     <hudson.model.ParametersDefinitionProperty>
17       <parameterDefinitions>
18         <hudson.model.StringParameterDefinition>
19           <name>PROJECT</name>
20           <description>Parameter to identify a Gerrit project. This is typically the
21 project repo path as exists in Gerrit.
22 For example: ofextensions/circuitsw
23 </description>
24           <defaultValue>releng/ciman</defaultValue>
25         </hudson.model.StringParameterDefinition>
26         <hudson.model.StringParameterDefinition>
27           <name>STREAM</name>
28           <description>Stream is often set to the same name as 'branch' but can
29 sometimes be used as a name representing a project's release code
30 name.
31 </description>
32           <defaultValue>master</defaultValue>
33         </hudson.model.StringParameterDefinition>
34         <hudson.model.StringParameterDefinition>
35           <name>GERRIT_PROJECT</name>
36           <description>Parameter to identify Gerrit project. This is typically the
37 project repo path as exists in Gerrit.
38 For example: ofextensions/circuitsw
39
40 Note that Gerrit will override this parameter automatically if a
41 job is triggered by Gerrit.
42 </description>
43           <defaultValue>releng/ciman</defaultValue>
44         </hudson.model.StringParameterDefinition>
45         <hudson.model.StringParameterDefinition>
46           <name>GERRIT_BRANCH</name>
47           <description>Parameter to identify a Gerrit branch.
48
49 Note that Gerrit will override this parameter automatically if a
50 job is triggered by Gerrit.
51 </description>
52           <defaultValue>master</defaultValue>
53         </hudson.model.StringParameterDefinition>
54         <hudson.model.StringParameterDefinition>
55           <name>GERRIT_REFSPEC</name>
56           <description>Parameter to identify a refspec when pulling from Gerrit.
57
58 Note that Gerrit will override this parameter automatically if a
59 job is triggered by Gerrit.
60 </description>
61           <defaultValue>refs/heads/master</defaultValue>
62         </hudson.model.StringParameterDefinition>
63         <hudson.model.StringParameterDefinition>
64           <name>LFTOOLS_VERSION</name>
65           <description>Version of lftools to install. Can be a specific version like
66 '0.6.0' or a PEP-440 definition.
67 https://www.python.org/dev/peps/pep-0440/
68 For example '&lt;1.0.0' or '&gt;=1.0.0,&lt;2.0.0'.
69 </description>
70           <defaultValue>&lt;1.0.0</defaultValue>
71         </hudson.model.StringParameterDefinition>
72       </parameterDefinitions>
73     </hudson.model.ParametersDefinitionProperty>
74   </properties>
75   <scm class="hudson.scm.NullSCM"/>
76   <triggers class="vector">
77     <org.jenkinsci.plugins.ghprb.GhprbTrigger>
78       <spec/>
79       <adminlist/>
80       <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
81       <whitelist/>
82       <orgslist/>
83       <whiteListLabels/>
84       <blackListLabels/>
85       <cron/>
86       <triggerPhrase>^remerge$</triggerPhrase>
87       <skipBuildPhrase/>
88       <onlyTriggerPhrase>false</onlyTriggerPhrase>
89       <useGitHubHooks>true</useGitHubHooks>
90       <permitAll>true</permitAll>
91       <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
92       <extensions>
93         <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
94           <commitStatusContext>RTD Merge</commitStatusContext>
95         </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
96       </extensions>
97     </org.jenkinsci.plugins.ghprb.GhprbTrigger>
98     <hudson.triggers.TimerTrigger>
99       <spec>H H * * *</spec>
100     </hudson.triggers.TimerTrigger>
101   </triggers>
102   <builders>
103     <EnvInjectBuilder>
104       <info>
105         <propertiesContent>RTD_PROJECT=github-rtd</propertiesContent>
106       </info>
107     </EnvInjectBuilder>
108     <hudson.tasks.Shell>
109       <command>#!/bin/bash
110 # SPDX-License-Identifier: EPL-1.0
111 ##############################################################################
112 # Copyright (c) 2017 The Linux Foundation and others.
113 #
114 # All rights reserved. This program and the accompanying materials
115 # are made available under the terms of the Eclipse Public License v1.0
116 # which accompanies this distribution, and is available at
117 # http://www.eclipse.org/legal/epl-v10.html
118 ##############################################################################
119 echo &quot;---&gt; rtd-trigger-build.sh&quot;
120
121 if [ &quot;$GERRIT_BRANCH&quot; == &quot;master&quot; ]; then
122     RTD_BUILD_VERSION=latest
123 else
124     RTD_BUILD_VERSION=&quot;${GERRIT_BRANCH/\//-}&quot;
125 fi
126
127 curl -X POST --data &quot;version_slug=$RTD_BUILD_VERSION&quot; &quot;https://readthedocs.org/build/$RTD_PROJECT&quot;
128 </command>
129     </hudson.tasks.Shell>
130   </builders>
131   <publishers>
132     <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
133       <buildSteps>
134         <hudson.tasks.Shell>
135           <command>#!/bin/bash
136 # SPDX-License-Identifier: EPL-1.0
137 ##############################################################################
138 # Copyright (c) 2017 The Linux Foundation and others.
139 #
140 # All rights reserved. This program and the accompanying materials
141 # are made available under the terms of the Eclipse Public License v1.0
142 # which accompanies this distribution, and is available at
143 # http://www.eclipse.org/legal/epl-v10.html
144 ##############################################################################
145 echo &quot;---&gt; sysstat.sh&quot;
146 set +e  # DON'T fail build if script fails.
147
148 OS=$(facter operatingsystem)
149 case &quot;$OS&quot; in
150     Ubuntu)
151         SYSSTAT_PATH=&quot;/var/log/sysstat&quot;
152
153         # Dont run the script when systat is not enabled by default
154         if ! grep --quiet 'ENABLED=&quot;true&quot;' &quot;/etc/default/sysstat&quot;; then
155             exit 0
156         fi
157     ;;
158     CentOS|RedHat)
159         SYSSTAT_PATH=&quot;/var/log/sa&quot;
160     ;;
161     *)
162         # nothing to do
163         exit 0
164     ;;
165 esac
166
167 SAR_DIR=&quot;$WORKSPACE/archives/sar-reports&quot;
168 mkdir -p &quot;$SAR_DIR&quot;
169 cp &quot;$SYSSTAT_PATH/&quot;* &quot;$_&quot;
170 # convert sar data to ascii format
171 while IFS=&quot;&quot; read -r sarfilenum
172 do
173     [ -f &quot;$sarfilenum&quot; ] &amp;&amp; LC_TIME=POSIX sar -A -f &quot;$sarfilenum&quot; &gt; &quot;$SAR_DIR/sar${sarfilenum//[!0-9]/}&quot;
174 done &lt; &lt;(find &quot;$SYSSTAT_PATH&quot; -name &quot;sa[0-9]*&quot; || true)
175
176 # DON'T fail build if script fails.
177 exit 0
178 </command>
179         </hudson.tasks.Shell>
180         <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
181           <managedFiles>
182             <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
183               <fileId>jenkins-log-archives-settings</fileId>
184               <targetLocation/>
185               <variable>SETTINGS_FILE</variable>
186             </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
187           </managedFiles>
188         </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
189         <EnvInjectBuilder>
190           <info>
191             <propertiesContent>SERVER_ID=logs</propertiesContent>
192           </info>
193         </EnvInjectBuilder>
194         <hudson.tasks.Shell>
195           <command>#!/bin/bash
196 # SPDX-License-Identifier: EPL-1.0
197 ##############################################################################
198 # Copyright (c) 2017 The Linux Foundation and others.
199 #
200 # All rights reserved. This program and the accompanying materials
201 # are made available under the terms of the Eclipse Public License v1.0
202 # which accompanies this distribution, and is available at
203 # http://www.eclipse.org/legal/epl-v10.html
204 ##############################################################################
205 echo &quot;---&gt; create-netrc.sh&quot;
206
207 # Ensure we fail the job if any steps fail.
208 set -eu -o pipefail
209
210 NEXUS_URL=&quot;${NEXUSPROXY:-$NEXUS_URL}&quot;
211 CREDENTIAL=$(xmlstarlet sel -N &quot;x=http://maven.apache.org/SETTINGS/1.0.0&quot; \
212     -t -m &quot;/x:settings/x:servers/x:server[x:id='${SERVER_ID}']&quot; \
213     -v x:username -o &quot;:&quot; -v x:password \
214     &quot;$SETTINGS_FILE&quot;)
215
216 machine=$(echo &quot;$NEXUS_URL&quot; | awk -F/ '{print $3}')
217 user=$(echo &quot;$CREDENTIAL&quot; | cut -f1 -d:)
218 pass=$(echo &quot;$CREDENTIAL&quot; | cut -f2 -d:)
219
220 echo &quot;machine ${machine%:*} login $user password $pass&quot; &gt; ~/.netrc
221 </command>
222         </hudson.tasks.Shell>
223         <hudson.tasks.Shell>
224           <command>#!/bin/bash
225 # SPDX-License-Identifier: EPL-1.0
226 ##############################################################################
227 # Copyright (c) 2017 The Linux Foundation and others.
228 #
229 # All rights reserved. This program and the accompanying materials
230 # are made available under the terms of the Eclipse Public License v1.0
231 # which accompanies this distribution, and is available at
232 # http://www.eclipse.org/legal/epl-v10.html
233 ##############################################################################
234 echo &quot;---&gt; lftools-install.sh&quot;
235
236 # Script to install lftools via a version passed in via lf-infra-parameters
237 #
238 # Required parameters:
239 #
240 #     LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
241 #                      set to a strict version number like '1.2.3' or using
242 #                      PEP-440 definitions.
243 #
244 #                      Examples:
245 #                          &lt;1.0.0
246 #                          &gt;=1.0.0,&lt;2.0.0
247 #
248 # By default a released version of lftools should always be used.
249 # The purpose of the 2 variables below is so that lftools devs can test
250 # unreleased versions of lftools. There are 2 methods to install a dev version
251 # of lftools:
252 #
253 #     1) gerrit patch: Used to test a patch that has not yet been merged.
254 #                      To do this set something like this:
255 #                          LFTOOLS_MODE=gerrit
256 #                          LFTOOLS_REFSPEC=refs/changes/96/5296/7
257 #
258 #     2) git branch: Used to install an lftools version from a specific branch.
259 #                    To use this set the variables as follows:
260 #                          LFTOOLS_MODE=git
261 #                          LFTOOLS_REFSPEC=master
262 #
263 #     3) release : The intended use case and default setting.
264 #                  Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
265
266 LFTOOLS_MODE=release  # release | git | gerrit
267 LFTOOLS_REFSPEC=master
268
269 # Ensure we fail the job if any steps fail.
270 # DO NOT set -u as virtualenv's activate script has unbound variables
271 set -e -o pipefail
272
273 virtualenv --quiet &quot;/tmp/v/lftools&quot;
274 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
275 source &quot;/tmp/v/lftools/bin/activate&quot;
276 pip install --quiet --upgrade pip
277
278 case $LFTOOLS_MODE in
279     gerrit)
280         git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
281         pushd /tmp/lftools
282         git fetch origin &quot;$LFTOOLS_REFSPEC&quot;
283         git checkout FETCH_HEAD
284         pip install --quiet --upgrade -r requirements.txt
285         pip install --quiet --upgrade -e .
286         popd
287         ;;
288
289     git)
290         pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@&quot;$BRANCH&quot;
291         ;;
292
293     release)
294         if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
295             LFTOOLS_VERSION=&quot;==$LFTOOLS_VERSION&quot;
296         fi
297
298         pip install --quiet --upgrade &quot;lftools${LFTOOLS_VERSION}&quot;
299         ;;
300 esac
301
302 lftools --version
303
304 # pipdeptree prints out a lot of information because lftools pulls in many
305 # dependencies. Let's only print it if we want to debug.
306 # echo &quot;----&gt; Pip Dependency Tree&quot;
307 # pip install --quiet --upgrade pipdeptree
308 # pipdeptree
309
310 #!/bin/bash
311 # SPDX-License-Identifier: EPL-1.0
312 ##############################################################################
313 # Copyright (c) 2017 The Linux Foundation and others.
314 #
315 # All rights reserved. This program and the accompanying materials
316 # are made available under the terms of the Eclipse Public License v1.0
317 # which accompanies this distribution, and is available at
318 # http://www.eclipse.org/legal/epl-v10.html
319 ##############################################################################
320 echo &quot;---&gt; logs-deploy.sh&quot;
321
322 # Ensure we fail the job if any steps fail.
323 set -eu -o pipefail
324
325 set -x  # Trace commands for this script to make debugging easier.
326
327 ARCHIVE_ARTIFACTS=&quot;${ARCHIVE_ARTIFACTS:-}&quot;
328 LOGS_SERVER=&quot;${LOGS_SERVER:-None}&quot;
329
330 if [ &quot;${LOGS_SERVER}&quot; == 'None' ]
331 then
332     set +x # Disable trace since we no longer need it
333
334     echo &quot;WARNING: Logging server not set&quot;
335 else
336     NEXUS_URL=&quot;${NEXUSPROXY:-$NEXUS_URL}&quot;
337     NEXUS_PATH=&quot;${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}&quot;
338     BUILD_URL=&quot;${BUILD_URL}&quot;
339
340     lftools deploy archives -p &quot;$ARCHIVE_ARTIFACTS&quot; &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$WORKSPACE&quot;
341     lftools deploy logs &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$BUILD_URL&quot;
342
343     set +x  # Disable trace since we no longer need it.
344
345     echo &quot;Build logs: &lt;a href=\&quot;$LOGS_SERVER/$NEXUS_PATH\&quot;&gt;$LOGS_SERVER/$NEXUS_PATH&lt;/a&gt;&quot;
346 fi
347 </command>
348         </hudson.tasks.Shell>
349         <hudson.tasks.Shell>
350           <command>#!/bin/bash
351 # SPDX-License-Identifier: EPL-1.0
352 ##############################################################################
353 # Copyright (c) 2017 The Linux Foundation and others.
354 #
355 # All rights reserved. This program and the accompanying materials
356 # are made available under the terms of the Eclipse Public License v1.0
357 # which accompanies this distribution, and is available at
358 # http://www.eclipse.org/legal/epl-v10.html
359 ##############################################################################
360
361 # Clear log credential files
362 rm &quot;$SETTINGS_FILE&quot;
363 rm ~/.netrc
364 </command>
365         </hudson.tasks.Shell>
366         <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
367           <regexp>^Build logs: .*</regexp>
368         </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
369       </buildSteps>
370       <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
371       <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
372       <markBuildUnstable>false</markBuildUnstable>
373     </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
374     <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
375       <patterns>
376         <hudson.plugins.ws__cleanup.Pattern>
377           <pattern>**/*.jenkins-trigger</pattern>
378           <type>EXCLUDE</type>
379         </hudson.plugins.ws__cleanup.Pattern>
380       </patterns>
381       <deleteDirs>false</deleteDirs>
382       <cleanupMatrixParent>false</cleanupMatrixParent>
383       <externalDelete/>
384       <cleanWhenSuccess>true</cleanWhenSuccess>
385       <cleanWhenUnstable>true</cleanWhenUnstable>
386       <cleanWhenFailure>true</cleanWhenFailure>
387       <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
388       <cleanWhenAborted>true</cleanWhenAborted>
389       <notFailBuild>true</notFailBuild>
390     </hudson.plugins.ws__cleanup.WsCleanup>
391   </publishers>
392   <buildWrappers>
393     <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
394     <hudson.plugins.build__timeout.BuildTimeoutWrapper>
395       <timeoutMinutes>15</timeoutMinutes>
396       <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
397       <failBuild>true</failBuild>
398       <writingDescription>false</writingDescription>
399       <timeoutPercentage>0</timeoutPercentage>
400       <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
401       <timeoutType>absolute</timeoutType>
402     </hudson.plugins.build__timeout.BuildTimeoutWrapper>
403     <hudson.plugins.timestamper.TimestamperBuildWrapper/>
404     <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
405       <user>test-credential</user>
406     </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
407     <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
408     <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
409       <managedFiles>
410         <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
411           <fileId>npmrc</fileId>
412           <targetLocation>$HOME/.npmrc</targetLocation>
413           <variable/>
414         </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
415       </managedFiles>
416     </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
417   </buildWrappers>
418 </project>