4 name: opendaylight-infra-properties
7 days-to-keep: '{build-days-to-keep}'
10 name: opendaylight-infra-parameters
15 description: 'Parameter to identify an ODL Gerrit project'
17 name: ARCHIVE_ARTIFACTS
18 default: '{artifacts} **/target/surefire-reports/*-output.txt **/hs_err_*.log **/target/feature/feature.xml'
19 description: 'Space separated glob patterns for artifacts to archive into logs.opendaylight.org'
23 description: "GERRIT_PROJECT parameter if not given by trigger"
27 description: "JJB configured GERRIT_BRANCH parameter"
31 description: "GERRIT_REFSPEC parameter if not given by trigger"
34 default: '$JOB_NAME-$BUILD_NUMBER'
35 description: "Used by Heat to generate a unique stack & vm name"
43 description: 'Tag in Git to checkout'
46 name: controller-version-parameter
50 default: '{odl_version}'
51 description: 'Controller version (for use with openstacks networking_odl project)'
54 name: patches-to-build-parameter
57 name: PATCHES_TO_BUILD
59 description: 'csv list of patches in project:changeset format to build distribution with'
62 name: distribution-branch-to-build-parameter
65 name: DISTRIBUTION_BRANCH_TO_BUILD
67 description: 'distribution repo branch to build with'
75 description: 'Nexus staging profile id'
78 name: stage-id-parameter
81 name: STAGING_PROFILE_ID
83 description: 'Nexus staging profile id'
90 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
91 description: 'Maven selector to be used by shell scripts'
97 credentials-id: 'opendaylight-jenkins-ssh'
106 name: git-scm-with-submodules
109 credentials-id: 'opendaylight-jenkins-ssh'
113 - 'refs/heads/{branch}'
120 name: gerrit-trigger-scm
123 credentials-id: 'opendaylight-jenkins-ssh'
127 - 'origin/$GERRIT_BRANCH'
129 choosing-strategy: '{choosing-strategy}'
139 # This is a single macro to use for all jobs who vote on every (relevant) patch set.
140 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
141 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
143 # server: name of gerrit server to listen to
144 # project: pattern to match triggering projects
145 # branch: triggering branch name
146 # files: pattern to match triggering filepaths
148 name: gerrit-trigger-patch-submitted
151 server-name: '{server}'
153 - patchset-created-event:
154 exclude-drafts: 'true'
155 exclude-trivial-rebase: 'false'
156 exclude-no-code-change: 'true'
157 - draft-published-event
158 - comment-added-contains-event:
159 comment-contains-value: 'recheck'
161 - project-compare-type: 'ANT'
162 project-pattern: '{project}'
164 - branch-compare-type: 'ANT'
165 branch-pattern: '**/{branch}'
167 - compare-type: 'ANT'
170 # TODO: Unify argument names across gerrit-trigger-* macros.
172 name: gerrit-trigger-patch-merged
175 server-name: '{server-name}'
177 - change-merged-event
178 - comment-added-contains-event:
179 comment-contains-value: 'remerge'
181 - project-compare-type: 'ANT'
182 project-pattern: '{name}'
184 - branch-compare-type: 'ANT'
185 branch-pattern: '**/{branch}'
191 # Force Jenkins always vote the values it should already have voted
192 # during the prior verify phase
194 gerrit-build-started-verified-value: 1
195 gerrit-build-successful-verified-value: 1
196 gerrit-build-failed-verified-value: 1
197 gerrit-build-unstable-verified-value: 1
198 gerrit-build-notbuilt-verified-value: 1
199 gerrit-build-started-codereview-value: 0
200 gerrit-build-successful-codereview-value: 0
201 gerrit-build-failed-codereview-value: 0
202 gerrit-build-unstable-codereview-value: 0
203 gerrit-build-notbuilt-codereview-value: 0
205 # TODO: Unify argument names across gerrit-trigger-* macros.
207 name: gerrit-trigger-patch-sonar
210 server-name: '{server-name}'
212 - comment-added-contains-event:
213 comment-contains-value: 'run-sonar'
215 - project-compare-type: 'ANT'
216 project-pattern: '{name}'
218 - branch-compare-type: 'ANT'
219 branch-pattern: '**/master'
227 name: archive-artifacts
230 artifacts: '{artifacts}'
236 name: email-notification
239 recipients: '{email-recipients}'
241 content-type: default
242 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
244 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
246 Please refer to the logs server URL for console logs when possible
247 and use the Jenkins Build URL as a last resort.
250 https://logs.opendaylight.org/$SILO/$JENKINS_HOSTNAME/$JOB_NAME/$BUILD_NUMBER
263 exec-pattern: "**/**.exec"
264 class-pattern: "**/classes"
265 source-pattern: "**/src/main/java"
266 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
277 name: opendaylight-infra-shiplogs
278 # To archive things the job will need to create a "archives" directory in
279 # the workspace and this macro will handle copying the contents of the
280 # archives directory.
282 # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files
283 # to archive. You can pass globstar patterns for example "**/*.xml **/*.log"
284 # as the archive pattern. This is a space separated list of files to archive.
286 # Also ensure that the workspace is cleaned up at the end of the build.
290 - shell: !include-raw: include-raw-stack-delete.sh
291 - shell: !include-raw-escape: include-raw-deploy-archives.sh
293 maven-version: '{maven-version}'
294 pom: '.archives/deploy-archives.xml'
295 goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r'
296 settings: 'jenkins-log-archives-settings'
298 global-settings: 'odl-global-settings'
299 global-settings-type: cfp
300 - description-setter:
301 regexp: '^Build logs: .*'
302 # Cleanup after ourselves
303 - wipe-org-opendaylight-repo
304 script-only-if-succeeded: false
305 script-only-if-failed: false
306 mark-unstable-if-failed: true
309 # Do not clean up *.jenkins-trigger files for jobs that use a
310 # properties file as input for triggering another build.
311 - '**/*.jenkins-trigger'
315 name: opendaylight-infra-stack
316 # opendaylight-infra-stack.sh has a required variable {stack-template} that
317 # must be passed into this macro.
319 - shell: !include-raw: opendaylight-infra-stack.sh
320 - shell: !include-raw-escape: opendaylight-infra-copy-ssh-keys.sh
323 name: opendaylight-infra-push-gerrit-patch
324 # opendaylight-infra-push-gerrit-patch.sh allows a job to push a patch to
325 # Gerrit in an automated fashion. This is meant for tasks that creates
326 # the same patch regularly and needs the ability to detect if an unreviewed
327 # patch already exists. In which case it will update the existing patch.
329 # Note: This patch assumes the $WORKSPACE contains the project repo with
330 # the files changed already "git add" and waiting for a "git commit" call.
332 # This script requires the following JJB variables to be passed in:
333 # {project} Gerrit project-name
334 # {gerrit-topic} Gerrit topic, please make a unique topic.
335 # {gerrit-commit-message} Commit message to assign to commit.
336 # NOTE: Requires git review to be installed on node.
338 - shell: !include-raw: opendaylight-infra-push-gerrit-patch.sh
341 name: distribute-build-url
342 # Place URL of the current run of a build job to a file at given path.
344 - shell: 'echo "$BUILD_URL" > {path}/build.url'
347 name: wipe-org-opendaylight-repo
349 - shell: 'if [ -d /tmp/r/org/opendaylight ]; then rm -rf /tmp/r/org/opendaylight; fi'
352 name: wipe-local-maven-repo
354 - shell: 'if [ -d /tmp/r ]; then rm -rf /tmp/r; fi'
357 name: jacoco-nojava-workaround
359 - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
365 application-name: '{application-name}'
368 name: releng-check-unicode
371 $WORKSPACE/scripts/check-unicode.sh jjb/
374 name: provide-maven-settings
376 - config-file-provider:
378 - file-id: '{global-settings-file}'
379 variable: 'GLOBAL_SETTINGS_FILE'
380 - file-id: '{settings-file}'
381 variable: 'SETTINGS_FILE'
384 name: releng-fetch-p2zip-if-necessary
387 # Cleanup any existing zips and metadata before we download the new update site
390 condition-kind: strings-match
391 condition-string1: '$P2ZIP_URL'
392 condition-string2: ''
393 condition-basedir: workspace
395 # TODO: Figure out latest snapshot version number to pull rather than hardcoding 1.1.1-SNAPSHOT
397 maven-version: '{maven-version}'
399 org.apache.maven.plugins:maven-dependency-plugin:get
400 org.apache.maven.plugins:maven-dependency-plugin:copy
402 -Dartifact=org.opendaylight.yangide:org.opendaylight.yangide.update-site:1.1.1-SNAPSHOT:zip
403 -DoutputDirectory=$WORKSPACE
404 settings: '{settings}'
405 global-settings: '{global-settings}'
408 name: releng-generate-p2pom
410 - shell: !include-raw: include-raw-generate-p2pom.sh
413 name: releng-update-p2composite-metadata
415 - shell: !include-raw: include-raw-update-p2composite-metadata.sh
417 condition-kind: file-exists
418 condition-filename: deploy-composite-repo.xml
419 condition-basedir: workspace
422 maven-version: '{maven-version}'
423 pom: 'deploy-composite-repo.xml'
424 goals: 'clean deploy -V -B -Dmaven.repo.local=/tmp/r'
425 settings: '{settings}'
426 global-settings: '{global-settings}'
429 name: releng-stage-release
431 - shell: !include-raw: include-raw-stage-release.sh
434 # This wrapper is required for all jobs as it configures the wrappers
435 # needed by OpenDaylight infra.
436 name: opendaylight-infra-wrappers
439 - config-file-provider:
441 - file-id: rackspace-heat
442 target: '$HOME/.config/openstack/clouds.yaml'
445 timeout: '{build-timeout}'
446 timeout-var: 'BUILD_TIMEOUT'
449 - ssh-agent-credentials:
451 - 'opendaylight-jenkins-ssh'
456 name: packer-validate
458 - config-file-provider:
460 - file-id: 'packer-cloud-env'
464 varfiles="../packer/vars/*"
465 templates="../packer/templates/*"
466 provision="../packer/provision/*.sh"
467 for v in $varfiles; do
468 [[ "${v##*/}" =~ ^(cloud-env.*)$ ]] && continue
469 for t in $templates; do
470 export PACKER_LOG="yes" && \
471 export PACKER_LOG_PATH="packer-validate-${v##*/}-${t##*/}.log" && \
472 packer.io validate -var-file=$CLOUDENV \
474 if [ $? -ne 0 ]; then
479 for p in $provision; do
480 /bin/bash -n $p > provision-validate-${p##*/}.log 2>&1
487 - config-file-provider:
489 - file-id: 'packer-cloud-env'
493 export PACKER_LOG="yes" && \
494 export PACKER_LOG_PATH="packer-build.log" && \
495 packer.io build -var-file=$CLOUDENV \
496 -var-file=../packer/vars/{platform}.json \
497 ../packer/templates/{template}.json
500 # TODO: Verify signature after downloading users public key from a locally created
501 # repository instead of the public keymesh. This requires a process in place to get ODL
502 # developers public keys into a local repository without increasing the job thoughput.
503 name: verify-gpg-signature
505 - shell: !include-raw: include-raw-verify-gpg-signatures.sh
508 name: opendaylight-infra-jjbini
510 - config-file-provider:
513 target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini'