Fix default platform location to common-packer
[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 plugin="github">
13       <projectUrl>$GIT_URL/$GERRIT_PROJECT/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         <hudson.model.StringParameterDefinition>
73           <name>NODE_DIR</name>
74           <description>Path to a Node project directory.</description>
75           <defaultValue/>
76         </hudson.model.StringParameterDefinition>
77         <hudson.model.StringParameterDefinition>
78           <name>NODE_VERSION</name>
79           <description>Version of NodeJS to install.</description>
80           <defaultValue>6.11.4</defaultValue>
81         </hudson.model.StringParameterDefinition>
82       </parameterDefinitions>
83     </hudson.model.ParametersDefinitionProperty>
84   </properties>
85   <scm class="hudson.plugins.git.GitSCM">
86     <configVersion>2</configVersion>
87     <userRemoteConfigs>
88       <hudson.plugins.git.UserRemoteConfig>
89         <name>origin</name>
90         <refspec>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
91         <url>git@github.com:example-org/releng/ciman</url>
92         <credentialsId>test-credential</credentialsId>
93       </hudson.plugins.git.UserRemoteConfig>
94     </userRemoteConfigs>
95     <branches>
96       <hudson.plugins.git.BranchSpec>
97         <name>$sha1</name>
98       </hudson.plugins.git.BranchSpec>
99     </branches>
100     <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
101     <remotePoll>false</remotePoll>
102     <gitTool>Default</gitTool>
103     <submoduleCfg class="list"/>
104     <reference/>
105     <gitConfigName/>
106     <gitConfigEmail/>
107     <extensions>
108       <hudson.plugins.git.extensions.impl.BuildChooserSetting>
109         <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
110       </hudson.plugins.git.extensions.impl.BuildChooserSetting>
111       <hudson.plugins.git.extensions.impl.SubmoduleOption>
112         <disableSubmodules>false</disableSubmodules>
113         <recursiveSubmodules>true</recursiveSubmodules>
114         <trackingSubmodules>false</trackingSubmodules>
115         <parentCredentials>false</parentCredentials>
116         <reference/>
117         <timeout>10</timeout>
118       </hudson.plugins.git.extensions.impl.SubmoduleOption>
119       <hudson.plugins.git.extensions.impl.WipeWorkspace/>
120     </extensions>
121   </scm>
122   <triggers class="vector">
123     <org.jenkinsci.plugins.ghprb.GhprbTrigger>
124       <spec/>
125       <adminlist/>
126       <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
127       <whitelist/>
128       <orgslist/>
129       <whiteListLabels/>
130       <blackListLabels/>
131       <cron/>
132       <triggerPhrase>^recheck$</triggerPhrase>
133       <skipBuildPhrase/>
134       <onlyTriggerPhrase>false</onlyTriggerPhrase>
135       <useGitHubHooks>true</useGitHubHooks>
136       <permitAll>true</permitAll>
137       <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
138       <extensions>
139         <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
140           <commitStatusContext>Node Verify</commitStatusContext>
141         </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
142       </extensions>
143     </org.jenkinsci.plugins.ghprb.GhprbTrigger>
144   </triggers>
145   <builders>
146     <hudson.tasks.Shell>
147       <command>#!/bin/bash
148 # SPDX-License-Identifier: EPL-1.0
149 ##############################################################################
150 # Copyright (c) 2017 The Linux Foundation and others.
151 #
152 # All rights reserved. This program and the accompanying materials
153 # are made available under the terms of the Eclipse Public License v1.0
154 # which accompanies this distribution, and is available at
155 # http://www.eclipse.org/legal/epl-v10.html
156 ##############################################################################
157 echo &quot;---&gt; node-install.sh&quot;
158
159 # Ensure we fail the job if any steps fail.
160 # DO NOT set -u as virtualenv's activate script has unbound variables
161 set -e -o pipefail
162
163 virtualenv --quiet &quot;/tmp/v/python&quot;
164 # shellcheck source=/tmp/v/node/bin/activate disable=SC1091
165 source &quot;/tmp/v/python/bin/activate&quot;
166 pip install --quiet --upgrade pip
167 pip install --quiet --upgrade pipdeptree
168 pip install --quiet --upgrade nodeenv
169
170 echo &quot;----&gt; Pip Dependency Tree&quot;
171 pipdeptree
172
173 #!/bin/bash
174 # SPDX-License-Identifier: EPL-1.0
175 ##############################################################################
176 # Copyright (c) 2017 The Linux Foundation and others.
177 #
178 # All rights reserved. This program and the accompanying materials
179 # are made available under the terms of the Eclipse Public License v1.0
180 # which accompanies this distribution, and is available at
181 # http://www.eclipse.org/legal/epl-v10.html
182 ##############################################################################
183 echo &quot;---&gt; node-run.sh&quot;
184
185 # Ensure we fail the job if any steps fail.
186 # DO NOT set -u as virtualenv's activate script has unbound variables
187 set -e -o pipefail
188
189 # Prepare node
190 nodeenv --node=&quot;$NODE_VERSION&quot; --prebuilt &quot;/tmp/v/node&quot;
191 source /tmp/v/node/bin/activate
192 cd &quot;$WORKSPACE/$NODE_DIR&quot;
193 npm install
194 npm test
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 sarfilenum
239 do
240     [ -f &quot;$sarfilenum&quot; ] &amp;&amp; LC_TIME=POSIX sar -A -f &quot;$sarfilenum&quot; &gt; &quot;$SAR_DIR/sar${sarfilenum//[!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;${NEXUSPROXY:-$NEXUS_URL}&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 # Script to install lftools via a version passed in via lf-infra-parameters
304 #
305 # Required parameters:
306 #
307 #     LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
308 #                      set to a strict version number like '1.2.3' or using
309 #                      PEP-440 definitions.
310 #
311 #                      Examples:
312 #                          &lt;1.0.0
313 #                          &gt;=1.0.0,&lt;2.0.0
314 #
315 # By default a released version of lftools should always be used.
316 # The purpose of the 2 variables below is so that lftools devs can test
317 # unreleased versions of lftools. There are 2 methods to install a dev version
318 # of lftools:
319 #
320 #     1) gerrit patch: Used to test a patch that has not yet been merged.
321 #                      To do this set something like this:
322 #                          LFTOOLS_MODE=gerrit
323 #                          LFTOOLS_REFSPEC=refs/changes/96/5296/7
324 #
325 #     2) git branch: Used to install an lftools version from a specific branch.
326 #                    To use this set the variables as follows:
327 #                          LFTOOLS_MODE=git
328 #                          LFTOOLS_REFSPEC=master
329 #
330 #     3) release : The intended use case and default setting.
331 #                  Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
332
333 LFTOOLS_MODE=release  # release | git | gerrit
334 LFTOOLS_REFSPEC=master
335
336 # Ensure we fail the job if any steps fail.
337 # DO NOT set -u as virtualenv's activate script has unbound variables
338 set -e -o pipefail
339
340 virtualenv --quiet &quot;/tmp/v/lftools&quot;
341 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
342 source &quot;/tmp/v/lftools/bin/activate&quot;
343 pip install --quiet --upgrade pip
344
345 case $LFTOOLS_MODE in
346     gerrit)
347         git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
348         pushd /tmp/lftools
349         git fetch origin &quot;$LFTOOLS_REFSPEC&quot;
350         git checkout FETCH_HEAD
351         pip install --quiet --upgrade -r requirements.txt
352         pip install --quiet --upgrade -e .
353         popd
354         ;;
355
356     git)
357         pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@&quot;$BRANCH&quot;
358         ;;
359
360     release)
361         if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
362             LFTOOLS_VERSION=&quot;==$LFTOOLS_VERSION&quot;
363         fi
364
365         pip install --quiet --upgrade &quot;lftools${LFTOOLS_VERSION}&quot;
366         ;;
367 esac
368
369 lftools --version
370
371 # pipdeptree prints out a lot of information because lftools pulls in many
372 # dependencies. Let's only print it if we want to debug.
373 # echo &quot;----&gt; Pip Dependency Tree&quot;
374 # pip install --quiet --upgrade pipdeptree
375 # pipdeptree
376
377 #!/bin/bash
378 # SPDX-License-Identifier: EPL-1.0
379 ##############################################################################
380 # Copyright (c) 2017 The Linux Foundation and others.
381 #
382 # All rights reserved. This program and the accompanying materials
383 # are made available under the terms of the Eclipse Public License v1.0
384 # which accompanies this distribution, and is available at
385 # http://www.eclipse.org/legal/epl-v10.html
386 ##############################################################################
387 echo &quot;---&gt; logs-deploy.sh&quot;
388
389 # Ensure we fail the job if any steps fail.
390 set -eu -o pipefail
391
392 set -x  # Trace commands for this script to make debugging easier.
393
394 ARCHIVE_ARTIFACTS=&quot;${ARCHIVE_ARTIFACTS:-}&quot;
395 LOGS_SERVER=&quot;${LOGS_SERVER:-None}&quot;
396
397 if [ &quot;${LOGS_SERVER}&quot; == 'None' ]
398 then
399     set +x # Disable trace since we no longer need it
400
401     echo &quot;WARNING: Logging server not set&quot;
402 else
403     NEXUS_URL=&quot;${NEXUSPROXY:-$NEXUS_URL}&quot;
404     NEXUS_PATH=&quot;${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}&quot;
405     BUILD_URL=&quot;${BUILD_URL}&quot;
406
407     lftools deploy archives -p &quot;$ARCHIVE_ARTIFACTS&quot; &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$WORKSPACE&quot;
408     lftools deploy logs &quot;$NEXUS_URL&quot; &quot;$NEXUS_PATH&quot; &quot;$BUILD_URL&quot;
409
410     set +x  # Disable trace since we no longer need it.
411
412     echo &quot;Build logs: &lt;a href=\&quot;$LOGS_SERVER/$NEXUS_PATH\&quot;&gt;$LOGS_SERVER/$NEXUS_PATH&lt;/a&gt;&quot;
413 fi
414 </command>
415         </hudson.tasks.Shell>
416         <hudson.tasks.Shell>
417           <command>#!/bin/bash
418 # SPDX-License-Identifier: EPL-1.0
419 ##############################################################################
420 # Copyright (c) 2017 The Linux Foundation and others.
421 #
422 # All rights reserved. This program and the accompanying materials
423 # are made available under the terms of the Eclipse Public License v1.0
424 # which accompanies this distribution, and is available at
425 # http://www.eclipse.org/legal/epl-v10.html
426 ##############################################################################
427
428 # Clear log credential files
429 rm &quot;$SETTINGS_FILE&quot;
430 rm ~/.netrc
431 </command>
432         </hudson.tasks.Shell>
433         <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
434           <regexp>^Build logs: .*</regexp>
435         </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
436       </buildSteps>
437       <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
438       <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
439       <markBuildUnstable>false</markBuildUnstable>
440     </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
441     <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
442       <patterns>
443         <hudson.plugins.ws__cleanup.Pattern>
444           <pattern>**/*.jenkins-trigger</pattern>
445           <type>EXCLUDE</type>
446         </hudson.plugins.ws__cleanup.Pattern>
447       </patterns>
448       <deleteDirs>false</deleteDirs>
449       <cleanupMatrixParent>false</cleanupMatrixParent>
450       <externalDelete/>
451       <cleanWhenSuccess>true</cleanWhenSuccess>
452       <cleanWhenUnstable>true</cleanWhenUnstable>
453       <cleanWhenFailure>true</cleanWhenFailure>
454       <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
455       <cleanWhenAborted>true</cleanWhenAborted>
456       <notFailBuild>true</notFailBuild>
457     </hudson.plugins.ws__cleanup.WsCleanup>
458   </publishers>
459   <buildWrappers>
460     <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
461     <hudson.plugins.build__timeout.BuildTimeoutWrapper>
462       <timeoutMinutes>10</timeoutMinutes>
463       <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
464       <failBuild>true</failBuild>
465       <writingDescription>false</writingDescription>
466       <timeoutPercentage>0</timeoutPercentage>
467       <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
468       <timeoutType>absolute</timeoutType>
469     </hudson.plugins.build__timeout.BuildTimeoutWrapper>
470     <hudson.plugins.timestamper.TimestamperBuildWrapper/>
471     <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
472       <user>test-credential</user>
473     </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
474     <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
475     <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
476       <managedFiles>
477         <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
478           <fileId>npmrc</fileId>
479           <targetLocation>$HOME/.npmrc</targetLocation>
480           <variable/>
481         </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
482       </managedFiles>
483     </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
484   </buildWrappers>
485 </project>