3 # Template used for running CLM scans
5 # {name} - Project Shortname
6 # {project} - Fully qualified project name
7 # {mvn-settings} - Project maven settings file
10 name: '{project-name}-clm-{stream}'
12 project-type: freestyle
17 - opendaylight-infra-properties:
18 build-days-to-keep: '{build-days-to-keep}'
21 - opendaylight-infra-parameters:
24 refspec: 'refs/heads/{branch}'
25 artifacts: '{archive-artifacts}'
33 - opendaylight-infra-wrappers:
34 build-timeout: '{build-timeout}'
40 - provide-maven-settings:
41 global-settings-file: 'odl-global-settings'
42 settings-file: '{mvn-settings}'
44 maven-version: 'mvn33'
47 clean install dependency:tree com.sonatype.clm:clm-maven-plugin:index
50 -Dmaven.repo.local=/tmp/r
51 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
53 - '-Xmx4096m -XX:MaxPermSize=512m'
54 settings: '{mvn-settings}'
56 global-settings: 'odl-global-settings'
57 global-settings-type: cfp
58 - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
60 application-name: '{project-name}'
64 email-recipients: '{email-recipients}'
65 email-prefix: '[{project-name}]'
66 - opendaylight-infra-shiplogs:
67 maven-version: 'mvn33'
70 # Template: {project-name}-distribution-check-{stream}
71 # Goal: Build a patch and make sure the distribution can deploy with this change.
72 # Operation: This job template builds a patch, creates a distribution containing
73 # the patch (making sure dependencies are specified),
74 # and performs the distribution deploy test.
76 name: '{project-name}-distribution-check-{stream}'
79 project-type: freestyle
85 - opendaylight-infra-properties:
86 build-days-to-keep: '{build-days-to-keep}'
89 - opendaylight-infra-parameters:
92 refspec: 'refs/heads/{branch}'
93 artifacts: '{archive-artifacts} **/dependency_tree.txt **/target/surefire-reports/*-output.txt'
94 - integration-distribution-git-url:
98 - integration-gerrit-scm:
99 basedir: '$GERRIT_PROJECT'
100 refspec: '$GERRIT_REFSPEC'
102 - integration-distribution-scm:
103 branch: '{distribution_branch}'
106 - opendaylight-infra-wrappers:
107 # Distro-check jobs typically run within 10 - 30 minutes
108 # with 45 minutes being the occassional edge case.
109 # enforce a 60 minute limit to ensure stuck jobs get
114 - gerrit-trigger-patch-submitted:
115 server: '{server-name}'
121 # Step zero: Wipe file repositories up front.
123 echo "wipe r: the local Maven repository"
125 echo "wipe n: the fake remote (Nexus) repository"
127 echo "wipe t: the transient repository used in some manipulations"
129 # Step one: Online build of the project, using local repository /tmp/r/ and deploying artifacts to /tmp/n/.
130 # Ordinary SingleFeatureTest failures are detected in the verify job, so we can use "q" profile here.
132 maven-version: 'mvn33'
133 pom: '$GERRIT_PROJECT/pom.xml'
135 clean deploy dependency:tree
136 -DoutputFile=dependency_tree.txt
140 -DaltDeploymentRepository=fake-nexus::default::file:///tmp/n/
141 -Dmaven.repo.local=/tmp/r
142 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
144 - '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
145 settings: '{mvn-settings}'
147 global-settings: 'odl-global-settings'
148 global-settings-type: cfp
149 # Step two: Verify all deployed artifacts belong to the project's groupId.
150 # This is done by moving the allowed directories out of /tmp/n and checking no files remained there.
151 # The correct directory is derived from $GERRIT_PROJECT.
153 mkdir -p /tmp/t/org/opendaylight/$GERRIT_PROJECT
154 mv /tmp/n/org/opendaylight/$GERRIT_PROJECT/* /tmp/t/org/opendaylight/$GERRIT_PROJECT/
155 test `find /tmp/n/ -type f | wc -l` -eq 0
158 # Step three: Online build of integration distribution.
159 # This step is mainly used for downloading other project artifacts.
160 # Running SingleFeaturesTest here does not seem to be required, so -Pq is used again.
162 maven-version: 'mvn33'
163 pom: 'distribution/pom.xml'
165 clean install dependency:tree
166 -DoutputFile=dependency_tree.txt
170 -Dmaven.repo.local=/tmp/r
171 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
173 - '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
174 settings: '{mvn-settings}'
176 global-settings: 'odl-global-settings'
177 global-settings-type: cfp
178 # Step four: Delete snapshot artifacts from the local repository.
179 # This is critical to detect orphaned artifacts or missing project-internal dependency declarations.
180 # Also other files related to maven repository resolution are removed,
181 # and then empty directories are removed, in order to simplify debugging.
182 - shell: !include-raw-escape: integration-distribution-delete-snaphot-artifacts.sh
183 # Now the ugly part. It seems that the only way to tell Maven 2+
184 # which remote repositories to use is via settings.xml file.
185 # So we create such a file here, but it needs most of odlparent:settings.xml
188 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
189 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
190 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
191 https://maven.apache.org/xsd/settings-1.0.0.xsd">
194 <id>opendaylight-release</id>
197 <id>opendaylight-mirror</id>
198 <name>opendaylight</name>
199 <url>https://nexus.opendaylight.org/content/repositories/public/</url>
200 <releases><updatePolicy>never</updatePolicy></releases>
201 <snapshots><enabled>false</enabled></snapshots>
206 <id>opendaylight-plugin-mirror</id>
207 <name>opendaylight-plugin</name>
208 <url>https://nexus.opendaylight.org/content/repositories/public/</url>
209 <releases><updatePolicy>never</updatePolicy></releases>
210 <snapshots><enabled>false</enabled></snapshots>
212 </pluginRepositories>
215 <id>file-snapshots</id>
218 <id>file-snapshots</id>
220 <url>file:///tmp/n/</url>
221 <releases><enabled>false</enabled></releases>
226 <id>file-plugin-snapshots</id>
227 <name>file-plugin</name>
228 <url>file:///tmp/n/</url>
229 <releases><enabled>false</enabled></releases>
231 </pluginRepositories>
235 <activeProfile>file-snapshots</activeProfile>
236 <activeProfile>opendaylight-release</activeProfile>
240 # # Notes: The settings are minimal in order to detect breakage scenarios while allowing for the following quirks:
241 # # * Some plugins seem to have hardcoded repos, for example check-license looks at repository.apache.org
242 # # * Some plugin artifacts (related to surefire) are not downloaded when tests are skipped.
243 # # * populate-local-repo looks at oss.sonatype.org and does not store things (like guava) to /tmp/r
244 # Step five: Repeat the distribution build but with the new settings.
245 # Here, only the project snapshot artifacts deployed to /tmp/n are available,
246 # which faithfully reproduces conditions in later verify-like job runs.
247 # We cannot use --offline, because: "Cannot access file (file:///tmp/n) in offline mode"
248 # This is where SingleFeatureTest is not skipped.
250 maven-version: 'mvn33'
251 pom: 'distribution/pom.xml'
253 clean install dependency:tree
254 -DoutputFile=dependency_tree.txt -s fake_remotes.xml
259 -Dmaven.repo.local=/tmp/r
260 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
262 - '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
263 # Step six: Run Karaf and verify no critical failures are present.
264 - integration-distribution-check
267 - email-notification:
268 email-recipients: '{email-recipients}'
269 email-prefix: '[{project-name}]'
274 mkdir -p $WORKSPACE/archives
275 cp karaf*.log $WORKSPACE/archives
276 script-only-if-succeeded: false
277 script-only-if-failed: false
278 mark-unstable-if-failed: true
281 - opendaylight-infra-shiplogs:
282 maven-version: 'mvn33'
285 name: '{project-name}-integration-{stream}'
287 # Job template for ODL integration verify jobs
289 # This is similar to a normal verify job, but it runs
290 # when a project that's a dependency of your project
291 # is successfully built.
293 # Required Variables:
294 # stream: release stream (eg. boron or carbon)
295 # branch: git branch (eg. stable/boron or master)
297 project-type: freestyle
302 - opendaylight-infra-properties:
303 build-days-to-keep: '{build-days-to-keep}'
306 - opendaylight-infra-parameters:
309 refspec: 'refs/heads/{branch}'
310 artifacts: '{archive-artifacts}'
318 - opendaylight-infra-wrappers:
319 build-timeout: '{build-timeout}'
323 jobs: '{dependencies}'
327 - jacoco-nojava-workaround
328 - provide-maven-settings:
329 global-settings-file: 'odl-global-settings'
330 settings-file: '{mvn-settings}'
332 maven-version: 'mvn33'
333 goals: '{mvn-goals} -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
336 settings: '{mvn-settings}'
338 global-settings: 'odl-global-settings'
339 global-settings-type: cfp
342 - email-notification:
343 email-recipients: '{email-recipients}'
344 email-prefix: '{email-upstream}'
347 - opendaylight-infra-shiplogs:
348 maven-version: 'mvn33'
351 name: '{project-name}-merge-{stream}'
353 # Job template for ODL merge jobs
355 # The purpose of this job template is to setup a ODL merge job
356 # and deploy artifacts to Nexus.
358 # Required Variables:
359 # stream: release stream (eg. boron or carbon)
360 # branch: git branch (eg. stable/boron or master)
362 # Need to keep jobs that deploy to Nexus at end of build as Maven
363 # projects. Maybe reconsider this once upstream moves deploy to a
364 # separate lifecycle:
365 # https://issues.apache.org/jira/browse/MNG-5666
371 - opendaylight-infra-properties:
372 build-days-to-keep: 14
375 - opendaylight-infra-parameters:
378 refspec: 'refs/heads/{branch}'
379 artifacts: '{archive-artifacts}'
382 - gerrit-trigger-scm:
384 choosing-strategy: 'default'
387 - opendaylight-infra-wrappers:
388 build-timeout: '{build-timeout}'
392 - gerrit-trigger-patch-merged:
393 server-name: '{server-name}'
398 - jacoco-nojava-workaround
399 - provide-maven-settings:
400 global-settings-file: 'odl-global-settings'
401 settings-file: '{mvn-settings}'
403 # TODO: Do we want to apply sophisticated checks as in *-distribution-check-*?
412 -Dmaven.repo.local=/tmp/r
413 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
414 maven-opts: '{mvn-opts}'
415 settings: '{mvn-settings}'
417 global-settings: 'odl-global-settings'
418 global-settings-type: cfp
419 post-step-run-condition: UNSTABLE
423 condition-kind: file-exists
424 condition-filename: deploy-site.xml
425 condition-basedir: workspace
427 # The strategy here is intentional to run Maven site:deploy twice
428 # once using regular pom.xml to produce a staged-site which is
429 # then used by deploy-site.xml to push to Nexus. This is a
430 # workaround to Maven Site's default linking code which creates
431 # incorrect URLs for sites due to auto-detection assuming your
432 # project is configured in a certain way which ODL is not.
435 maven-version: 'mvn33'
437 goals: 'site:deploy -V -B -Dstream={stream}'
440 settings: '{mvn-settings}'
442 global-settings: 'odl-global-settings'
443 global-settings-type: cfp
445 maven-version: 'mvn33'
447 goals: 'site:deploy -V -B -Dstream={stream}'
450 settings: '{mvn-settings}'
452 global-settings: 'odl-global-settings'
453 global-settings-type: cfp
459 - email-notification:
460 email-recipients: '{email-recipients}'
461 email-prefix: '[{project-name}]'
465 deploy-unstable: false
467 - opendaylight-infra-shiplogs:
468 maven-version: 'mvn33'
470 project: 'distribution-merge-{stream}'
474 name: '{project-name}-sonar'
477 project-type: freestyle
482 - opendaylight-infra-properties:
483 build-days-to-keep: 7
486 - opendaylight-infra-parameters:
489 refspec: 'refs/heads/{branch}'
490 artifacts: '{archive-artifacts}'
498 - opendaylight-infra-wrappers:
499 build-timeout: '{build-timeout}'
503 - gerrit-trigger-patch-sonar:
504 server-name: '{server-name}'
506 # FIXME: Make sure this does not alter Gerrit votes, then update docs.
509 - jacoco-nojava-workaround
510 - provide-maven-settings:
511 global-settings-file: 'odl-global-settings'
512 settings-file: '{mvn-settings}'
514 maven-version: 'mvn33'
520 -Dmaven.repo.local=/tmp/r
521 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
524 settings: '{mvn-settings}'
526 global-settings: 'odl-global-settings'
527 global-settings-type: cfp
529 maven-version: 'mvn33'
530 # We should switch to the recommended configuration of sonar once
531 # JJB adds support for configurating the Sonar wrapper:
532 # http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
537 -Dsonar.host.url=https://sonar.opendaylight.org
538 -Dmaven.repo.local=/tmp/r
539 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
542 settings: '{mvn-settings}'
544 global-settings: 'odl-global-settings'
545 global-settings-type: cfp
548 - email-notification:
549 email-recipients: '{email-recipients}'
550 email-prefix: '[{project-name}]'
553 - opendaylight-infra-shiplogs:
554 maven-version: 'mvn33'
557 name: '{project-name}-validate-autorelease-{stream}'
560 project-type: freestyle
566 - opendaylight-infra-properties:
567 build-days-to-keep: 7
570 - opendaylight-infra-parameters:
573 refspec: 'refs/heads/{branch}'
574 artifacts: '{archive-artifacts}'
575 - autorelease-release-tag:
576 release-tag: 'validate'
577 - autorelease-release-branch:
578 release-branch: '{branch}'
581 default: '{git-url}/releng/autorelease'
582 description: "Autorelease clone URL"
587 credentials-id: 'opendaylight-jenkins-ssh'
597 - opendaylight-infra-wrappers:
598 build-timeout: '{build-timeout}'
601 - gerrit-trigger-patch-submitted:
602 server: '{server-name}'
608 - jacoco-nojava-workaround
609 - autorelease-checkout-gerrit-patch
610 - autorelease-generate-release-patches
611 # In a perfect world projects should be releasing separately and we consume them
612 # via a project that pulls the release bits from each project from Nexus.
613 # Keep the patches compatible with that ideal, but apply an edit
614 # to enable building in a single maven reactor afterwards.
615 - autorelease-fix-relative-paths
617 maven-version: 'mvn33'
618 pom: validate-pom.xml
620 clean install dependency:tree
623 -Dmaven.repo.local=/tmp/r
624 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
627 settings: 'autorelease-settings'
629 global-settings: 'odl-global-settings'
630 global-settings-type: cfp
632 maven-version: 'mvn33'
638 -Dmaven.repo.local=/tmp/r
639 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
641 - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
642 settings: 'autorelease-settings'
644 global-settings: 'odl-global-settings'
645 global-settings-type: cfp
646 - autorelease-sys-stats
649 - email-notification:
650 email-recipients: '{email-recipients}'
651 email-prefix: '[autorelease] [{project-name}]'
652 - opendaylight-infra-shiplogs:
653 maven-version: 'mvn33'
656 name: '{project-name}-verify-{stream}-{maven}-{jdks}'
658 # Job template for ODL verify jobs
660 # The purpose of this job template is to setup a ODL verify job
662 # Required Variables:
663 # stream: release stream (eg. boron or carbon)
664 # branch: git branch (eg. stable/boron or master)
666 project-type: freestyle
672 - opendaylight-infra-properties:
673 build-days-to-keep: 7
676 - opendaylight-infra-parameters:
679 refspec: 'refs/heads/{branch}'
680 artifacts: '{archive-artifacts}'
683 - gerrit-trigger-scm:
684 refspec: '$GERRIT_REFSPEC'
685 choosing-strategy: 'gerrit'
688 - opendaylight-infra-wrappers:
689 build-timeout: '{build-timeout}'
692 - gerrit-trigger-patch-submitted:
693 server: '{server-name}'
699 - jacoco-nojava-workaround
700 - provide-maven-settings:
701 global-settings-file: 'odl-global-settings'
702 settings-file: '{mvn-settings}'
704 maven-version: '{mvn-version}'
709 -Dmaven.repo.local=/tmp/r
710 -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
713 settings: '{mvn-settings}'
715 global-settings: 'odl-global-settings'
716 global-settings-type: cfp
720 - email-notification:
721 email-recipients: '{email-recipients}'
722 email-prefix: '[{project-name}]'
724 - opendaylight-infra-shiplogs:
725 maven-version: '{mvn-version}'