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
23 **/target/surefire-reports/*-output.txt
25 **/target/feature/feature.xml
27 description: 'Space separated glob patterns for artifacts to archive into logs.opendaylight.org'
31 description: "GERRIT_PROJECT parameter if not given by trigger"
35 description: "JJB configured GERRIT_BRANCH parameter"
39 description: "GERRIT_REFSPEC parameter if not given by trigger"
42 default: '$JOB_NAME-$BUILD_NUMBER'
43 description: "Used by Heat to generate a unique stack & vm name"
51 description: 'Tag in Git to checkout'
54 name: controller-version-parameter
58 default: '{odl_version}'
59 description: 'Controller version (for use with openstacks networking_odl project)'
62 name: patches-to-build-parameter
65 name: PATCHES_TO_BUILD
67 description: 'csv list of patches in project:changeset format to build distribution with'
70 name: distribution-branch-to-build-parameter
73 name: DISTRIBUTION_BRANCH_TO_BUILD
75 description: 'distribution repo branch to build with'
83 description: 'Nexus staging profile id'
86 name: stage-id-parameter
89 name: STAGING_PROFILE_ID
91 description: 'Nexus staging profile id'
98 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
99 description: 'Maven selector to be used by shell scripts'
105 credentials-id: 'opendaylight-jenkins-ssh'
114 name: git-scm-with-submodules
117 credentials-id: 'opendaylight-jenkins-ssh'
121 - 'refs/heads/{branch}'
128 name: gerrit-trigger-scm
131 credentials-id: 'opendaylight-jenkins-ssh'
135 - 'origin/$GERRIT_BRANCH'
137 choosing-strategy: '{choosing-strategy}'
147 # This is a single macro to use for all jobs who vote on every (relevant) patch set.
148 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
149 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
151 # server: name of gerrit server to listen to
152 # project: pattern to match triggering projects
153 # branch: triggering branch name
154 # files: pattern to match triggering filepaths
156 name: gerrit-trigger-patch-submitted
159 server-name: '{server}'
161 - patchset-created-event:
162 exclude-drafts: 'true'
163 exclude-trivial-rebase: 'false'
164 exclude-no-code-change: 'true'
165 - draft-published-event
166 - comment-added-contains-event:
167 comment-contains-value: 'recheck'
169 - project-compare-type: 'ANT'
170 project-pattern: '{project}'
172 - branch-compare-type: 'ANT'
173 branch-pattern: '**/{branch}'
175 - compare-type: 'ANT'
178 # TODO: Unify argument names across gerrit-trigger-* macros.
180 name: gerrit-trigger-patch-merged
183 server-name: '{server-name}'
185 - change-merged-event
186 - comment-added-contains-event:
187 comment-contains-value: 'remerge'
189 - project-compare-type: 'ANT'
190 project-pattern: '{name}'
192 - branch-compare-type: 'ANT'
193 branch-pattern: '**/{branch}'
199 # Force Jenkins always vote the values it should already have voted
200 # during the prior verify phase
202 gerrit-build-started-verified-value: 1
203 gerrit-build-successful-verified-value: 1
204 gerrit-build-failed-verified-value: 1
205 gerrit-build-unstable-verified-value: 1
206 gerrit-build-notbuilt-verified-value: 1
207 gerrit-build-started-codereview-value: 0
208 gerrit-build-successful-codereview-value: 0
209 gerrit-build-failed-codereview-value: 0
210 gerrit-build-unstable-codereview-value: 0
211 gerrit-build-notbuilt-codereview-value: 0
213 # TODO: Unify argument names across gerrit-trigger-* macros.
215 name: gerrit-trigger-patch-sonar
218 server-name: '{server-name}'
220 - comment-added-contains-event:
221 comment-contains-value: 'run-sonar'
223 - project-compare-type: 'ANT'
224 project-pattern: '{name}'
226 - branch-compare-type: 'ANT'
227 branch-pattern: '**/master'
235 name: archive-artifacts
238 artifacts: '{artifacts}'
244 name: email-notification
247 recipients: '{email-recipients}'
249 content-type: default
250 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
252 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
254 Please refer to the logs server URL for console logs when possible
255 and use the Jenkins Build URL as a last resort.
258 https://logs.opendaylight.org/$SILO/$JENKINS_HOSTNAME/$JOB_NAME/$BUILD_NUMBER
271 exec-pattern: "**/**.exec"
272 class-pattern: "**/classes"
273 source-pattern: "**/src/main/java"
274 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
285 name: opendaylight-infra-shiplogs
286 # To archive things the job will need to create a "archives" directory in
287 # the workspace and this macro will handle copying the contents of the
288 # archives directory.
290 # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files
291 # to archive. You can pass globstar patterns for example "**/*.xml **/*.log"
292 # as the archive pattern. This is a space separated list of files to archive.
294 # Also ensure that the workspace is cleaned up at the end of the build.
298 - shell: !include-raw: include-raw-stack-delete.sh
299 - shell: !include-raw-escape: include-raw-deploy-archives.sh
301 maven-version: '{maven-version}'
302 pom: '.archives/deploy-archives.xml'
303 goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r'
304 settings: 'jenkins-log-archives-settings'
306 global-settings: 'odl-global-settings'
307 global-settings-type: cfp
308 - description-setter:
309 regexp: '^Build logs: .*'
310 # Cleanup after ourselves
311 - wipe-org-opendaylight-repo
312 script-only-if-succeeded: false
313 script-only-if-failed: false
314 mark-unstable-if-failed: true
317 # Do not clean up *.jenkins-trigger files for jobs that use a
318 # properties file as input for triggering another build.
319 - '**/*.jenkins-trigger'
323 name: opendaylight-infra-stack
324 # opendaylight-infra-stack.sh has a required variable {stack-template} that
325 # must be passed into this macro.
327 - shell: !include-raw: opendaylight-infra-stack.sh
328 - shell: !include-raw-escape: opendaylight-infra-copy-ssh-keys.sh
331 name: opendaylight-infra-push-gerrit-patch
332 # opendaylight-infra-push-gerrit-patch.sh allows a job to push a patch to
333 # Gerrit in an automated fashion. This is meant for tasks that creates
334 # the same patch regularly and needs the ability to detect if an unreviewed
335 # patch already exists. In which case it will update the existing patch.
337 # Note: This patch assumes the $WORKSPACE contains the project repo with
338 # the files changed already "git add" and waiting for a "git commit" call.
340 # This script requires the following JJB variables to be passed in:
341 # {project} Gerrit project-name
342 # {gerrit-topic} Gerrit topic, please make a unique topic.
343 # {gerrit-commit-message} Commit message to assign to commit.
344 # NOTE: Requires git review to be installed on node.
346 - shell: !include-raw: opendaylight-infra-push-gerrit-patch.sh
349 name: distribute-build-url
350 # Place URL of the current run of a build job to a file at given path.
352 - shell: 'echo "$BUILD_URL" > {path}/build.url'
355 name: wipe-org-opendaylight-repo
357 - shell: 'if [ -d /tmp/r/org/opendaylight ]; then rm -rf /tmp/r/org/opendaylight; fi'
360 name: wipe-local-maven-repo
362 - shell: 'if [ -d /tmp/r ]; then rm -rf /tmp/r; fi'
365 name: jacoco-nojava-workaround
367 - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
373 application-name: '{application-name}'
376 name: releng-check-unicode
379 $WORKSPACE/scripts/check-unicode.sh jjb/
382 name: provide-maven-settings
384 - config-file-provider:
386 - file-id: '{global-settings-file}'
387 variable: 'GLOBAL_SETTINGS_FILE'
388 - file-id: '{settings-file}'
389 variable: 'SETTINGS_FILE'
392 name: releng-fetch-p2zip-if-necessary
395 # Cleanup any existing zips and metadata before we download the new update site
398 condition-kind: strings-match
399 condition-string1: '$P2ZIP_URL'
400 condition-string2: ''
401 condition-basedir: workspace
403 # TODO: Figure out latest snapshot version number to pull rather than hardcoding 1.1.1-SNAPSHOT
405 maven-version: '{maven-version}'
407 org.apache.maven.plugins:maven-dependency-plugin:get
408 org.apache.maven.plugins:maven-dependency-plugin:copy
410 -Dartifact=org.opendaylight.yangide:org.opendaylight.yangide.update-site:1.1.1-SNAPSHOT:zip
411 -DoutputDirectory=$WORKSPACE
412 settings: '{settings}'
413 global-settings: '{global-settings}'
416 name: releng-generate-p2pom
418 - shell: !include-raw: include-raw-generate-p2pom.sh
421 name: releng-update-p2composite-metadata
423 - shell: !include-raw: include-raw-update-p2composite-metadata.sh
425 condition-kind: file-exists
426 condition-filename: deploy-composite-repo.xml
427 condition-basedir: workspace
430 maven-version: '{maven-version}'
431 pom: 'deploy-composite-repo.xml'
432 goals: 'clean deploy -V -B -Dmaven.repo.local=/tmp/r'
433 settings: '{settings}'
434 global-settings: '{global-settings}'
437 name: releng-stage-release
439 - shell: !include-raw: include-raw-stage-release.sh
442 # This wrapper is required for all jobs as it configures the wrappers
443 # needed by OpenDaylight infra.
444 name: opendaylight-infra-wrappers
447 - config-file-provider:
449 - file-id: rackspace-heat
450 target: '$HOME/.config/openstack/clouds.yaml'
453 timeout: '{build-timeout}'
454 timeout-var: 'BUILD_TIMEOUT'
457 - ssh-agent-credentials:
459 - 'opendaylight-jenkins-ssh'
464 name: packer-validate
466 - config-file-provider:
468 - file-id: 'packer-cloud-env'
472 varfiles="../packer/vars/*"
473 templates="../packer/templates/*"
474 provision="../packer/provision/*.sh"
475 for v in $varfiles; do
476 [[ "${v##*/}" =~ ^(cloud-env.*)$ ]] && continue
477 for t in $templates; do
478 export PACKER_LOG="yes" && \
479 export PACKER_LOG_PATH="packer-validate-${v##*/}-${t##*/}.log" && \
480 packer.io validate -var-file=$CLOUDENV \
482 if [ $? -ne 0 ]; then
487 for p in $provision; do
488 /bin/bash -n $p > provision-validate-${p##*/}.log 2>&1
495 - config-file-provider:
497 - file-id: 'packer-cloud-env'
501 export PACKER_LOG="yes" && \
502 export PACKER_LOG_PATH="packer-build.log" && \
503 packer.io build -color=false -var-file=$CLOUDENV \
504 -var-file=../packer/vars/{platform}.json \
505 ../packer/templates/{template}.json
508 # TODO: Verify signature after downloading users public key from a locally created
509 # repository instead of the public keymesh. This requires a process in place to get ODL
510 # developers public keys into a local repository without increasing the job thoughput.
511 name: verify-gpg-signature
513 - shell: !include-raw: include-raw-verify-gpg-signatures.sh
516 name: opendaylight-infra-jjbini
518 - config-file-provider:
521 target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini'