4 name: opendaylight-infra-properties
7 days-to-keep: '{build-days-to-keep}'
9 # Need to keep artifacts for at least 1 day as some projects need to
10 # be able to validate their artifacts and only allowing limited
11 # number of artifacts could make fast moving jobs lost their
12 # artifacts before the developers can test it.
13 artifact-days-to-keep: 1
16 name: opendaylight-infra-parameters
21 description: 'Parameter to identify an ODL Gerrit project'
23 name: ARCHIVE_ARTIFACTS
24 # Before adding more here, beware of https://jira.linuxfoundation.org/browse/RELENG-280
27 **/target/surefire-reports/*-output.txt
28 **/target/failsafe-reports/failsafe-summary.xml
30 **/target/feature/feature.xml
31 # TODO: **/*.hprof is too large, compress with xz first
32 description: 'Space separated glob patterns for artifacts to archive into logs.opendaylight.org'
36 description: "GERRIT_PROJECT parameter if not given by trigger"
40 description: "JJB configured GERRIT_BRANCH parameter"
45 Gerrit reference to checkout (ex: refs/heads/master,
46 refs/changes/48/61548/1 where 61548 is Gerrit change ID, 1 is
47 patch number and 48 is last two digits of change ID)
50 default: '$SILO-$JOB_NAME-$BUILD_NUMBER'
51 description: "Used by Heat to generate a unique stack & vm name"
56 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
57 variable name that is significant to openstack client as a
58 environment variable. Please refer to the documentation for
60 https://docs.openstack.org/developer/python-openstackclient/
68 description: 'Tag in Git to checkout'
71 name: controller-version-parameter
75 default: '{odl_version}'
76 description: 'Controller version (for use with openstacks networking_odl project)'
79 name: patches-to-build-parameter
82 name: PATCHES_TO_BUILD
85 Ordered list of patches to build in the format of project=changeset (checkout) or
86 project:changeset (cherry-pick) for example: genius=32/53632/9,netvirt:59/50259/47
89 name: run-test-parameter
94 description: 'Set true to run test after build'
97 name: distribution-branch-to-build-parameter
100 name: DISTRIBUTION_BRANCH_TO_BUILD
102 description: 'distribution repo branch to build with'
105 name: p2zip-parameter
110 description: 'Nexus staging profile id'
113 name: stage-id-parameter
116 name: STAGING_PROFILE_ID
117 default: '{stage-id}'
118 description: 'Nexus staging profile id'
125 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
126 description: 'Maven selector to be used by shell scripts'
132 credentials-id: 'opendaylight-jenkins-ssh'
141 name: git-scm-with-submodules
144 credentials-id: 'opendaylight-jenkins-ssh'
148 - 'refs/heads/{branch}'
155 name: gerrit-trigger-scm
158 credentials-id: 'opendaylight-jenkins-ssh'
162 - 'origin/$GERRIT_BRANCH'
164 choosing-strategy: '{choosing-strategy}'
174 # This is a single macro to use for all jobs who vote on every (relevant) patch set.
175 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
176 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
178 # gerrit-server-name: name of gerrit server to listen to
179 # project: pattern to match triggering projects
180 # branch: triggering branch name
181 # files: pattern to match triggering filepaths
183 name: gerrit-trigger-patch-submitted
186 server-name: '{gerrit-server-name}'
188 - patchset-created-event:
190 exclude-trivial-rebase: false
191 exclude-no-code-change: false
192 - draft-published-event
193 - comment-added-contains-event:
194 comment-contains-value: 'recheck$'
196 - project-compare-type: ANT
197 project-pattern: '{project}'
199 - branch-compare-type: ANT
200 branch-pattern: '**/{branch}'
205 # TODO: Unify argument names across gerrit-trigger-* macros.
207 name: gerrit-trigger-patch-merged
210 server-name: '{gerrit-server-name}'
212 - change-merged-event
213 - comment-added-contains-event:
214 comment-contains-value: 'remerge$'
216 - project-compare-type: 'ANT'
217 project-pattern: '{name}'
219 - branch-compare-type: 'ANT'
220 branch-pattern: '**/{branch}'
226 # Force Jenkins always vote the values it should already have voted
227 # during the prior verify phase
229 gerrit-build-started-verified-value: 1
230 gerrit-build-successful-verified-value: 1
231 gerrit-build-failed-verified-value: 1
232 gerrit-build-unstable-verified-value: 1
233 gerrit-build-notbuilt-verified-value: 1
234 gerrit-build-started-codereview-value: 0
235 gerrit-build-successful-codereview-value: 0
236 gerrit-build-failed-codereview-value: 0
237 gerrit-build-unstable-codereview-value: 0
238 gerrit-build-notbuilt-codereview-value: 0
240 # TODO: Unify argument names across gerrit-trigger-* macros.
242 name: gerrit-trigger-patch-sonar
245 server-name: '{gerrit-server-name}'
247 - comment-added-contains-event:
248 comment-contains-value: 'run-sonar'
250 - project-compare-type: 'ANT'
251 project-pattern: '{name}'
253 - branch-compare-type: 'ANT'
254 branch-pattern: '**/master'
262 name: email-notification
265 recipients: '{email-recipients}'
267 content-type: default
268 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
270 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
272 Please refer to the logs server URL for console logs when possible
273 and use the Jenkins Build URL as a last resort.
276 https://logs.opendaylight.org/$SILO/$JENKINS_HOSTNAME/$JOB_NAME/$BUILD_NUMBER
287 # Installs the openstack cli into a virtualenv at /tmp/v/openstack
288 name: odl-openstack-install
290 - shell: !include-raw: odl-openstack-install.sh
293 name: odl-openstack-check-image-protection
295 - shell: !include-raw: odl-openstack-check-image-protection.sh
298 name: odl-openstack-cleanup-old-images
300 - shell: !include-raw: odl-openstack-cleanup-old-images.sh
303 name: odl-openstack-cleanup-orphaned-nodes
305 - shell: !include-raw: odl-openstack-cleanup-orphaned-nodes.sh
308 name: odl-openstack-cleanup-stale-nodes
310 - shell: !include-raw: odl-openstack-cleanup-stale-nodes.sh
313 name: odl-openstack-cleanup-stale-stacks
315 - shell: !include-raw: odl-openstack-cleanup-stale-stacks.sh
318 name: odl-openstack-cleanup-stale-volumes
320 - shell: !include-raw: odl-openstack-cleanup-stale-volumes.sh
323 # Deploys a maven site to Nexus using lftools nexus-zip command
324 name: opendaylight-infra-deploy-maven-site
326 - lf-provide-maven-settings:
327 global-settings-file: global-settings
328 settings-file: '{settings-file}'
329 - lf-infra-create-netrc:
330 server-id: opendaylight-site
331 - shell: !include-raw-escape:
332 - global-jjb/shell/lftools-install.sh
333 - opendaylight-infra-deploy-maven-site.sh
334 - lf-provide-maven-settings-cleanup
337 name: opendaylight-infra-stack
338 # opendaylight-infra-stack.sh has a required variable {stack-template} that
339 # must be passed into this macro.
341 - shell: !include-raw: opendaylight-infra-stack.sh
342 - shell: !include-raw-escape: opendaylight-infra-copy-ssh-keys.sh
345 name: opendaylight-infra-push-gerrit-patch
346 # opendaylight-infra-push-gerrit-patch.sh allows a job to push a patch to
347 # Gerrit in an automated fashion. This is meant for tasks that creates
348 # the same patch regularly and needs the ability to detect if an unreviewed
349 # patch already exists. In which case it will update the existing patch.
351 # Note: This patch assumes the $WORKSPACE contains the project repo with
352 # the files changed already "git add" and waiting for a "git commit" call.
354 # This script requires the following JJB variables to be passed in:
355 # {project} Gerrit project-name
356 # {gerrit-topic} Gerrit topic, please make a unique topic.
357 # {gerrit-commit-message} Commit message to assign to commit.
358 # NOTE: Requires git review to be installed on node.
360 - shell: !include-raw: opendaylight-infra-push-gerrit-patch.sh
363 name: distribute-build-url
364 # Place URL of the current run of a build job to a file at given path.
368 set +e # DO NOT fail script if command returns non-zero.
370 echo "$BUILD_URL" > {path}/build.url
372 # DO NOT fail the build if the echo failed.
376 name: wipe-org-opendaylight-repo
378 - shell: 'if [ -d /tmp/r/org/opendaylight ]; then rm -rf /tmp/r/org/opendaylight; fi'
381 name: wipe-local-maven-repo
383 - shell: 'if [ -d /tmp/r ]; then rm -rf /tmp/r; fi'
386 name: jacoco-nojava-workaround
388 - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
394 application-name: '{application-name}'
397 name: releng-check-unicode
400 $WORKSPACE/scripts/check-unicode.sh jjb/
403 name: provide-maven-settings
405 - config-file-provider:
407 - file-id: '{global-settings-file}'
408 variable: 'GLOBAL_SETTINGS_FILE'
409 - file-id: '{settings-file}'
410 variable: 'SETTINGS_FILE'
413 name: releng-fetch-p2zip-if-necessary
416 # Cleanup any existing zips and metadata before we download the new update site
419 condition-kind: strings-match
420 condition-string1: '$P2ZIP_URL'
421 condition-string2: ''
422 condition-basedir: workspace
424 # TODO: Figure out latest snapshot version number to pull rather than hardcoding 1.1.1-SNAPSHOT
426 maven-version: '{maven-version}'
428 org.apache.maven.plugins:maven-dependency-plugin:get
429 org.apache.maven.plugins:maven-dependency-plugin:copy
431 -Dartifact=org.opendaylight.yangide:org.opendaylight.yangide.update-site:1.1.1-SNAPSHOT:zip
432 -DoutputDirectory=$WORKSPACE
433 settings: '{settings}'
434 global-settings: '{global-settings}'
437 name: releng-generate-p2pom
439 - shell: !include-raw: generate-p2pom.sh
442 name: releng-update-p2composite-metadata
444 - shell: !include-raw: update-p2composite-metadata.sh
446 condition-kind: file-exists
447 condition-filename: deploy-composite-repo.xml
448 condition-basedir: workspace
451 maven-version: '{maven-version}'
452 pom: 'deploy-composite-repo.xml'
453 goals: 'clean deploy -V -B -Dmaven.repo.local=/tmp/r'
454 settings: '{settings}'
455 global-settings: '{global-settings}'
458 name: releng-openstack-stack-delete
471 echo "Deleting $STACK_NAME"
472 source "/tmp/v/openstack/bin/activate"
473 openstack stack delete --yes "$STACK_NAME"
474 mark-unstable-if-failed: false
477 name: releng-stage-release
479 - shell: !include-raw: stage-release.sh
482 # This wrapper is required for all jobs as it configures the wrappers
483 # needed by OpenDaylight infra.
484 name: opendaylight-infra-wrappers
487 - config-file-provider:
490 target: '$HOME/.npmrc'
492 target: '$HOME/.config/pip/pip.conf'
493 - file-id: clouds-yaml
494 target: '$HOME/.config/openstack/clouds.yaml'
497 timeout: '{build-timeout}'
498 timeout-var: 'BUILD_TIMEOUT'
501 - ssh-agent-credentials:
503 - 'opendaylight-jenkins-ssh'
508 name: opendaylight-infra-generate-csit-status-report
520 - shell: !include-raw: generate-csit-status-report.sh
521 mark-unstable-if-failed: true