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"
196 echo "---> Archiving generated docs"
197 mkdir -p "$WORKSPACE/archives"
198 mv "$DOC_DIR" archives/
200 </hudson.tasks.Shell>
203 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
207 # SPDX-License-Identifier: EPL-1.0
208 ##############################################################################
209 # Copyright (c) 2017 The Linux Foundation and others.
211 # All rights reserved. This program and the accompanying materials
212 # are made available under the terms of the Eclipse Public License v1.0
213 # which accompanies this distribution, and is available at
214 # http://www.eclipse.org/legal/epl-v10.html
215 ##############################################################################
216 echo "---> sysstat.sh"
217 set +e # DON'T fail build if script fails.
219 OS=$(facter operatingsystem)
220 case "$OS" in
222 SYSSTAT_PATH="/var/log/sysstat"
224 # Dont run the script when systat is not enabled by default
225 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
230 SYSSTAT_PATH="/var/log/sa"
238 SAR_DIR="$WORKSPACE/archives/sar-reports"
239 mkdir -p "$SAR_DIR"
240 cp "$SYSSTAT_PATH/"* "$_"
241 # convert sar data to ascii format
242 while IFS="" read -r s
244 [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/sar${s//[!0-9]/}"
245 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
247 # DON'T fail build if script fails.
250 </hudson.tasks.Shell>
251 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
253 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
254 <fileId>jenkins-log-archives-settings</fileId>
256 <variable>SETTINGS_FILE</variable>
257 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
259 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
262 <propertiesContent>SERVER_ID=logs</propertiesContent>
267 # SPDX-License-Identifier: EPL-1.0
268 ##############################################################################
269 # Copyright (c) 2017 The Linux Foundation and others.
271 # All rights reserved. This program and the accompanying materials
272 # are made available under the terms of the Eclipse Public License v1.0
273 # which accompanies this distribution, and is available at
274 # http://www.eclipse.org/legal/epl-v10.html
275 ##############################################################################
276 echo "---> create-netrc.sh"
278 # Ensure we fail the job if any steps fail.
281 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
282 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
283 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
284 -v x:username -o ":" -v x:password \
285 "$SETTINGS_FILE")
287 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
288 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
289 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
291 echo "machine $machine login $user password $pass" > ~/.netrc
293 </hudson.tasks.Shell>
296 # SPDX-License-Identifier: EPL-1.0
297 ##############################################################################
298 # Copyright (c) 2017 The Linux Foundation and others.
300 # All rights reserved. This program and the accompanying materials
301 # are made available under the terms of the Eclipse Public License v1.0
302 # which accompanies this distribution, and is available at
303 # http://www.eclipse.org/legal/epl-v10.html
304 ##############################################################################
305 echo "---> lftools-install.sh"
307 # Script to install lftools via a version passed in via lf-infra-parameters
309 # Required parameters:
311 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
312 # set to a strict version number like '1.2.3' or using
313 # PEP-440 definitions.
317 # >=1.0.0,<2.0.0
319 # By default a released version of lftools should always be used.
320 # The purpose of the 2 variables below is so that lftools devs can test
321 # unreleased versions of lftools. There are 2 methods to install a dev version
324 # 1) gerrit patch: Used to test a patch that has not yet been merged.
325 # To do this set something like this:
326 # LFTOOLS_MODE=gerrit
327 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
329 # 2) git branch: Used to install an lftools version from a specific branch.
330 # To use this set the variables as follows:
332 # LFTOOLS_REFSPEC=master
334 # 3) release : The intended use case and default setting.
335 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
337 LFTOOLS_MODE=release # release | git | gerrit
338 LFTOOLS_REFSPEC=master
340 # Ensure we fail the job if any steps fail.
341 # DO NOT set -u as virtualenv's activate script has unbound variables
344 virtualenv --quiet "/tmp/v/lftools"
345 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
346 source "/tmp/v/lftools/bin/activate"
347 pip install --quiet --upgrade pip
349 case $LFTOOLS_MODE in
351 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
353 git fetch origin "$LFTOOLS_REFSPEC"
354 git checkout FETCH_HEAD
355 pip install --quiet --upgrade -r requirements.txt
356 pip install --quiet --upgrade -e .
361 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
365 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
366 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
369 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
375 # pipdeptree prints out a lot of information because lftools pulls in many
376 # dependencies. Let's only print it if we want to debug.
377 # echo "----> Pip Dependency Tree"
378 # pip install --quiet --upgrade pipdeptree
382 # SPDX-License-Identifier: EPL-1.0
383 ##############################################################################
384 # Copyright (c) 2017 The Linux Foundation and others.
386 # All rights reserved. This program and the accompanying materials
387 # are made available under the terms of the Eclipse Public License v1.0
388 # which accompanies this distribution, and is available at
389 # http://www.eclipse.org/legal/epl-v10.html
390 ##############################################################################
391 echo "---> logs-deploy.sh"
393 # Ensure we fail the job if any steps fail.
396 set -x # Trace commands for this script to make debugging easier.
398 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
399 LOGS_SERVER="${LOGS_SERVER:-None}"
401 if [ "${LOGS_SERVER}" == 'None' ]
403 set +x # Disable trace since we no longer need it
405 echo "WARNING: Logging server not set"
407 NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
408 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
409 BUILD_URL="${BUILD_URL}"
411 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
412 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
414 set +x # Disable trace since we no longer need it.
416 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
419 </hudson.tasks.Shell>
422 # SPDX-License-Identifier: EPL-1.0
423 ##############################################################################
424 # Copyright (c) 2017 The Linux Foundation and others.
426 # All rights reserved. This program and the accompanying materials
427 # are made available under the terms of the Eclipse Public License v1.0
428 # which accompanies this distribution, and is available at
429 # http://www.eclipse.org/legal/epl-v10.html
430 ##############################################################################
432 # Clear log credential files
433 rm "$SETTINGS_FILE"
436 </hudson.tasks.Shell>
437 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
438 <regexp>^Build logs: .*</regexp>
439 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
441 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
442 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
443 <markBuildUnstable>false</markBuildUnstable>
444 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
445 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
447 <hudson.plugins.ws__cleanup.Pattern>
448 <pattern>**/*.jenkins-trigger</pattern>
450 </hudson.plugins.ws__cleanup.Pattern>
452 <deleteDirs>false</deleteDirs>
453 <cleanupMatrixParent>false</cleanupMatrixParent>
455 <cleanWhenSuccess>true</cleanWhenSuccess>
456 <cleanWhenUnstable>true</cleanWhenUnstable>
457 <cleanWhenFailure>true</cleanWhenFailure>
458 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
459 <cleanWhenAborted>true</cleanWhenAborted>
460 <notFailBuild>true</notFailBuild>
461 </hudson.plugins.ws__cleanup.WsCleanup>
464 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
465 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
466 <timeoutMinutes>15</timeoutMinutes>
467 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
468 <failBuild>true</failBuild>
469 <writingDescription>false</writingDescription>
470 <timeoutPercentage>0</timeoutPercentage>
471 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
472 <timeoutType>absolute</timeoutType>
473 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
474 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
475 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
476 <user>test-credential</user>
477 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
478 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>