4 name: opendaylight-infra-properties
7 days-to-keep: '{build-days-to-keep}'
9 artifact-days-to-keep: -1
10 artifact-num-to-keep: 5
13 name: opendaylight-infra-parameters
18 description: 'Parameter to identify an ODL Gerrit project'
20 name: ARCHIVE_ARTIFACTS
21 default: '{artifacts} **/target/surefire-reports/*-output.txt **/hs_err_*.log **/target/feature/feature.xml'
22 description: 'Space separated glob patterns for artifacts to archive into logs.opendaylight.org'
26 description: "GERRIT_PROJECT parameter if not given by trigger"
30 description: "JJB configured GERRIT_BRANCH parameter"
34 description: "GERRIT_REFSPEC parameter if not given by trigger"
37 default: '$JOB_NAME-$BUILD_NUMBER'
38 description: "Used by Heat to generate a unique stack & vm name"
46 description: 'Tag in Git to checkout'
49 name: controller-version-parameter
53 default: '{odl_version}'
54 description: 'Controller version (for use with openstacks networking_odl project)'
57 name: patches-to-build-parameter
60 name: PATCHES_TO_BUILD
62 description: 'csv list of patches in project:changeset format to build distribution with'
65 name: distribution-branch-to-build-parameter
68 name: DISTRIBUTION_BRANCH_TO_BUILD
70 description: 'distribution repo branch to build with'
78 description: 'Nexus staging profile id'
81 name: stage-id-parameter
84 name: STAGING_PROFILE_ID
86 description: 'Nexus staging profile id'
93 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
94 description: 'Maven selector to be used by shell scripts'
100 credentials-id: 'opendaylight-jenkins-ssh'
109 name: git-scm-with-submodules
112 credentials-id: 'opendaylight-jenkins-ssh'
116 - 'refs/heads/{branch}'
123 name: gerrit-trigger-scm
126 credentials-id: 'opendaylight-jenkins-ssh'
130 - 'origin/$GERRIT_BRANCH'
132 choosing-strategy: '{choosing-strategy}'
142 # This is a single macro to use for all jobs who vote on every (relevant) patch set.
143 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
144 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
146 # server: name of gerrit server to listen to
147 # project: pattern to match triggering projects
148 # branch: triggering branch name
149 # files: pattern to match triggering filepaths
151 name: gerrit-trigger-patch-submitted
154 server-name: '{server}'
156 - patchset-created-event:
157 exclude-drafts: 'true'
158 exclude-trivial-rebase: 'false'
159 exclude-no-code-change: 'true'
160 - draft-published-event
161 - comment-added-contains-event:
162 comment-contains-value: 'recheck'
164 - project-compare-type: 'ANT'
165 project-pattern: '{project}'
167 - branch-compare-type: 'ANT'
168 branch-pattern: '**/{branch}'
170 - compare-type: 'ANT'
173 # TODO: Unify argument names across gerrit-trigger-* macros.
175 name: gerrit-trigger-patch-merged
178 server-name: '{server-name}'
180 - change-merged-event
181 - comment-added-contains-event:
182 comment-contains-value: 'remerge'
184 - project-compare-type: 'ANT'
185 project-pattern: '{name}'
187 - branch-compare-type: 'ANT'
188 branch-pattern: '**/{branch}'
194 # Force Jenkins always vote the values it should already have voted
195 # during the prior verify phase
197 gerrit-build-started-verified-value: 1
198 gerrit-build-successful-verified-value: 1
199 gerrit-build-failed-verified-value: 1
200 gerrit-build-unstable-verified-value: 1
201 gerrit-build-notbuilt-verified-value: 1
202 gerrit-build-started-codereview-value: 0
203 gerrit-build-successful-codereview-value: 0
204 gerrit-build-failed-codereview-value: 0
205 gerrit-build-unstable-codereview-value: 0
206 gerrit-build-notbuilt-codereview-value: 0
208 # TODO: Unify argument names across gerrit-trigger-* macros.
210 name: gerrit-trigger-patch-sonar
213 server-name: '{server-name}'
215 - comment-added-contains-event:
216 comment-contains-value: 'run-sonar'
218 - project-compare-type: 'ANT'
219 project-pattern: '{name}'
221 - branch-compare-type: 'ANT'
222 branch-pattern: '**/master'
230 name: archive-artifacts
233 artifacts: '{artifacts}'
239 name: email-notification
242 recipients: '{email-recipients}'
244 content-type: default
245 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
247 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
249 Please refer to the logs server URL for console logs when possible
250 and use the Jenkins Build URL as a last resort.
253 https://logs.opendaylight.org/$SILO/$JENKINS_HOSTNAME/$JOB_NAME/$BUILD_NUMBER
266 exec-pattern: "**/**.exec"
267 class-pattern: "**/classes"
268 source-pattern: "**/src/main/java"
269 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
280 name: opendaylight-infra-shiplogs
281 # To archive things the job will need to create a "archives" directory in
282 # the workspace and this macro will handle copying the contents of the
283 # archives directory.
285 # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files
286 # to archive. You can pass globstar patterns for example "**/*.xml **/*.log"
287 # as the archive pattern. This is a space separated list of files to archive.
289 # Also ensure that the workspace is cleaned up at the end of the build.
293 - shell: !include-raw: include-raw-stack-delete.sh
294 - shell: !include-raw-escape: include-raw-deploy-archives.sh
296 maven-version: '{maven-version}'
297 pom: '.archives/deploy-archives.xml'
298 goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r'
299 settings: 'jenkins-log-archives-settings'
301 global-settings: 'odl-global-settings'
302 global-settings-type: cfp
303 - description-setter:
304 regexp: '^Build logs: .*'
305 # Cleanup after ourselves
306 - wipe-org-opendaylight-repo
307 script-only-if-succeeded: false
308 script-only-if-failed: false
309 mark-unstable-if-failed: true
312 # Do not clean up *.jenkins-trigger files for jobs that use a
313 # properties file as input for triggering another build.
314 - '**/*.jenkins-trigger'
318 name: opendaylight-infra-stack
319 # opendaylight-infra-stack.sh has a required variable {stack-template} that
320 # must be passed into this macro.
322 - shell: !include-raw: opendaylight-infra-stack.sh
323 - shell: !include-raw-escape: opendaylight-infra-copy-ssh-keys.sh
326 name: opendaylight-infra-push-gerrit-patch
327 # opendaylight-infra-push-gerrit-patch.sh allows a job to push a patch to
328 # Gerrit in an automated fashion. This is meant for tasks that creates
329 # the same patch regularly and needs the ability to detect if an unreviewed
330 # patch already exists. In which case it will update the existing patch.
332 # Note: This patch assumes the $WORKSPACE contains the project repo with
333 # the files changed already "git add" and waiting for a "git commit" call.
335 # This script requires the following JJB variables to be passed in:
336 # {project} Gerrit project-name
337 # {gerrit-topic} Gerrit topic, please make a unique topic.
338 # {gerrit-commit-message} Commit message to assign to commit.
339 # NOTE: Requires git review to be installed on node.
341 - shell: !include-raw: opendaylight-infra-push-gerrit-patch.sh
344 name: distribute-build-url
345 # Place URL of the current run of a build job to a file at given path.
347 - shell: 'echo "$BUILD_URL" > {path}/build.url'
350 name: wipe-org-opendaylight-repo
352 - shell: 'if [ -d /tmp/r/org/opendaylight ]; then rm -rf /tmp/r/org/opendaylight; fi'
355 name: wipe-local-maven-repo
357 - shell: 'if [ -d /tmp/r ]; then rm -rf /tmp/r; fi'
360 name: jacoco-nojava-workaround
362 - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
368 application-name: '{application-name}'
371 name: releng-check-unicode
374 $WORKSPACE/scripts/check-unicode.sh jjb/
377 name: provide-maven-settings
379 - config-file-provider:
381 - file-id: '{global-settings-file}'
382 variable: 'GLOBAL_SETTINGS_FILE'
383 - file-id: '{settings-file}'
384 variable: 'SETTINGS_FILE'
387 name: releng-fetch-p2zip-if-necessary
390 # Cleanup any existing zips and metadata before we download the new update site
393 condition-kind: strings-match
394 condition-string1: '$P2ZIP_URL'
395 condition-string2: ''
396 condition-basedir: workspace
398 # TODO: Figure out latest snapshot version number to pull rather than hardcoding 1.1.1-SNAPSHOT
400 maven-version: '{maven-version}'
402 org.apache.maven.plugins:maven-dependency-plugin:get
403 org.apache.maven.plugins:maven-dependency-plugin:copy
405 -Dartifact=org.opendaylight.yangide:org.opendaylight.yangide.update-site:1.1.1-SNAPSHOT:zip
406 -DoutputDirectory=$WORKSPACE
407 settings: '{settings}'
408 global-settings: '{global-settings}'
411 name: releng-generate-p2pom
413 - shell: !include-raw: include-raw-generate-p2pom.sh
416 name: releng-update-p2composite-metadata
418 - shell: !include-raw: include-raw-update-p2composite-metadata.sh
420 condition-kind: file-exists
421 condition-filename: deploy-composite-repo.xml
422 condition-basedir: workspace
425 maven-version: '{maven-version}'
426 pom: 'deploy-composite-repo.xml'
427 goals: 'clean deploy -V -B -Dmaven.repo.local=/tmp/r'
428 settings: '{settings}'
429 global-settings: '{global-settings}'
432 name: releng-stage-release
434 - shell: !include-raw: include-raw-stage-release.sh
437 # This wrapper is required for all jobs as it configures the wrappers
438 # needed by OpenDaylight infra.
439 name: opendaylight-infra-wrappers
442 - config-file-provider:
444 - file-id: rackspace-heat
445 target: '$HOME/.config/openstack/clouds.yaml'
448 timeout: '{build-timeout}'
449 timeout-var: 'BUILD_TIMEOUT'
452 - ssh-agent-credentials:
454 - 'opendaylight-jenkins-ssh'
459 name: packer-validate
461 - config-file-provider:
463 - file-id: 'packer-cloud-env'
467 varfiles="../packer/vars/*"
468 templates="../packer/templates/*"
469 provision="../packer/provision/*.sh"
470 for v in $varfiles; do
471 [[ "${v##*/}" =~ ^(cloud-env.*)$ ]] && continue
472 for t in $templates; do
473 export PACKER_LOG="yes" && \
474 export PACKER_LOG_PATH="packer-validate-${v##*/}-${t##*/}.log" && \
475 packer.io validate -var-file=$CLOUDENV \
477 if [ $? -ne 0 ]; then
482 for p in $provision; do
483 /bin/bash -n $p > provision-validate-${p##*/}.log 2>&1
490 - config-file-provider:
492 - file-id: 'packer-cloud-env'
496 export PACKER_LOG="yes" && \
497 export PACKER_LOG_PATH="packer-build.log" && \
498 packer.io build -var-file=$CLOUDENV \
499 -var-file=../packer/vars/{platform}.json \
500 ../packer/templates/{template}.json
503 # TODO: Verify signature after downloading users public key from a locally created
504 # repository instead of the public keymesh. This requires a process in place to get ODL
505 # developers public keys into a local repository without increasing the job thoughput.
506 name: verify-gpg-signature
508 - shell: !include-raw: include-raw-verify-gpg-signatures.sh
511 name: opendaylight-infra-jjbini
513 - config-file-provider:
516 target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini'