1 <?xml version="1.0" encoding="utf-8"?>
4 <description><!-- Managed by Jenkins Job Builder --></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>
12 <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github">
13 <projectUrl>$GIT_URL/$PROJECT/example-org/releng/ciman</projectUrl>
15 </com.coravy.hudson.plugins.github.GithubProjectProperty>
16 <hudson.model.ParametersDefinitionProperty>
17 <parameterDefinitions>
18 <hudson.model.StringParameterDefinition>
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
24 <defaultValue>releng/ciman</defaultValue>
25 </hudson.model.StringParameterDefinition>
26 <hudson.model.StringParameterDefinition>
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
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
40 Note that Gerrit will override this parameter automatically if a
41 job is triggered by Gerrit.
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.
49 Note that Gerrit will override this parameter automatically if a
50 job is triggered by Gerrit.
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.
58 Note that Gerrit will override this parameter automatically if a
59 job is triggered by Gerrit.
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 '<1.0.0' or '>=1.0.0,<2.0.0'.
70 <defaultValue><1.0.0</defaultValue>
71 </hudson.model.StringParameterDefinition>
72 </parameterDefinitions>
73 </hudson.model.ParametersDefinitionProperty>
75 <scm class="hudson.plugins.git.GitSCM">
76 <configVersion>2</configVersion>
78 <hudson.plugins.git.UserRemoteConfig>
80 <refspec>+refs/pull/*:refs/remotes/origin/pr/*</refspec>
81 <url>git@github.com:example-org/releng/ciman</url>
82 <credentialsId>test-credential</credentialsId>
83 </hudson.plugins.git.UserRemoteConfig>
86 <hudson.plugins.git.BranchSpec>
88 </hudson.plugins.git.BranchSpec>
90 <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
91 <remotePoll>false</remotePoll>
92 <gitTool>Default</gitTool>
93 <submoduleCfg class="list"/>
98 <hudson.plugins.git.extensions.impl.BuildChooserSetting>
99 <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
100 </hudson.plugins.git.extensions.impl.BuildChooserSetting>
101 <hudson.plugins.git.extensions.impl.SubmoduleOption>
102 <disableSubmodules>false</disableSubmodules>
103 <recursiveSubmodules>true</recursiveSubmodules>
104 <trackingSubmodules>false</trackingSubmodules>
105 <parentCredentials>false</parentCredentials>
107 <timeout>10</timeout>
108 </hudson.plugins.git.extensions.impl.SubmoduleOption>
109 <hudson.plugins.git.extensions.impl.WipeWorkspace/>
112 <triggers class="vector">
113 <org.jenkinsci.plugins.ghprb.GhprbTrigger>
116 <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
122 <triggerPhrase>^recheck$</triggerPhrase>
124 <onlyTriggerPhrase>false</onlyTriggerPhrase>
125 <useGitHubHooks>true</useGitHubHooks>
126 <permitAll>true</permitAll>
127 <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
129 <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
130 <commitStatusContext>RTD Verify</commitStatusContext>
131 </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
133 </org.jenkinsci.plugins.ghprb.GhprbTrigger>
138 <propertiesContent>DOC_DIR=docs/_build/html</propertiesContent>
143 # SPDX-License-Identifier: EPL-1.0
144 ##############################################################################
145 # Copyright (c) 2017 The Linux Foundation and others.
147 # All rights reserved. This program and the accompanying materials
148 # are made available under the terms of the Eclipse Public License v1.0
149 # which accompanies this distribution, and is available at
150 # http://www.eclipse.org/legal/epl-v10.html
151 ##############################################################################
152 echo "---> tox-install.sh"
154 # Ensure we fail the job if any steps fail.
155 # DO NOT set -u as virtualenv's activate script has unbound variables
158 virtualenv --quiet -p "$PYTHON_VERSION" "/tmp/v/tox"
159 # shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
160 source "/tmp/v/tox/bin/activate"
161 pip install --quiet --upgrade pip
162 pip install --quiet --upgrade pipdeptree
163 pip install --quiet --upgrade argparse detox tox tox-pyenv
165 echo "----> Pip Dependency Tree"
169 # SPDX-License-Identifier: EPL-1.0
170 ##############################################################################
171 # Copyright (c) 2017 The Linux Foundation and others.
173 # All rights reserved. This program and the accompanying materials
174 # are made available under the terms of the Eclipse Public License v1.0
175 # which accompanies this distribution, and is available at
176 # http://www.eclipse.org/legal/epl-v10.html
177 ##############################################################################
178 echo "---> rtd-verify.sh"
180 # Ensure we fail the job if any steps fail.
181 # DO NOT set -u as virtualenv's activate script has unbound variables
184 echo "---> Fetching project"
185 if [ "$GERRIT_PROJECT" != "$PROJECT" ]; then
186 cd "docs/submodules/$GERRIT_PROJECT"
189 git fetch origin "$GERRIT_REFSPEC" && git checkout FETCH_HEAD
191 echo "---> Generating docs"
192 cd "$WORKSPACE"
195 echo "---> Archiving generated docs"
196 mkdir -p "$WORKSPACE/archives"
197 mv "$DOC_DIR" archives/
199 </hudson.tasks.Shell>
202 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
206 # SPDX-License-Identifier: EPL-1.0
207 ##############################################################################
208 # Copyright (c) 2017 The Linux Foundation and others.
210 # All rights reserved. This program and the accompanying materials
211 # are made available under the terms of the Eclipse Public License v1.0
212 # which accompanies this distribution, and is available at
213 # http://www.eclipse.org/legal/epl-v10.html
214 ##############################################################################
215 echo "---> sysstat.sh"
216 set +e # DON'T fail build if script fails.
218 OS=$(facter operatingsystem)
219 case "$OS" in
221 SYSSTAT_PATH="/var/log/sysstat"
223 # Dont run the script when systat is not enabled by default
224 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
229 SYSSTAT_PATH="/var/log/sa"
237 SAR_DIR="$WORKSPACE/archives/sar-reports"
238 mkdir -p "$SAR_DIR"
239 cp "$SYSSTAT_PATH/"* "$_"
240 # convert sar data to ascii format
241 while IFS="" read -r sarfilenum
243 [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}"
244 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
246 # DON'T fail build if script fails.
249 </hudson.tasks.Shell>
250 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
252 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
253 <fileId>jenkins-log-archives-settings</fileId>
255 <variable>SETTINGS_FILE</variable>
256 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
258 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
261 <propertiesContent>SERVER_ID=logs</propertiesContent>
266 # SPDX-License-Identifier: EPL-1.0
267 ##############################################################################
268 # Copyright (c) 2017 The Linux Foundation and others.
270 # All rights reserved. This program and the accompanying materials
271 # are made available under the terms of the Eclipse Public License v1.0
272 # which accompanies this distribution, and is available at
273 # http://www.eclipse.org/legal/epl-v10.html
274 ##############################################################################
275 echo "---> create-netrc.sh"
277 # Ensure we fail the job if any steps fail.
280 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
281 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
282 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
283 -v x:username -o ":" -v x:password \
284 "$SETTINGS_FILE")
286 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
287 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
288 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
290 echo "machine ${machine%:*} login $user password $pass" > ~/.netrc
292 </hudson.tasks.Shell>
295 # SPDX-License-Identifier: EPL-1.0
296 ##############################################################################
297 # Copyright (c) 2017 The Linux Foundation and others.
299 # All rights reserved. This program and the accompanying materials
300 # are made available under the terms of the Eclipse Public License v1.0
301 # which accompanies this distribution, and is available at
302 # http://www.eclipse.org/legal/epl-v10.html
303 ##############################################################################
304 echo "---> lftools-install.sh"
306 # Script to install lftools via a version passed in via lf-infra-parameters
308 # Required parameters:
310 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
311 # set to a strict version number like '1.2.3' or using
312 # PEP-440 definitions.
316 # >=1.0.0,<2.0.0
318 # By default a released version of lftools should always be used.
319 # The purpose of the 2 variables below is so that lftools devs can test
320 # unreleased versions of lftools. There are 2 methods to install a dev version
323 # 1) gerrit patch: Used to test a patch that has not yet been merged.
324 # To do this set something like this:
325 # LFTOOLS_MODE=gerrit
326 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
328 # 2) git branch: Used to install an lftools version from a specific branch.
329 # To use this set the variables as follows:
331 # LFTOOLS_REFSPEC=master
333 # 3) release : The intended use case and default setting.
334 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
336 LFTOOLS_MODE=release # release | git | gerrit
337 LFTOOLS_REFSPEC=master
339 # Ensure we fail the job if any steps fail.
340 # DO NOT set -u as virtualenv's activate script has unbound variables
343 virtualenv --quiet "/tmp/v/lftools"
344 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
345 source "/tmp/v/lftools/bin/activate"
346 pip install --quiet --upgrade pip
348 case $LFTOOLS_MODE in
350 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
352 git fetch origin "$LFTOOLS_REFSPEC"
353 git checkout FETCH_HEAD
354 pip install --quiet --upgrade -r requirements.txt
355 pip install --quiet --upgrade -e .
360 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
364 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
365 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
368 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
374 # pipdeptree prints out a lot of information because lftools pulls in many
375 # dependencies. Let's only print it if we want to debug.
376 # echo "----> Pip Dependency Tree"
377 # pip install --quiet --upgrade pipdeptree
381 # SPDX-License-Identifier: EPL-1.0
382 ##############################################################################
383 # Copyright (c) 2017 The Linux Foundation and others.
385 # All rights reserved. This program and the accompanying materials
386 # are made available under the terms of the Eclipse Public License v1.0
387 # which accompanies this distribution, and is available at
388 # http://www.eclipse.org/legal/epl-v10.html
389 ##############################################################################
390 echo "---> logs-deploy.sh"
392 # Ensure we fail the job if any steps fail.
395 set -x # Trace commands for this script to make debugging easier.
397 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
398 LOGS_SERVER="${LOGS_SERVER:-None}"
400 if [ "${LOGS_SERVER}" == 'None' ]
402 set +x # Disable trace since we no longer need it
404 echo "WARNING: Logging server not set"
406 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
407 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
408 BUILD_URL="${BUILD_URL}"
410 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
411 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
413 set +x # Disable trace since we no longer need it.
415 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
418 </hudson.tasks.Shell>
421 # SPDX-License-Identifier: EPL-1.0
422 ##############################################################################
423 # Copyright (c) 2017 The Linux Foundation and others.
425 # All rights reserved. This program and the accompanying materials
426 # are made available under the terms of the Eclipse Public License v1.0
427 # which accompanies this distribution, and is available at
428 # http://www.eclipse.org/legal/epl-v10.html
429 ##############################################################################
431 # Clear log credential files
432 rm "$SETTINGS_FILE"
435 </hudson.tasks.Shell>
436 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
437 <regexp>^Build logs: .*</regexp>
438 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
440 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
441 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
442 <markBuildUnstable>false</markBuildUnstable>
443 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
444 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
446 <hudson.plugins.ws__cleanup.Pattern>
447 <pattern>**/*.jenkins-trigger</pattern>
449 </hudson.plugins.ws__cleanup.Pattern>
451 <deleteDirs>false</deleteDirs>
452 <cleanupMatrixParent>false</cleanupMatrixParent>
454 <cleanWhenSuccess>true</cleanWhenSuccess>
455 <cleanWhenUnstable>true</cleanWhenUnstable>
456 <cleanWhenFailure>true</cleanWhenFailure>
457 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
458 <cleanWhenAborted>true</cleanWhenAborted>
459 <notFailBuild>true</notFailBuild>
460 </hudson.plugins.ws__cleanup.WsCleanup>
463 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
464 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
465 <timeoutMinutes>15</timeoutMinutes>
466 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
467 <failBuild>true</failBuild>
468 <writingDescription>false</writingDescription>
469 <timeoutPercentage>0</timeoutPercentage>
470 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
471 <timeoutType>absolute</timeoutType>
472 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
473 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
474 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
475 <user>test-credential</user>
476 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
477 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
478 <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
480 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
481 <fileId>npmrc</fileId>
482 <targetLocation>$HOME/.npmrc</targetLocation>
484 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
486 </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>