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>
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>
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
23 <defaultValue>releng/ciman</defaultValue>
24 </hudson.model.StringParameterDefinition>
25 <hudson.model.StringParameterDefinition>
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
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
39 Note that Gerrit will override this parameter automatically if a
40 job is triggered by Gerrit.
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.
48 Note that Gerrit will override this parameter automatically if a
49 job is triggered by Gerrit.
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.
57 Note that Gerrit will override this parameter automatically if a
58 job is triggered by Gerrit.
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 '<1.0.0' or '>=1.0.0,<2.0.0'.
69 <defaultValue><1.0.0</defaultValue>
70 </hudson.model.StringParameterDefinition>
71 </parameterDefinitions>
72 </hudson.model.ParametersDefinitionProperty>
74 <scm class="hudson.plugins.git.GitSCM">
75 <configVersion>2</configVersion>
77 <hudson.plugins.git.UserRemoteConfig>
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>
85 <hudson.plugins.git.BranchSpec>
87 </hudson.plugins.git.BranchSpec>
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"/>
102 <skipTag>true</skipTag>
104 <useShallowClone>false</useShallowClone>
105 <ignoreNotifyCommit>false</ignoreNotifyCommit>
107 <hudson.plugins.git.extensions.impl.SubmoduleOption>
108 <disableSubmodules>false</disableSubmodules>
109 <recursiveSubmodules>true</recursiveSubmodules>
110 <trackingSubmodules>false</trackingSubmodules>
112 <timeout>10</timeout>
113 </hudson.plugins.git.extensions.impl.SubmoduleOption>
114 <hudson.plugins.git.extensions.impl.WipeWorkspace/>
117 <triggers class="vector">
118 <org.jenkinsci.plugins.ghprb.GhprbTrigger>
121 <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
125 <triggerPhrase>^recheck$</triggerPhrase>
126 <onlyTriggerPhrase>false</onlyTriggerPhrase>
127 <useGitHubHooks>true</useGitHubHooks>
128 <permitAll>true</permitAll>
129 <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
131 <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
132 <commitStatusContext>RTD Verify</commitStatusContext>
133 </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
135 </org.jenkinsci.plugins.ghprb.GhprbTrigger>
140 <propertiesContent>DOC_DIR=docs/_build/html</propertiesContent>
145 # SPDX-License-Identifier: EPL-1.0
146 ##############################################################################
147 # Copyright (c) 2017 The Linux Foundation and others.
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 "---> tox-install.sh"
156 # Ensure we fail the job if any steps fail.
157 # DO NOT set -u as virtualenv's activate script has unbound variables
160 virtualenv --quiet "/tmp/v/tox"
161 # shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
162 source "/tmp/v/tox/bin/activate"
163 pip install --quiet --upgrade pip
164 pip install --quiet --upgrade pipdeptree
165 pip install --quiet --upgrade tox argparse
167 echo "----> Pip Dependency Tree"
171 # SPDX-License-Identifier: EPL-1.0
172 ##############################################################################
173 # Copyright (c) 2017 The Linux Foundation and others.
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 "---> rtd-verify.sh"
182 # Ensure we fail the job if any steps fail.
183 # DO NOT set -u as virtualenv's activate script has unbound variables
186 echo "---> Fetching project"
187 if [ "$GERRIT_PROJECT" != "$PROJECT" ]; then
188 cd "docs/submodules/$GERRIT_PROJECT"
191 git fetch origin "$GERRIT_REFSPEC" && git checkout FETCH_HEAD
193 echo "---> Generating docs"
194 cd "$WORKSPACE"
197 echo "---> Archiving generated docs"
198 mkdir -p "$WORKSPACE/archives"
199 mv "$DOC_DIR" archives/
201 </hudson.tasks.Shell>
204 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
208 # SPDX-License-Identifier: EPL-1.0
209 ##############################################################################
210 # Copyright (c) 2017 The Linux Foundation and others.
212 # All rights reserved. This program and the accompanying materials
213 # are made available under the terms of the Eclipse Public License v1.0
214 # which accompanies this distribution, and is available at
215 # http://www.eclipse.org/legal/epl-v10.html
216 ##############################################################################
217 echo "---> sysstat.sh"
218 set +e # DON'T fail build if script fails.
220 OS=$(facter operatingsystem)
221 case "$OS" in
223 SYSSTAT_PATH="/var/log/sysstat"
225 # Dont run the script when systat is not enabled by default
226 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
231 SYSSTAT_PATH="/var/log/sa"
239 SAR_DIR="$WORKSPACE/archives/sar-reports"
240 mkdir -p "$SAR_DIR"
241 cp "$SYSSTAT_PATH/"* "$_"
242 # convert sar data to ascii format
243 while IFS="" read -r s
245 [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/sar${s//[!0-9]/}"
246 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
248 # DON'T fail build if script fails.
251 </hudson.tasks.Shell>
252 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
254 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
255 <fileId>jenkins-log-archives-settings</fileId>
257 <variable>SETTINGS_FILE</variable>
258 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
260 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
263 <propertiesContent>SERVER_ID=logs</propertiesContent>
268 # SPDX-License-Identifier: EPL-1.0
269 ##############################################################################
270 # Copyright (c) 2017 The Linux Foundation and others.
272 # All rights reserved. This program and the accompanying materials
273 # are made available under the terms of the Eclipse Public License v1.0
274 # which accompanies this distribution, and is available at
275 # http://www.eclipse.org/legal/epl-v10.html
276 ##############################################################################
277 echo "---> create-netrc.sh"
279 # Ensure we fail the job if any steps fail.
282 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
283 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
284 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
285 -v x:username -o ":" -v x:password \
286 "$SETTINGS_FILE")
288 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
289 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
290 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
292 echo "machine ${machine%:*} login $user password $pass" > ~/.netrc
294 </hudson.tasks.Shell>
297 # SPDX-License-Identifier: EPL-1.0
298 ##############################################################################
299 # Copyright (c) 2017 The Linux Foundation and others.
301 # All rights reserved. This program and the accompanying materials
302 # are made available under the terms of the Eclipse Public License v1.0
303 # which accompanies this distribution, and is available at
304 # http://www.eclipse.org/legal/epl-v10.html
305 ##############################################################################
306 echo "---> lftools-install.sh"
308 # Script to install lftools via a version passed in via lf-infra-parameters
310 # Required parameters:
312 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
313 # set to a strict version number like '1.2.3' or using
314 # PEP-440 definitions.
318 # >=1.0.0,<2.0.0
320 # By default a released version of lftools should always be used.
321 # The purpose of the 2 variables below is so that lftools devs can test
322 # unreleased versions of lftools. There are 2 methods to install a dev version
325 # 1) gerrit patch: Used to test a patch that has not yet been merged.
326 # To do this set something like this:
327 # LFTOOLS_MODE=gerrit
328 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
330 # 2) git branch: Used to install an lftools version from a specific branch.
331 # To use this set the variables as follows:
333 # LFTOOLS_REFSPEC=master
335 # 3) release : The intended use case and default setting.
336 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
338 LFTOOLS_MODE=release # release | git | gerrit
339 LFTOOLS_REFSPEC=master
341 # Ensure we fail the job if any steps fail.
342 # DO NOT set -u as virtualenv's activate script has unbound variables
345 virtualenv --quiet "/tmp/v/lftools"
346 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
347 source "/tmp/v/lftools/bin/activate"
348 pip install --quiet --upgrade pip
350 case $LFTOOLS_MODE in
352 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
354 git fetch origin "$LFTOOLS_REFSPEC"
355 git checkout FETCH_HEAD
356 pip install --quiet --upgrade -r requirements.txt
357 pip install --quiet --upgrade -e .
362 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
366 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
367 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
370 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
376 # pipdeptree prints out a lot of information because lftools pulls in many
377 # dependencies. Let's only print it if we want to debug.
378 # echo "----> Pip Dependency Tree"
379 # pip install --quiet --upgrade pipdeptree
383 # SPDX-License-Identifier: EPL-1.0
384 ##############################################################################
385 # Copyright (c) 2017 The Linux Foundation and others.
387 # All rights reserved. This program and the accompanying materials
388 # are made available under the terms of the Eclipse Public License v1.0
389 # which accompanies this distribution, and is available at
390 # http://www.eclipse.org/legal/epl-v10.html
391 ##############################################################################
392 echo "---> logs-deploy.sh"
394 # Ensure we fail the job if any steps fail.
397 set -x # Trace commands for this script to make debugging easier.
399 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
400 LOGS_SERVER="${LOGS_SERVER:-None}"
402 if [ "${LOGS_SERVER}" == 'None' ]
404 set +x # Disable trace since we no longer need it
406 echo "WARNING: Logging server not set"
408 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
409 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
410 BUILD_URL="${BUILD_URL}"
412 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
413 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
415 set +x # Disable trace since we no longer need it.
417 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
420 </hudson.tasks.Shell>
423 # SPDX-License-Identifier: EPL-1.0
424 ##############################################################################
425 # Copyright (c) 2017 The Linux Foundation and others.
427 # All rights reserved. This program and the accompanying materials
428 # are made available under the terms of the Eclipse Public License v1.0
429 # which accompanies this distribution, and is available at
430 # http://www.eclipse.org/legal/epl-v10.html
431 ##############################################################################
433 # Clear log credential files
434 rm "$SETTINGS_FILE"
437 </hudson.tasks.Shell>
438 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
439 <regexp>^Build logs: .*</regexp>
440 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
442 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
443 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
444 <markBuildUnstable>false</markBuildUnstable>
445 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
446 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
448 <hudson.plugins.ws__cleanup.Pattern>
449 <pattern>**/*.jenkins-trigger</pattern>
451 </hudson.plugins.ws__cleanup.Pattern>
453 <deleteDirs>false</deleteDirs>
454 <cleanupMatrixParent>false</cleanupMatrixParent>
456 <cleanWhenSuccess>true</cleanWhenSuccess>
457 <cleanWhenUnstable>true</cleanWhenUnstable>
458 <cleanWhenFailure>true</cleanWhenFailure>
459 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
460 <cleanWhenAborted>true</cleanWhenAborted>
461 <notFailBuild>true</notFailBuild>
462 </hudson.plugins.ws__cleanup.WsCleanup>
465 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
466 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
467 <timeoutMinutes>15</timeoutMinutes>
468 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
469 <failBuild>true</failBuild>
470 <writingDescription>false</writingDescription>
471 <timeoutPercentage>0</timeoutPercentage>
472 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
473 <timeoutType>absolute</timeoutType>
474 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
475 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
476 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
477 <user>test-credential</user>
478 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
479 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
480 <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
482 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
483 <fileId>npmrc</fileId>
484 <targetLocation>$HOME/.npmrc</targetLocation>
486 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
488 </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>