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
26 # 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
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"
44 description: "GERRIT_REFSPEC parameter if not given by trigger"
47 default: '$SILO-$JOB_NAME-$BUILD_NUMBER'
48 description: "Used by Heat to generate a unique stack & vm name"
53 The name of a cloud configuration in clouds.yaml. OS_CLOUD is a
54 variable name that is significant to openstack client as a
55 environment variable. Please refer to the documentation for
57 https://docs.openstack.org/developer/python-openstackclient/
65 description: 'Tag in Git to checkout'
68 name: controller-version-parameter
72 default: '{odl_version}'
73 description: 'Controller version (for use with openstacks networking_odl project)'
76 name: patches-to-build-parameter
79 name: PATCHES_TO_BUILD
82 Patches to add to distro in CSV project:changeset format (genius:32/53632/9,netvirt:59/50259/47)
85 name: run-test-parameter
90 description: 'Set true to run test after build'
93 name: distribution-branch-to-build-parameter
96 name: DISTRIBUTION_BRANCH_TO_BUILD
98 description: 'distribution repo branch to build with'
101 name: p2zip-parameter
106 description: 'Nexus staging profile id'
109 name: stage-id-parameter
112 name: STAGING_PROFILE_ID
113 default: '{stage-id}'
114 description: 'Nexus staging profile id'
121 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
122 description: 'Maven selector to be used by shell scripts'
128 credentials-id: 'opendaylight-jenkins-ssh'
137 name: git-scm-with-submodules
140 credentials-id: 'opendaylight-jenkins-ssh'
144 - 'refs/heads/{branch}'
151 name: gerrit-trigger-scm
154 credentials-id: 'opendaylight-jenkins-ssh'
158 - 'origin/$GERRIT_BRANCH'
160 choosing-strategy: '{choosing-strategy}'
170 # This is a single macro to use for all jobs who vote on every (relevant) patch set.
171 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
172 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
174 # server: name of gerrit server to listen to
175 # project: pattern to match triggering projects
176 # branch: triggering branch name
177 # files: pattern to match triggering filepaths
179 name: gerrit-trigger-patch-submitted
182 server-name: '{server}'
184 - patchset-created-event:
186 exclude-trivial-rebase: false
187 exclude-no-code-change: false
188 - draft-published-event
189 - comment-added-contains-event:
190 comment-contains-value: recheck
192 - project-compare-type: ANT
193 project-pattern: '{project}'
195 - branch-compare-type: ANT
196 branch-pattern: '**/{branch}'
201 # TODO: Unify argument names across gerrit-trigger-* macros.
203 name: gerrit-trigger-patch-merged
206 server-name: '{server-name}'
208 - change-merged-event
209 - comment-added-contains-event:
210 comment-contains-value: 'remerge'
212 - project-compare-type: 'ANT'
213 project-pattern: '{name}'
215 - branch-compare-type: 'ANT'
216 branch-pattern: '**/{branch}'
222 # Force Jenkins always vote the values it should already have voted
223 # during the prior verify phase
225 gerrit-build-started-verified-value: 1
226 gerrit-build-successful-verified-value: 1
227 gerrit-build-failed-verified-value: 1
228 gerrit-build-unstable-verified-value: 1
229 gerrit-build-notbuilt-verified-value: 1
230 gerrit-build-started-codereview-value: 0
231 gerrit-build-successful-codereview-value: 0
232 gerrit-build-failed-codereview-value: 0
233 gerrit-build-unstable-codereview-value: 0
234 gerrit-build-notbuilt-codereview-value: 0
236 # TODO: Unify argument names across gerrit-trigger-* macros.
238 name: gerrit-trigger-patch-sonar
241 server-name: '{server-name}'
243 - comment-added-contains-event:
244 comment-contains-value: 'run-sonar'
246 - project-compare-type: 'ANT'
247 project-pattern: '{name}'
249 - branch-compare-type: 'ANT'
250 branch-pattern: '**/master'
258 name: email-notification
261 recipients: '{email-recipients}'
263 content-type: default
264 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
266 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
268 Please refer to the logs server URL for console logs when possible
269 and use the Jenkins Build URL as a last resort.
272 https://logs.opendaylight.org/$SILO/$JENKINS_HOSTNAME/$JOB_NAME/$BUILD_NUMBER
285 exec-pattern: "**/**.exec"
286 class-pattern: "**/classes"
287 source-pattern: "**/src/main/java"
288 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
299 # Deploys a maven site to Nexus using lftools nexus-zip command
300 name: opendaylight-infra-deploy-maven-site
302 - lf-provide-maven-settings:
303 global-settings-file: global-settings
304 settings-file: '{settings-file}'
305 - lf-infra-create-netrc:
306 server-id: opendaylight-site
307 - shell: !include-raw-escape:
308 - global-jjb/shell/lftools-install.sh
309 - opendaylight-infra-deploy-maven-site.sh
310 - lf-provide-maven-settings-cleanup
313 name: opendaylight-infra-stack
314 # opendaylight-infra-stack.sh has a required variable {stack-template} that
315 # must be passed into this macro.
317 - shell: !include-raw: opendaylight-infra-stack.sh
318 - shell: !include-raw-escape: opendaylight-infra-copy-ssh-keys.sh
321 name: opendaylight-infra-push-gerrit-patch
322 # opendaylight-infra-push-gerrit-patch.sh allows a job to push a patch to
323 # Gerrit in an automated fashion. This is meant for tasks that creates
324 # the same patch regularly and needs the ability to detect if an unreviewed
325 # patch already exists. In which case it will update the existing patch.
327 # Note: This patch assumes the $WORKSPACE contains the project repo with
328 # the files changed already "git add" and waiting for a "git commit" call.
330 # This script requires the following JJB variables to be passed in:
331 # {project} Gerrit project-name
332 # {gerrit-topic} Gerrit topic, please make a unique topic.
333 # {gerrit-commit-message} Commit message to assign to commit.
334 # NOTE: Requires git review to be installed on node.
336 - shell: !include-raw: opendaylight-infra-push-gerrit-patch.sh
339 name: distribute-build-url
340 # Place URL of the current run of a build job to a file at given path.
344 set +e # DO NOT fail script if command returns non-zero.
346 echo "$BUILD_URL" > {path}/build.url
348 # DO NOT fail the build if the echo failed.
352 name: wipe-org-opendaylight-repo
354 - shell: 'if [ -d /tmp/r/org/opendaylight ]; then rm -rf /tmp/r/org/opendaylight; fi'
357 name: wipe-local-maven-repo
359 - shell: 'if [ -d /tmp/r ]; then rm -rf /tmp/r; fi'
362 name: jacoco-nojava-workaround
364 - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
370 application-name: '{application-name}'
373 name: releng-check-unicode
376 $WORKSPACE/scripts/check-unicode.sh jjb/
379 name: provide-maven-settings
381 - config-file-provider:
383 - file-id: '{global-settings-file}'
384 variable: 'GLOBAL_SETTINGS_FILE'
385 - file-id: '{settings-file}'
386 variable: 'SETTINGS_FILE'
389 name: releng-fetch-p2zip-if-necessary
392 # Cleanup any existing zips and metadata before we download the new update site
395 condition-kind: strings-match
396 condition-string1: '$P2ZIP_URL'
397 condition-string2: ''
398 condition-basedir: workspace
400 # TODO: Figure out latest snapshot version number to pull rather than hardcoding 1.1.1-SNAPSHOT
402 maven-version: '{maven-version}'
404 org.apache.maven.plugins:maven-dependency-plugin:get
405 org.apache.maven.plugins:maven-dependency-plugin:copy
407 -Dartifact=org.opendaylight.yangide:org.opendaylight.yangide.update-site:1.1.1-SNAPSHOT:zip
408 -DoutputDirectory=$WORKSPACE
409 settings: '{settings}'
410 global-settings: '{global-settings}'
413 name: releng-generate-p2pom
415 - shell: !include-raw: include-raw-generate-p2pom.sh
418 name: releng-update-p2composite-metadata
420 - shell: !include-raw: include-raw-update-p2composite-metadata.sh
422 condition-kind: file-exists
423 condition-filename: deploy-composite-repo.xml
424 condition-basedir: workspace
427 maven-version: '{maven-version}'
428 pom: 'deploy-composite-repo.xml'
429 goals: 'clean deploy -V -B -Dmaven.repo.local=/tmp/r'
430 settings: '{settings}'
431 global-settings: '{global-settings}'
434 name: releng-stage-release
436 - shell: !include-raw: include-raw-stage-release.sh
439 # This wrapper is required for all jobs as it configures the wrappers
440 # needed by OpenDaylight infra.
441 name: opendaylight-infra-wrappers
444 - config-file-provider:
447 target: '$HOME/.npmrc'
448 - file-id: rackspace-heat
449 target: '$HOME/.config/openstack/clouds.yaml'
452 timeout: '{build-timeout}'
453 timeout-var: 'BUILD_TIMEOUT'
456 - ssh-agent-credentials:
458 - 'opendaylight-jenkins-ssh'
463 # TODO: Verify signature after downloading users public key from a locally created
464 # repository instead of the public keymesh. This requires a process in place to get ODL
465 # developers public keys into a local repository without increasing the job thoughput.
466 name: verify-gpg-signature
468 - shell: !include-raw: include-raw-verify-gpg-signatures.sh
471 name: opendaylight-infra-jjbini
473 - config-file-provider:
476 target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini'
479 name: distribution-check-wipe
480 # Step zero: Wipe file repositories up front.
483 echo "wipe r: the local Maven repository"
485 echo "wipe n: the fake remote (Nexus) repository"
487 echo "wipe t: the transient repository used in some manipulations"
491 name: distribution-check-build-project
492 # Step one: Online build of the project, using local repository /tmp/r/ and deploying artifacts to /tmp/n/.
493 # Ordinary SingleFeatureTest failures are detected in the verify job, so we can use "q" profile here.
495 # pom: Relative path to pom file to use. Typically '$GERRIT_PROJECT/pom.xml'.
498 maven-version: 'mvn33'
501 clean deploy dependency:tree
502 -DoutputFile=dependency_tree.txt
504 -DaltDeploymentRepository=fake-nexus::default::file:///tmp/n/
507 - '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
508 settings: 'integration-settings'
510 global-settings: 'global-settings'
511 global-settings-type: cfp
514 name: distribution-check-verify-groupid
515 # Step two: Verify all deployed artifacts belong to the project's groupId.
516 # This is done by moving the allowed directories out of /tmp/n and checking no files remained there.
517 # The correct directory is derived from $GERRIT_PROJECT.
518 # TODO: Verify all deployed artifacts are snapshots.
520 # gerrit-project: Project name as nexus URI part. Typically '$GERRIT_PROJECT'.
523 mkdir -p /tmp/t/org/opendaylight/{gerrit-project}
524 mv /tmp/n/org/opendaylight/{gerrit-project}/* /tmp/t/org/opendaylight/{gerrit-project}/
525 test -z "`find /tmp/n/ -type f`" || ( echo "ERROR: Mismatched groupId detected (see above)." && false )
530 name: distribution-check-download-deps
531 # Step three: Online build of integration distribution.
532 # This step is mainly used for downloading other project artifacts.
533 # Running SingleFeaturesTest here does not seem to be required, so -Pq is used again.
535 # dist-pom: Relative path to pom file to use. 'distribution/pom.xml' is recommended.
538 maven-version: 'mvn33'
541 clean install dependency:tree
542 -DoutputFile=dependency_tree.txt
546 - '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
547 settings: 'integration-settings'
549 global-settings: 'global-settings'
550 global-settings-type: cfp
553 name: distribution-check-delete-snapshots
554 # Step four: Delete snapshot artifacts from the local repository.
555 # This is critical to detect orphaned artifacts or missing project-internal dependency declarations.
556 # Also other files related to maven repository resolution are removed,
557 # and then empty directories are removed, in order to simplify debugging.
559 - shell: !include-raw-escape: integration-distribution-delete-snaphot-artifacts.sh
562 name: distribution-check-configure-remotes
563 # Now the ugly part. It seems that the only way to tell Maven 2+
564 # which remote repositories to use is via settings.xml file.
565 # So we create such a file here, but it needs most of odlparent:settings.xml
569 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
570 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
571 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
572 https://maven.apache.org/xsd/settings-1.0.0.xsd">
575 <id>opendaylight-release</id>
578 <id>opendaylight-mirror</id>
579 <name>opendaylight</name>
580 <url>https://nexus.opendaylight.org/content/repositories/public/</url>
581 <releases><updatePolicy>never</updatePolicy></releases>
582 <snapshots><enabled>false</enabled></snapshots>
587 <id>opendaylight-plugin-mirror</id>
588 <name>opendaylight-plugin</name>
589 <url>https://nexus.opendaylight.org/content/repositories/public/</url>
590 <releases><updatePolicy>never</updatePolicy></releases>
591 <snapshots><enabled>false</enabled></snapshots>
593 </pluginRepositories>
596 <id>file-snapshots</id>
599 <id>file-snapshots</id>
601 <url>file:///tmp/n/</url>
602 <releases><enabled>false</enabled></releases>
607 <id>file-plugin-snapshots</id>
608 <name>file-plugin</name>
609 <url>file:///tmp/n/</url>
610 <releases><enabled>false</enabled></releases>
612 </pluginRepositories>
616 <activeProfile>file-snapshots</activeProfile>
617 <activeProfile>opendaylight-release</activeProfile>
621 # Notes: The settings are minimal in order to detect breakage scenarios,
622 # while allowing for the following quirks:
623 # * Some plugins seem to have hardcoded repos, for example check-license looks at repository.apache.org
624 # * Some plugin artifacts (related to surefire) are not downloaded when tests are skipped.
625 # * populate-local-repo looks at oss.sonatype.org and does not store things (like guava) to /tmp/r
628 name: distribution-check-repeat-build
629 # Step five: Repeat the distribution build but with the new settings.
630 # Here, only the project snapshot artifacts deployed to /tmp/n are available,
631 # which faithfully reproduces conditions in later verify-like job runs.
632 # We cannot use --offline, because: "Cannot access file (file:///tmp/n) in offline mode"
633 # This is where SingleFeatureTest is not skipped.
635 # dist-pom: Relative path to pom file to use. 'distribution/pom.xml' is recommended.
638 maven-version: 'mvn33'
641 clean install dependency:tree
642 -DoutputFile=dependency_tree.txt -s fake_remotes.xml
647 - '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'