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: build-fast-parameter
101 default: '{build-fast}'
102 description: 'Set true to build fast -Pq'
105 name: distribution-branch-to-build-parameter
108 name: DISTRIBUTION_BRANCH_TO_BUILD
110 description: 'distribution repo branch to build with'
113 name: p2zip-parameter
118 description: 'Nexus staging profile id'
121 name: stage-id-parameter
124 name: STAGING_PROFILE_ID
125 default: '{stage-id}'
126 description: 'Nexus staging profile id'
133 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
134 description: 'Maven selector to be used by shell scripts'
140 credentials-id: 'opendaylight-jenkins-ssh'
149 name: git-scm-with-submodules
152 credentials-id: 'opendaylight-jenkins-ssh'
156 - 'refs/heads/{branch}'
163 name: gerrit-trigger-scm
166 credentials-id: 'opendaylight-jenkins-ssh'
170 - 'origin/$GERRIT_BRANCH'
172 choosing-strategy: '{choosing-strategy}'
182 # This is a single macro to use for all jobs who vote on every (relevant) patch set.
183 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
184 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
186 # gerrit-server-name: name of gerrit server to listen to
187 # project: pattern to match triggering projects
188 # branch: triggering branch name
189 # files: pattern to match triggering filepaths
191 name: gerrit-trigger-patch-submitted
194 server-name: '{gerrit-server-name}'
196 - patchset-created-event:
198 exclude-trivial-rebase: false
199 exclude-no-code-change: false
200 - draft-published-event
201 - comment-added-contains-event:
202 comment-contains-value: 'recheck$'
204 - project-compare-type: ANT
205 project-pattern: '{project}'
207 - branch-compare-type: ANT
208 branch-pattern: '**/{branch}'
213 # TODO: Unify argument names across gerrit-trigger-* macros.
215 name: gerrit-trigger-patch-merged
218 server-name: '{gerrit-server-name}'
220 - change-merged-event
221 - comment-added-contains-event:
222 comment-contains-value: 'remerge$'
224 - project-compare-type: 'ANT'
225 project-pattern: '{name}'
227 - branch-compare-type: 'ANT'
228 branch-pattern: '**/{branch}'
234 # Force Jenkins always vote the values it should already have voted
235 # during the prior verify phase
237 gerrit-build-started-verified-value: 1
238 gerrit-build-successful-verified-value: 1
239 gerrit-build-failed-verified-value: 1
240 gerrit-build-unstable-verified-value: 1
241 gerrit-build-notbuilt-verified-value: 1
242 gerrit-build-started-codereview-value: 0
243 gerrit-build-successful-codereview-value: 0
244 gerrit-build-failed-codereview-value: 0
245 gerrit-build-unstable-codereview-value: 0
246 gerrit-build-notbuilt-codereview-value: 0
248 # TODO: Unify argument names across gerrit-trigger-* macros.
250 name: gerrit-trigger-patch-sonar
253 server-name: '{gerrit-server-name}'
255 - comment-added-contains-event:
256 comment-contains-value: 'run-sonar'
258 - project-compare-type: 'ANT'
259 project-pattern: '{name}'
261 - branch-compare-type: 'ANT'
262 branch-pattern: '**/master'
270 name: email-notification
273 recipients: '{email-recipients}'
275 content-type: default
276 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
278 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
280 Please refer to the logs server URL for console logs when possible
281 and use the Jenkins Build URL as a last resort.
284 https://logs.opendaylight.org/$SILO/$JENKINS_HOSTNAME/$JOB_NAME/$BUILD_NUMBER
295 # Installs the openstack cli into a virtualenv at /tmp/v/openstack
296 name: odl-openstack-install
298 - shell: !include-raw: odl-openstack-install.sh
301 name: odl-openstack-check-image-protection
303 - shell: !include-raw: odl-openstack-check-image-protection.sh
306 name: odl-openstack-cleanup-old-images
308 - shell: !include-raw: odl-openstack-cleanup-old-images.sh
311 name: odl-openstack-cleanup-orphaned-nodes
313 - shell: !include-raw: odl-openstack-cleanup-orphaned-nodes.sh
316 name: odl-openstack-cleanup-stale-nodes
318 - shell: !include-raw: odl-openstack-cleanup-stale-nodes.sh
321 name: odl-openstack-cleanup-stale-stacks
323 - shell: !include-raw: odl-openstack-cleanup-stale-stacks.sh
326 name: odl-openstack-cleanup-stale-volumes
328 - shell: !include-raw: odl-openstack-cleanup-stale-volumes.sh
331 # Deploys a maven site to Nexus using lftools nexus-zip command
332 name: opendaylight-infra-deploy-maven-site
334 - lf-provide-maven-settings:
335 global-settings-file: global-settings
336 settings-file: '{settings-file}'
337 - lf-infra-create-netrc:
338 server-id: opendaylight-site
339 - shell: !include-raw-escape:
340 - global-jjb/shell/lftools-install.sh
341 - opendaylight-infra-deploy-maven-site.sh
342 - lf-provide-maven-settings-cleanup
345 name: opendaylight-infra-stack
346 # opendaylight-infra-stack.sh has a required variable {stack-template} that
347 # must be passed into this macro.
349 - shell: !include-raw: opendaylight-infra-stack.sh
350 - shell: !include-raw-escape: opendaylight-infra-copy-ssh-keys.sh
353 name: distribute-build-url
354 # Place URL of the current run of a build job to a file at given path.
358 set +e # DO NOT fail script if command returns non-zero.
360 echo "$BUILD_URL" > {path}/build.url
362 # DO NOT fail the build if the echo failed.
366 name: wipe-org-opendaylight-repo
368 - shell: 'if [ -d /tmp/r/org/opendaylight ]; then rm -rf /tmp/r/org/opendaylight; fi'
371 name: wipe-local-maven-repo
373 - shell: 'if [ -d /tmp/r ]; then rm -rf /tmp/r; fi'
376 name: jacoco-nojava-workaround
378 - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
384 application-name: '{application-name}'
387 name: releng-check-unicode
390 $WORKSPACE/scripts/check-unicode.sh jjb/
393 name: provide-maven-settings
395 - config-file-provider:
397 - file-id: '{global-settings-file}'
398 variable: 'GLOBAL_SETTINGS_FILE'
399 - file-id: '{settings-file}'
400 variable: 'SETTINGS_FILE'
403 name: releng-fetch-p2zip-if-necessary
406 # Cleanup any existing zips and metadata before we download the new update site
409 condition-kind: strings-match
410 condition-string1: '$P2ZIP_URL'
411 condition-string2: ''
412 condition-basedir: workspace
414 # TODO: Figure out latest snapshot version number to pull rather than hardcoding 1.1.1-SNAPSHOT
416 maven-version: '{maven-version}'
418 org.apache.maven.plugins:maven-dependency-plugin:get
419 org.apache.maven.plugins:maven-dependency-plugin:copy
421 -Dartifact=org.opendaylight.yangide:org.opendaylight.yangide.update-site:1.1.1-SNAPSHOT:zip
422 -DoutputDirectory=$WORKSPACE
423 settings: '{settings}'
424 global-settings: '{global-settings}'
427 name: releng-generate-p2pom
429 - shell: !include-raw: generate-p2pom.sh
432 name: releng-update-p2composite-metadata
434 - shell: !include-raw: update-p2composite-metadata.sh
436 condition-kind: file-exists
437 condition-filename: deploy-composite-repo.xml
438 condition-basedir: workspace
441 maven-version: '{maven-version}'
442 pom: 'deploy-composite-repo.xml'
443 goals: 'clean deploy -V -B -Dmaven.repo.local=/tmp/r'
444 settings: '{settings}'
445 global-settings: '{global-settings}'
448 name: releng-openstack-stack-delete
461 echo "Deleting $STACK_NAME"
462 source "/tmp/v/openstack/bin/activate"
463 openstack stack delete --yes "$STACK_NAME"
464 mark-unstable-if-failed: false
467 name: releng-stage-release
469 - shell: !include-raw: stage-release.sh
472 # This wrapper is required for all jobs as it configures the wrappers
473 # needed by OpenDaylight infra.
474 name: opendaylight-infra-wrappers
477 - config-file-provider:
480 target: '$HOME/.npmrc'
482 target: '$HOME/.config/pip/pip.conf'
483 - file-id: clouds-yaml
484 target: '$HOME/.config/openstack/clouds.yaml'
487 timeout: '{build-timeout}'
488 timeout-var: 'BUILD_TIMEOUT'
491 - ssh-agent-credentials:
493 - 'opendaylight-jenkins-ssh'
498 name: opendaylight-infra-generate-csit-status-report
510 - shell: !include-raw: generate-csit-status-report.sh
511 mark-unstable-if-failed: true