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