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'
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 Check console output at $BUILD_URL to view the results.
256 exec-pattern: "**/**.exec"
257 class-pattern: "**/classes"
258 source-pattern: "**/src/main/java"
259 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
270 name: opendaylight-infra-shiplogs
271 # To archive things the job will need to create a "archives" directory in
272 # the workspace and this macro will handle copying the contents of the
273 # archives directory.
275 # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files
276 # to archive. You can pass globstar patterns for example "**/*.xml **/*.log"
277 # as the archive pattern. This is a space separated list of files to archive.
279 # Also ensure that the workspace is cleaned up at the end of the build.
284 if [ -d "$WORKSPACE/.venv-openstack" ]; then
285 source $WORKSPACE/.venv-openstack/bin/activate
286 openstack --os-cloud rackspace stack delete --yes $STACK_NAME
288 - shell: !include-raw: include-raw-deploy-archives.sh
290 maven-version: '{maven-version}'
291 pom: '.archives/deploy-archives.xml'
292 goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r'
293 settings: 'jenkins-log-archives-settings'
295 global-settings: 'odl-global-settings'
296 global-settings-type: cfp
297 - description-setter:
298 regexp: '^Build logs: .*'
299 # Cleanup after ourselves
300 - wipe-org-opendaylight-repo
301 script-only-if-succeeded: False
302 script-only-if-failed: False
303 mark-unstable-if-failed: True
306 # Do not clean up *.jenkins-trigger files for jobs that use a
307 # properties file as input for triggering another build.
308 - '**/*.jenkins-trigger'
312 name: opendaylight-infra-stack
313 # opendaylight-infra-stack.sh has a required variable {stack-template} that
314 # must be passed into this macro.
316 - shell: !include-raw: opendaylight-infra-stack.sh
317 - shell: !include-raw-escape: opendaylight-infra-copy-ssh-keys.sh
320 name: opendaylight-infra-push-gerrit-patch
321 # opendaylight-infra-push-gerrit-patch.sh allows a job to push a patch to
322 # Gerrit in an automated fashion. This is meant for tasks that creates
323 # the same patch regularly and needs the ability to detect if an unreviewed
324 # patch already exists. In which case it will update the existing patch.
326 # Note: This patch assumes the $WORKSPACE contains the project repo with
327 # the files changed already "git add" and waiting for a "git commit" call.
329 # This script requires the following JJB variables to be passed in:
330 # {project} Gerrit project-name
331 # {gerrit-topic} Gerrit topic, please make a unique topic.
332 # {gerrit-commit-message} Commit message to assign to commit.
333 # NOTE: Requires git review to be installed on node.
335 - shell: !include-raw: opendaylight-infra-push-gerrit-patch.sh
338 name: distribute-build-url
339 # Place URL of the current run of a build job to a file at given path.
341 - shell: 'echo "$BUILD_URL" > {path}/build.url'
344 name: wipe-org-opendaylight-repo
346 - shell: 'if [ -d /tmp/r/org/opendaylight ]; then rm -rf /tmp/r/org/opendaylight; fi'
349 name: wipe-local-maven-repo
351 - shell: 'if [ -d /tmp/r ]; then rm -rf /tmp/r; fi'
354 name: jacoco-nojava-workaround
356 - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
362 application-name: '{application-name}'
365 name: releng-check-unicode
368 $WORKSPACE/scripts/check-unicode.sh jjb/
371 name: provide-maven-settings
373 - config-file-provider:
375 - file-id: '{global-settings-file}'
376 variable: 'GLOBAL_SETTINGS_FILE'
377 - file-id: '{settings-file}'
378 variable: 'SETTINGS_FILE'
381 name: releng-fetch-p2zip-if-necessary
384 # Cleanup any existing zips and metadata before we download the new update site
387 condition-kind: strings-match
388 condition-string1: '$P2ZIP_URL'
389 condition-string2: ''
390 condition-basedir: workspace
392 # TODO: Figure out latest snapshot version number to pull rather than hardcoding 1.1.1-SNAPSHOT
394 maven-version: '{maven-version}'
395 goals: 'org.apache.maven.plugins:maven-dependency-plugin:get org.apache.maven.plugins:maven-dependency-plugin:copy -V -B -Dartifact=org.opendaylight.yangide:org.opendaylight.yangide.update-site:1.1.1-SNAPSHOT:zip -DoutputDirectory=$WORKSPACE'
396 settings: '{settings}'
397 global-settings: '{global-settings}'
400 name: releng-generate-p2pom
402 - shell: !include-raw: include-raw-generate-p2pom.sh
405 name: releng-update-p2composite-metadata
407 - shell: !include-raw: include-raw-update-p2composite-metadata.sh
409 condition-kind: file-exists
410 condition-filename: deploy-composite-repo.xml
411 condition-basedir: workspace
414 maven-version: '{maven-version}'
415 pom: 'deploy-composite-repo.xml'
416 goals: 'clean deploy -V -B -Dmaven.repo.local=/tmp/r'
417 settings: '{settings}'
418 global-settings: '{global-settings}'
421 name: releng-stage-release
423 - shell: !include-raw: include-raw-stage-release.sh
426 # This wrapper is required for all jobs as it configures the wrappers
427 # needed by OpenDaylight infra.
428 name: opendaylight-infra-wrappers
431 - config-file-provider:
433 - file-id: rackspace-heat
434 target: '$HOME/.config/openstack/clouds.yaml'
437 timeout: '{build-timeout}'
438 timeout-var: 'BUILD_TIMEOUT'
441 - ssh-agent-credentials:
443 - 'opendaylight-jenkins-ssh'
448 name: packer-validate
450 - config-file-provider:
452 - file-id: 'packer-cloud-env'
456 varfiles="../packer/vars/*"
457 templates="../packer/templates/*"
458 provision="../packer/provision/*.sh"
459 for v in $varfiles; do
460 [[ "${v##*/}" =~ ^(cloud-env.*)$ ]] && continue
461 for t in $templates; do
462 export PACKER_LOG="yes" && \
463 export PACKER_LOG_PATH="packer-validate-${v##*/}-${t##*/}.log" && \
464 packer.io validate -var-file=$CLOUDENV \
466 if [ $? -ne 0 ]; then
471 for p in $provision; do
472 /bin/bash -n $p > provision-validate-${p##*/}.log 2>&1
480 export PACKER_LOG="yes" && \
481 export PACKER_LOG_PATH="packer-build.log" && \
482 packer.io build -var-file=$CLOUDENV \
483 -var-file=../packer/vars/{platform}.json \
484 ../packer/templates/{template}.json
487 # TODO: Verify signature after downloading users public key from a locally created
488 # repository instead of the public keymesh. This requires a process in place to get ODL
489 # developers public keys into a local repository without increasing the job thoughput.
490 name: verify-gpg-signature
492 - shell: !include-raw: include-raw-verify-gpg-signatures.sh