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>false</concurrentBuild>
9 <assignedNode>build-vm</assignedNode>
10 <canRoam>false</canRoam>
12 <com.coravy.hudson.plugins.github.GithubProjectProperty>
13 <projectUrl>https://github.com/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.scm.NullSCM"/>
75 <triggers class="vector">
76 <org.jenkinsci.plugins.ghprb.GhprbTrigger>
79 <allowMembersOfWhitelistedOrgsAsAdmin>false</allowMembersOfWhitelistedOrgsAsAdmin>
83 <triggerPhrase>^remerge$</triggerPhrase>
84 <onlyTriggerPhrase>false</onlyTriggerPhrase>
85 <useGitHubHooks>true</useGitHubHooks>
86 <permitAll>true</permitAll>
87 <autoCloseFailedPullRequests>false</autoCloseFailedPullRequests>
89 <org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
90 <commitStatusContext>RTD Merge</commitStatusContext>
91 </org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus>
93 </org.jenkinsci.plugins.ghprb.GhprbTrigger>
94 <hudson.triggers.TimerTrigger>
95 <spec>H H * * *</spec>
96 </hudson.triggers.TimerTrigger>
101 <propertiesContent>RTD_PROJECT=github-rtd</propertiesContent>
106 # SPDX-License-Identifier: EPL-1.0
107 ##############################################################################
108 # Copyright (c) 2017 The Linux Foundation and others.
110 # All rights reserved. This program and the accompanying materials
111 # are made available under the terms of the Eclipse Public License v1.0
112 # which accompanies this distribution, and is available at
113 # http://www.eclipse.org/legal/epl-v10.html
114 ##############################################################################
115 echo "---> rtd-trigger-build.sh"
117 if [ "$GERRIT_BRANCH" == "master" ]; then
118 RTD_BUILD_VERSION=latest
120 RTD_BUILD_VERSION="${GERRIT_BRANCH/\//-}"
123 curl -X POST --data "version_slug=$RTD_BUILD_VERSION" "https://readthedocs.org/build/$RTD_PROJECT"
125 </hudson.tasks.Shell>
128 <org.jenkinsci.plugins.postbuildscript.PostBuildScript>
132 # SPDX-License-Identifier: EPL-1.0
133 ##############################################################################
134 # Copyright (c) 2017 The Linux Foundation and others.
136 # All rights reserved. This program and the accompanying materials
137 # are made available under the terms of the Eclipse Public License v1.0
138 # which accompanies this distribution, and is available at
139 # http://www.eclipse.org/legal/epl-v10.html
140 ##############################################################################
141 echo "---> sysstat.sh"
142 set +e # DON'T fail build if script fails.
144 OS=$(facter operatingsystem)
145 case "$OS" in
147 SYSSTAT_PATH="/var/log/sysstat"
149 # Dont run the script when systat is not enabled by default
150 if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
155 SYSSTAT_PATH="/var/log/sa"
163 SAR_DIR="$WORKSPACE/archives/sar-reports"
164 mkdir -p "$SAR_DIR"
165 cp "$SYSSTAT_PATH/"* "$_"
166 # convert sar data to ascii format
167 while IFS="" read -r s
169 [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/sar${s//[!0-9]/}"
170 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
172 # DON'T fail build if script fails.
175 </hudson.tasks.Shell>
176 <org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep plugin="config-file-provider">
178 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
179 <fileId>jenkins-log-archives-settings</fileId>
181 <variable>SETTINGS_FILE</variable>
182 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
184 </org.jenkinsci.plugins.configfiles.builder.ConfigFileBuildStep>
187 <propertiesContent>SERVER_ID=logs</propertiesContent>
192 # SPDX-License-Identifier: EPL-1.0
193 ##############################################################################
194 # Copyright (c) 2017 The Linux Foundation and others.
196 # All rights reserved. This program and the accompanying materials
197 # are made available under the terms of the Eclipse Public License v1.0
198 # which accompanies this distribution, and is available at
199 # http://www.eclipse.org/legal/epl-v10.html
200 ##############################################################################
201 echo "---> create-netrc.sh"
203 # Ensure we fail the job if any steps fail.
206 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
207 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
208 -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
209 -v x:username -o ":" -v x:password \
210 "$SETTINGS_FILE")
212 machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}')
213 user=$(echo "$CREDENTIAL" | cut -f1 -d:)
214 pass=$(echo "$CREDENTIAL" | cut -f2 -d:)
216 echo "machine ${machine%:*} login $user password $pass" > ~/.netrc
218 </hudson.tasks.Shell>
221 # SPDX-License-Identifier: EPL-1.0
222 ##############################################################################
223 # Copyright (c) 2017 The Linux Foundation and others.
225 # All rights reserved. This program and the accompanying materials
226 # are made available under the terms of the Eclipse Public License v1.0
227 # which accompanies this distribution, and is available at
228 # http://www.eclipse.org/legal/epl-v10.html
229 ##############################################################################
230 echo "---> lftools-install.sh"
232 # Script to install lftools via a version passed in via lf-infra-parameters
234 # Required parameters:
236 # LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be
237 # set to a strict version number like '1.2.3' or using
238 # PEP-440 definitions.
242 # >=1.0.0,<2.0.0
244 # By default a released version of lftools should always be used.
245 # The purpose of the 2 variables below is so that lftools devs can test
246 # unreleased versions of lftools. There are 2 methods to install a dev version
249 # 1) gerrit patch: Used to test a patch that has not yet been merged.
250 # To do this set something like this:
251 # LFTOOLS_MODE=gerrit
252 # LFTOOLS_REFSPEC=refs/changes/96/5296/7
254 # 2) git branch: Used to install an lftools version from a specific branch.
255 # To use this set the variables as follows:
257 # LFTOOLS_REFSPEC=master
259 # 3) release : The intended use case and default setting.
260 # Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused.
262 LFTOOLS_MODE=release # release | git | gerrit
263 LFTOOLS_REFSPEC=master
265 # Ensure we fail the job if any steps fail.
266 # DO NOT set -u as virtualenv's activate script has unbound variables
269 virtualenv --quiet "/tmp/v/lftools"
270 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
271 source "/tmp/v/lftools/bin/activate"
272 pip install --quiet --upgrade pip
274 case $LFTOOLS_MODE in
276 git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools
278 git fetch origin "$LFTOOLS_REFSPEC"
279 git checkout FETCH_HEAD
280 pip install --quiet --upgrade -r requirements.txt
281 pip install --quiet --upgrade -e .
286 pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH"
290 if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then
291 LFTOOLS_VERSION="==$LFTOOLS_VERSION"
294 pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}"
300 # pipdeptree prints out a lot of information because lftools pulls in many
301 # dependencies. Let's only print it if we want to debug.
302 # echo "----> Pip Dependency Tree"
303 # pip install --quiet --upgrade pipdeptree
307 # SPDX-License-Identifier: EPL-1.0
308 ##############################################################################
309 # Copyright (c) 2017 The Linux Foundation and others.
311 # All rights reserved. This program and the accompanying materials
312 # are made available under the terms of the Eclipse Public License v1.0
313 # which accompanies this distribution, and is available at
314 # http://www.eclipse.org/legal/epl-v10.html
315 ##############################################################################
316 echo "---> logs-deploy.sh"
318 # Ensure we fail the job if any steps fail.
321 set -x # Trace commands for this script to make debugging easier.
323 ARCHIVE_ARTIFACTS="${ARCHIVE_ARTIFACTS:-}"
324 LOGS_SERVER="${LOGS_SERVER:-None}"
326 if [ "${LOGS_SERVER}" == 'None' ]
328 set +x # Disable trace since we no longer need it
330 echo "WARNING: Logging server not set"
332 NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
333 NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
334 BUILD_URL="${BUILD_URL}"
336 lftools deploy archives -p "$ARCHIVE_ARTIFACTS" "$NEXUS_URL" "$NEXUS_PATH" "$WORKSPACE"
337 lftools deploy logs "$NEXUS_URL" "$NEXUS_PATH" "$BUILD_URL"
339 set +x # Disable trace since we no longer need it.
341 echo "Build logs: <a href=\"$LOGS_SERVER/$NEXUS_PATH\">$LOGS_SERVER/$NEXUS_PATH</a>"
344 </hudson.tasks.Shell>
347 # SPDX-License-Identifier: EPL-1.0
348 ##############################################################################
349 # Copyright (c) 2017 The Linux Foundation and others.
351 # All rights reserved. This program and the accompanying materials
352 # are made available under the terms of the Eclipse Public License v1.0
353 # which accompanies this distribution, and is available at
354 # http://www.eclipse.org/legal/epl-v10.html
355 ##############################################################################
357 # Clear log credential files
358 rm "$SETTINGS_FILE"
361 </hudson.tasks.Shell>
362 <hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
363 <regexp>^Build logs: .*</regexp>
364 </hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
366 <scriptOnlyIfSuccess>false</scriptOnlyIfSuccess>
367 <scriptOnlyIfFailure>false</scriptOnlyIfFailure>
368 <markBuildUnstable>false</markBuildUnstable>
369 </org.jenkinsci.plugins.postbuildscript.PostBuildScript>
370 <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup">
372 <hudson.plugins.ws__cleanup.Pattern>
373 <pattern>**/*.jenkins-trigger</pattern>
375 </hudson.plugins.ws__cleanup.Pattern>
377 <deleteDirs>false</deleteDirs>
378 <cleanupMatrixParent>false</cleanupMatrixParent>
380 <cleanWhenSuccess>true</cleanWhenSuccess>
381 <cleanWhenUnstable>true</cleanWhenUnstable>
382 <cleanWhenFailure>true</cleanWhenFailure>
383 <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
384 <cleanWhenAborted>true</cleanWhenAborted>
385 <notFailBuild>true</notFailBuild>
386 </hudson.plugins.ws__cleanup.WsCleanup>
389 <com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
390 <hudson.plugins.build__timeout.BuildTimeoutWrapper>
391 <timeoutMinutes>15</timeoutMinutes>
392 <timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
393 <failBuild>true</failBuild>
394 <writingDescription>false</writingDescription>
395 <timeoutPercentage>0</timeoutPercentage>
396 <timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
397 <timeoutType>absolute</timeoutType>
398 </hudson.plugins.build__timeout.BuildTimeoutWrapper>
399 <hudson.plugins.timestamper.TimestamperBuildWrapper/>
400 <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
401 <user>test-credential</user>
402 </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
403 <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
404 <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
406 <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
407 <fileId>npmrc</fileId>
408 <targetLocation>$HOME/.npmrc</targetLocation>
410 </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
412 </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>