2 # Template used for running CLM scans
4 # {name} - Project Shortname
5 # {project} - Fully qualified project name
6 # {mvn-settings} - Project maven settings file
9 name: '{project-name}-clm-{stream}'
11 project-type: freestyle
16 - opendaylight-infra-properties:
17 build-days-to-keep: '{build-days-to-keep}'
20 - opendaylight-infra-parameters:
23 refspec: 'refs/heads/{branch}'
24 artifacts: '{archive-artifacts}'
32 - opendaylight-infra-wrappers:
33 build-timeout: '{build-timeout}'
39 - provide-maven-settings:
40 global-settings-file: 'odl-global-settings'
41 settings-file: '{mvn-settings}'
43 maven-version: 'mvn33'
45 goals: 'clean install dependency:tree com.sonatype.clm:clm-maven-plugin:index -V -B -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
47 - '-Xmx4096m -XX:MaxPermSize=512m'
48 settings: '{mvn-settings}'
50 global-settings: 'odl-global-settings'
51 global-settings-type: cfp
52 - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
54 application-name: '{project-name}'
58 email-recipients: '{email-recipients}'
59 email-prefix: '[{project-name}]'
60 - opendaylight-infra-shiplogs:
61 maven-version: 'mvn33'
64 name: '{project-name}-distribution-{stream}'
67 # stream: release stream (eg. boron or carbon)
68 # branch: git branch (eg. stable/boron or master)
70 # Need to keep jobs that deploy to Nexus at end of build as Maven
71 # projects. Maybe reconsider this once upstream moves deploy to a
73 # https://issues.apache.org/jira/browse/MNG-5666
79 - opendaylight-infra-properties:
80 build-days-to-keep: '{build-days-to-keep}'
83 - opendaylight-infra-parameters:
84 project: 'integration/distribution'
86 refspec: 'refs/heads/{branch}'
87 artifacts: '{archive-artifacts} **/dependency_tree.txt **/target/surefire-reports/*-output.txt'
95 - opendaylight-infra-wrappers:
96 build-timeout: '{build-timeout}'
100 jobs: '{project}-merge-{stream}'
104 - provide-maven-settings:
105 global-settings-file: 'odl-global-settings'
106 settings-file: '{mvn-settings}'
107 - distribute-build-url:
108 path: 'distribution-karaf/src/main/assembly'
113 goals: 'clean install dependency:tree -DoutputFile=dependency_tree.txt -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
114 maven-opts: '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
115 settings: 'integration-distribution-settings'
117 global-settings: 'odl-global-settings'
118 global-settings-type: cfp
121 - email-notification:
122 email-recipients: '{email-recipients}'
123 email-prefix: '[{project}]'
127 deploy-unstable: false
128 - opendaylight-infra-shiplogs:
129 maven-version: 'mvn33'
132 # Template: {project-name}-distribution-check-{stream}
133 # Goal: Build a patch and make sure the distribution can deploy with this change.
134 # Operation: This job template builds a patch, creates a distribution containing
135 # the patch (making sure dependencies are specified),
136 # and performs the distribution deploy test.
138 name: '{project-name}-distribution-check-{stream}'
141 project-type: freestyle
147 - opendaylight-infra-properties:
148 build-days-to-keep: '{build-days-to-keep}'
151 - opendaylight-infra-parameters:
154 refspec: 'refs/heads/{branch}'
155 artifacts: '{archive-artifacts} **/dependency_tree.txt **/target/surefire-reports/*-output.txt'
156 - integration-distribution-git-url:
160 - integration-gerrit-scm:
161 basedir: '$GERRIT_PROJECT'
162 refspec: '$GERRIT_REFSPEC'
164 - integration-distribution-scm:
168 - opendaylight-infra-wrappers:
169 # Distro-check jobs typically run within 10 - 30 minutes
170 # with 45 minutes being the occassional edge case.
171 # enforce a 60 minute limit to ensure stuck jobs get
176 - gerrit-trigger-patch-submitted:
177 server: '{server-name}'
183 # Step zero: Wipe file repositories up front.
185 echo "wipe r: the local Maven repository"
187 echo "wipe n: the fake remote (Nexus) repository"
189 echo "wipe t: the transient repository used in some manipulations"
191 # Step one: Online build of the project, using local repository /tmp/r/ and deploying artifacts to /tmp/n/.
192 # Ordinary SingleFeatureTest failures are detected in the verify job, so we can use "q" profile here.
194 maven-version: 'mvn33'
195 pom: '$GERRIT_PROJECT/pom.xml'
196 goals: 'clean deploy dependency:tree -DoutputFile=dependency_tree.txt -V -B -Pq -Djenkins -Dstream={stream} -DaltDeploymentRepository=fake-nexus::default::file:///tmp/n/ -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
198 - '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
199 settings: '{mvn-settings}'
201 global-settings: 'odl-global-settings'
202 global-settings-type: cfp
203 # Step two: Verify all deployed artifacts belong to the project's groupId.
204 # This is done by moving the allowed directories out of /tmp/n and checking no files remained there.
205 # The correct directory is derived from $GERRIT_PROJECT.
207 mkdir -p /tmp/t/org/opendaylight/$GERRIT_PROJECT
208 mv /tmp/n/org/opendaylight/$GERRIT_PROJECT/* /tmp/t/org/opendaylight/$GERRIT_PROJECT/
209 test -z `find /tmp/n/ -type f`
212 # Step three: Online build of integration distribution.
213 # This step is mainly used for downloading other project artifacts.
214 # Running SingleFeaturesTest here does not seem to be required, so -Pq is used again.
216 maven-version: 'mvn33'
217 pom: 'distribution/pom.xml'
218 goals: 'clean install dependency:tree -DoutputFile=dependency_tree.txt -V -B -Pq -Djenkins -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
220 - '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
221 settings: '{mvn-settings}'
223 global-settings: 'odl-global-settings'
224 global-settings-type: cfp
225 # Step four: Delete snapshot artifacts from the local repository.
226 # This is critical to detect orphaned artifacts or missing project-internal dependency declarations.
227 # Also other files related to maven repository resolution are removed,
228 # and then empty directories are removed, in order to simplify debugging.
230 set +e # To avoid failures in projects which generate zero snapshot artifacts.
231 find /tmp/r/org/opendaylight/$GERRIT_PROJECT/ -path *-SNAPSHOT* -delete
232 find /tmp/r/ -regex '.*/_remote.repositories\|.*/maven-metadata-local\.xml\|.*/maven-metadata-fake-nexus\.xml\|.*/resolver-status\.properties' -delete
233 find /tmp/r/ -type d -empty -delete
234 echo "# INFO: A listing of project related files left in local repository follows."
235 find /tmp/r/org/opendaylight/$GERRIT_PROJECT/
236 true # To prevent the possibly non-zero return code from failing the job.
237 # Now the ugly part. It seems that the only way to tell Maven 2+
238 # which remote repositories to use is via settings.xml file.
239 # So we create such a file here, but it needs most of odlparent:settings.xml
242 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
243 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
244 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
245 https://maven.apache.org/xsd/settings-1.0.0.xsd">
248 <id>opendaylight-release</id>
251 <id>opendaylight-mirror</id>
252 <name>opendaylight</name>
253 <url>https://nexus.opendaylight.org/content/repositories/public/</url>
254 <releases><updatePolicy>never</updatePolicy></releases>
255 <snapshots><enabled>false</enabled></snapshots>
260 <id>opendaylight-plugin-mirror</id>
261 <name>opendaylight-plugin</name>
262 <url>https://nexus.opendaylight.org/content/repositories/public/</url>
263 <releases><updatePolicy>never</updatePolicy></releases>
264 <snapshots><enabled>false</enabled></snapshots>
266 </pluginRepositories>
269 <id>file-snapshots</id>
272 <id>file-snapshots</id>
274 <url>file:///tmp/n/</url>
275 <releases><enabled>false</enabled></releases>
280 <id>file-plugin-snapshots</id>
281 <name>file-plugin</name>
282 <url>file:///tmp/n/</url>
283 <releases><enabled>false</enabled></releases>
285 </pluginRepositories>
289 <activeProfile>file-snapshots</activeProfile>
290 <activeProfile>opendaylight-release</activeProfile>
294 # # Notes: The settings are minimal in order to detect breakage scenarios while allowing for the following quirks:
295 # # * Some plugins seem to have hardcoded repos, for example check-license looks at repository.apache.org
296 # # * Some plugin artifacts (related to surefire) are not downloaded when tests are skipped.
297 # # * populate-local-repo looks at oss.sonatype.org and does not store things (like guava) to /tmp/r
298 # Step five: Repeat the distribution build but with the new settings.
299 # Here, only the project snapshot artifacts deployed to /tmp/n are available,
300 # which faithfully reproduces conditions in later verify-like job runs.
301 # We cannot use --offline, because: "Cannot access file (file:///tmp/n) in offline mode"
302 # This is where SingleFeatureTest is not skipped.
304 maven-version: 'mvn33'
305 pom: 'distribution/pom.xml'
306 goals: 'clean install dependency:tree -DoutputFile=dependency_tree.txt -s fake_remotes.xml -V -B -Pq -DskipTests=false -Djenkins -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
308 - '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
309 # Step six: Run Karaf and verify no critical failures are present.
310 - integration-distribution-check
313 - email-notification:
314 email-recipients: '{email-recipients}'
315 email-prefix: '[{project-name}]'
320 mkdir -p $WORKSPACE/archives
321 cp karaf*.log $WORKSPACE/archives
322 script-only-if-succeeded: False
323 script-only-if-failed: False
324 mark-unstable-if-failed: True
327 - opendaylight-infra-shiplogs:
328 maven-version: 'mvn33'
331 name: '{project-name}-integration-{stream}'
333 # Job template for ODL integration verify jobs
335 # This is similar to a normal verify job, but it runs
336 # when a project that's a dependency of your project
337 # is successfully built.
339 # Required Variables:
340 # stream: release stream (eg. boron or carbon)
341 # branch: git branch (eg. stable/boron or master)
343 project-type: freestyle
348 - opendaylight-infra-properties:
349 build-days-to-keep: '{build-days-to-keep}'
352 - opendaylight-infra-parameters:
355 refspec: 'refs/heads/{branch}'
356 artifacts: '{archive-artifacts}'
364 - opendaylight-infra-wrappers:
365 build-timeout: '{build-timeout}'
369 jobs: '{dependencies}'
373 - jacoco-nojava-workaround
374 - provide-maven-settings:
375 global-settings-file: 'odl-global-settings'
376 settings-file: '{mvn-settings}'
378 maven-version: 'mvn33'
379 goals: '{mvn-goals} -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
382 settings: '{mvn-settings}'
384 global-settings: 'odl-global-settings'
385 global-settings-type: cfp
388 - email-notification:
389 email-recipients: '{email-recipients}'
390 email-prefix: '{email-upstream}'
393 - opendaylight-infra-shiplogs:
394 maven-version: 'mvn33'
397 name: '{project-name}-merge-{stream}'
399 # Job template for ODL merge jobs
401 # The purpose of this job template is to setup a ODL merge job
402 # and deploy artifacts to Nexus.
404 # Required Variables:
405 # stream: release stream (eg. boron or carbon)
406 # branch: git branch (eg. stable/boron or master)
408 # Need to keep jobs that deploy to Nexus at end of build as Maven
409 # projects. Maybe reconsider this once upstream moves deploy to a
410 # separate lifecycle:
411 # https://issues.apache.org/jira/browse/MNG-5666
417 - opendaylight-infra-properties:
418 build-days-to-keep: 14
421 - opendaylight-infra-parameters:
424 refspec: 'refs/heads/{branch}'
425 artifacts: '{archive-artifacts}'
428 - gerrit-trigger-scm:
430 choosing-strategy: 'default'
433 - opendaylight-infra-wrappers:
434 build-timeout: '{build-timeout}'
438 - gerrit-trigger-patch-merged:
439 server-name: '{server-name}'
444 - jacoco-nojava-workaround
445 - provide-maven-settings:
446 global-settings-file: 'odl-global-settings'
447 settings-file: '{mvn-settings}'
449 # TODO: Do we want to apply sophisticated checks as in *-distribution-check-*?
452 goals: '{mvn-goals} -V -B -Djenkins -Dmerge -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
453 maven-opts: '{mvn-opts}'
454 settings: '{mvn-settings}'
456 global-settings: 'odl-global-settings'
457 global-settings-type: cfp
458 post-step-run-condition: UNSTABLE
462 condition-kind: file-exists
463 condition-filename: deploy-site.xml
464 condition-basedir: workspace
466 # The strategy here is intentional to run Maven site:deploy twice
467 # once using regular pom.xml to produce a staged-site which is
468 # then used by deploy-site.xml to push to Nexus. This is a
469 # workaround to Maven Site's default linking code which creates
470 # incorrect URLs for sites due to auto-detection assuming your
471 # project is configured in a certain way which ODL is not.
474 maven-version: 'mvn33'
476 goals: 'site:deploy -V -B -Dstream={stream}'
479 settings: '{mvn-settings}'
481 global-settings: 'odl-global-settings'
482 global-settings-type: cfp
484 maven-version: 'mvn33'
486 goals: 'site:deploy -V -B -Dstream={stream}'
489 settings: '{mvn-settings}'
491 global-settings: 'odl-global-settings'
492 global-settings-type: cfp
498 - email-notification:
499 email-recipients: '{email-recipients}'
500 email-prefix: '[{project-name}]'
504 deploy-unstable: false
506 - opendaylight-infra-shiplogs:
507 maven-version: 'mvn33'
510 name: '{project-name}-sonar'
513 project-type: freestyle
518 - opendaylight-infra-properties:
519 build-days-to-keep: 7
522 - opendaylight-infra-parameters:
525 refspec: 'refs/heads/{branch}'
526 artifacts: '{archive-artifacts}'
534 - opendaylight-infra-wrappers:
535 build-timeout: '{build-timeout}'
539 - gerrit-trigger-patch-sonar:
540 server-name: '{server-name}'
542 # FIXME: Make sure this does not alter Gerrit votes, then update docs.
545 - jacoco-nojava-workaround
546 - provide-maven-settings:
547 global-settings-file: 'odl-global-settings'
548 settings-file: '{mvn-settings}'
550 maven-version: 'mvn33'
551 goals: '{mvn-goals} -V -B -Djenkins -Dsonar -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
554 settings: '{mvn-settings}'
556 global-settings: 'odl-global-settings'
557 global-settings-type: cfp
559 maven-version: 'mvn33'
560 # We should switch to the recommended configuration of sonar once
561 # JJB adds support for configurating the Sonar wrapper:
562 # http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
563 goals: 'sonar:sonar -V -B -Djenkins -Dsonar -Dsonar.host.url=https://sonar.opendaylight.org -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
566 settings: '{mvn-settings}'
568 global-settings: 'odl-global-settings'
569 global-settings-type: cfp
572 - email-notification:
573 email-recipients: '{email-recipients}'
574 email-prefix: '[{project-name}]'
577 - opendaylight-infra-shiplogs:
578 maven-version: 'mvn33'
581 name: '{project-name}-validate-autorelease-{stream}'
584 project-type: freestyle
590 - opendaylight-infra-properties:
591 build-days-to-keep: 7
594 - opendaylight-infra-parameters:
597 refspec: 'refs/heads/{branch}'
598 artifacts: '{archive-artifacts}'
599 - autorelease-release-tag:
600 release-tag: 'validate'
601 - autorelease-release-branch:
602 release-branch: '{branch}'
605 default: '{git-url}/releng/autorelease'
606 description: "Autorelease clone URL"
611 credentials-id: 'opendaylight-jenkins-ssh'
621 - opendaylight-infra-wrappers:
622 build-timeout: '{build-timeout}'
625 - gerrit-trigger-patch-submitted:
626 server: '{server-name}'
632 - jacoco-nojava-workaround
633 - autorelease-checkout-gerrit-patch
634 - autorelease-generate-release-patches
635 # In a perfect world projects should be releasing separately and we consume them
636 # via a project that pulls the release bits from each project from Nexus.
637 # Keep the patches compatible with that ideal, but apply an edit
638 # to enable building in a single maven reactor afterwards.
639 - autorelease-fix-relative-paths
641 maven-version: 'mvn33'
642 pom: validate-pom.xml
643 goals: 'clean install dependency:tree -V -B -T1.5C -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
646 settings: 'autorelease-settings'
648 global-settings: 'odl-global-settings'
649 global-settings-type: cfp
651 maven-version: 'mvn33'
653 goals: 'clean validate -V -B -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
655 - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
656 settings: 'autorelease-settings'
658 global-settings: 'odl-global-settings'
659 global-settings-type: cfp
660 - autorelease-sys-stats
663 - email-notification:
664 email-recipients: '{email-recipients}'
665 email-prefix: '[autorelease] [{project-name}]'
666 - opendaylight-infra-shiplogs:
667 maven-version: 'mvn33'
670 name: '{project-name}-verify-{stream}-{maven}-{jdks}'
672 # Job template for ODL verify jobs
674 # The purpose of this job template is to setup a ODL verify job
676 # Required Variables:
677 # stream: release stream (eg. boron or carbon)
678 # branch: git branch (eg. stable/boron or master)
680 project-type: freestyle
686 - opendaylight-infra-properties:
687 build-days-to-keep: 7
690 - opendaylight-infra-parameters:
693 refspec: 'refs/heads/{branch}'
694 artifacts: '{archive-artifacts}'
697 - gerrit-trigger-scm:
698 refspec: '$GERRIT_REFSPEC'
699 choosing-strategy: 'gerrit'
702 - opendaylight-infra-wrappers:
703 build-timeout: '{build-timeout}'
706 - gerrit-trigger-patch-submitted:
707 server: '{server-name}'
713 - jacoco-nojava-workaround
714 - provide-maven-settings:
715 global-settings-file: 'odl-global-settings'
716 settings-file: '{mvn-settings}'
718 maven-version: '{mvn-version}'
719 goals: '{mvn-goals} -V -B -Djenkins -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
722 settings: '{mvn-settings}'
724 global-settings: 'odl-global-settings'
725 global-settings-type: cfp
729 - email-notification:
730 email-recipients: '{email-recipients}'
731 email-prefix: '[{project-name}]'
733 - opendaylight-infra-shiplogs:
734 maven-version: '{mvn-version}'