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 # Template: {project-name}-distribution-check-{stream}
65 # Goal: Build a patch and make sure the distribution can deploy with this change.
66 # Operation: This job template builds a patch, creates a distribution containing
67 # the patch (making sure dependencies are specified),
68 # and performs the distribution deploy test.
70 name: '{project-name}-distribution-check-{stream}'
73 project-type: freestyle
79 - opendaylight-infra-properties:
80 build-days-to-keep: '{build-days-to-keep}'
83 - opendaylight-infra-parameters:
86 refspec: 'refs/heads/{branch}'
87 artifacts: '{archive-artifacts} **/dependency_tree.txt **/target/surefire-reports/*-output.txt'
88 - integration-distribution-git-url:
92 - integration-gerrit-scm:
93 basedir: '$GERRIT_PROJECT'
94 refspec: '$GERRIT_REFSPEC'
96 - integration-distribution-scm:
97 branch: '{distribution_branch}'
100 - opendaylight-infra-wrappers:
101 # Distro-check jobs typically run within 10 - 30 minutes
102 # with 45 minutes being the occassional edge case.
103 # enforce a 60 minute limit to ensure stuck jobs get
108 - gerrit-trigger-patch-submitted:
109 server: '{server-name}'
115 # Step zero: Wipe file repositories up front.
117 echo "wipe r: the local Maven repository"
119 echo "wipe n: the fake remote (Nexus) repository"
121 echo "wipe t: the transient repository used in some manipulations"
123 # Step one: Online build of the project, using local repository /tmp/r/ and deploying artifacts to /tmp/n/.
124 # Ordinary SingleFeatureTest failures are detected in the verify job, so we can use "q" profile here.
126 maven-version: 'mvn33'
127 pom: '$GERRIT_PROJECT/pom.xml'
128 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'
130 - '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
131 settings: '{mvn-settings}'
133 global-settings: 'odl-global-settings'
134 global-settings-type: cfp
135 # Step two: Verify all deployed artifacts belong to the project's groupId.
136 # This is done by moving the allowed directories out of /tmp/n and checking no files remained there.
137 # The correct directory is derived from $GERRIT_PROJECT.
139 mkdir -p /tmp/t/org/opendaylight/$GERRIT_PROJECT
140 mv /tmp/n/org/opendaylight/$GERRIT_PROJECT/* /tmp/t/org/opendaylight/$GERRIT_PROJECT/
141 test `find /tmp/n/ -type f | wc -l` -eq 0
144 # Step three: Online build of integration distribution.
145 # This step is mainly used for downloading other project artifacts.
146 # Running SingleFeaturesTest here does not seem to be required, so -Pq is used again.
148 maven-version: 'mvn33'
149 pom: 'distribution/pom.xml'
150 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'
152 - '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
153 settings: '{mvn-settings}'
155 global-settings: 'odl-global-settings'
156 global-settings-type: cfp
157 # Step four: Delete snapshot artifacts from the local repository.
158 # This is critical to detect orphaned artifacts or missing project-internal dependency declarations.
159 # Also other files related to maven repository resolution are removed,
160 # and then empty directories are removed, in order to simplify debugging.
162 set +e # To avoid failures in projects which generate zero snapshot artifacts.
163 find /tmp/r/org/opendaylight/$GERRIT_PROJECT/ -path *-SNAPSHOT* -delete
164 find /tmp/r/ -regex '.*/_remote.repositories\|.*/maven-metadata-local\.xml\|.*/maven-metadata-fake-nexus\.xml\|.*/resolver-status\.properties' -delete
165 find /tmp/r/ -type d -empty -delete
166 echo "# INFO: A listing of project related files left in local repository follows."
167 find /tmp/r/org/opendaylight/$GERRIT_PROJECT/
168 true # To prevent the possibly non-zero return code from failing the job.
169 # Now the ugly part. It seems that the only way to tell Maven 2+
170 # which remote repositories to use is via settings.xml file.
171 # So we create such a file here, but it needs most of odlparent:settings.xml
174 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
175 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
176 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
177 https://maven.apache.org/xsd/settings-1.0.0.xsd">
180 <id>opendaylight-release</id>
183 <id>opendaylight-mirror</id>
184 <name>opendaylight</name>
185 <url>https://nexus.opendaylight.org/content/repositories/public/</url>
186 <releases><updatePolicy>never</updatePolicy></releases>
187 <snapshots><enabled>false</enabled></snapshots>
192 <id>opendaylight-plugin-mirror</id>
193 <name>opendaylight-plugin</name>
194 <url>https://nexus.opendaylight.org/content/repositories/public/</url>
195 <releases><updatePolicy>never</updatePolicy></releases>
196 <snapshots><enabled>false</enabled></snapshots>
198 </pluginRepositories>
201 <id>file-snapshots</id>
204 <id>file-snapshots</id>
206 <url>file:///tmp/n/</url>
207 <releases><enabled>false</enabled></releases>
212 <id>file-plugin-snapshots</id>
213 <name>file-plugin</name>
214 <url>file:///tmp/n/</url>
215 <releases><enabled>false</enabled></releases>
217 </pluginRepositories>
221 <activeProfile>file-snapshots</activeProfile>
222 <activeProfile>opendaylight-release</activeProfile>
226 # # Notes: The settings are minimal in order to detect breakage scenarios while allowing for the following quirks:
227 # # * Some plugins seem to have hardcoded repos, for example check-license looks at repository.apache.org
228 # # * Some plugin artifacts (related to surefire) are not downloaded when tests are skipped.
229 # # * populate-local-repo looks at oss.sonatype.org and does not store things (like guava) to /tmp/r
230 # Step five: Repeat the distribution build but with the new settings.
231 # Here, only the project snapshot artifacts deployed to /tmp/n are available,
232 # which faithfully reproduces conditions in later verify-like job runs.
233 # We cannot use --offline, because: "Cannot access file (file:///tmp/n) in offline mode"
234 # This is where SingleFeatureTest is not skipped.
236 maven-version: 'mvn33'
237 pom: 'distribution/pom.xml'
238 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'
240 - '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
241 # Step six: Run Karaf and verify no critical failures are present.
242 - integration-distribution-check
245 - email-notification:
246 email-recipients: '{email-recipients}'
247 email-prefix: '[{project-name}]'
252 mkdir -p $WORKSPACE/archives
253 cp karaf*.log $WORKSPACE/archives
254 script-only-if-succeeded: False
255 script-only-if-failed: False
256 mark-unstable-if-failed: True
259 - opendaylight-infra-shiplogs:
260 maven-version: 'mvn33'
263 name: '{project-name}-integration-{stream}'
265 # Job template for ODL integration verify jobs
267 # This is similar to a normal verify job, but it runs
268 # when a project that's a dependency of your project
269 # is successfully built.
271 # Required Variables:
272 # stream: release stream (eg. boron or carbon)
273 # branch: git branch (eg. stable/boron or master)
275 project-type: freestyle
280 - opendaylight-infra-properties:
281 build-days-to-keep: '{build-days-to-keep}'
284 - opendaylight-infra-parameters:
287 refspec: 'refs/heads/{branch}'
288 artifacts: '{archive-artifacts}'
296 - opendaylight-infra-wrappers:
297 build-timeout: '{build-timeout}'
301 jobs: '{dependencies}'
305 - jacoco-nojava-workaround
306 - provide-maven-settings:
307 global-settings-file: 'odl-global-settings'
308 settings-file: '{mvn-settings}'
310 maven-version: 'mvn33'
311 goals: '{mvn-goals} -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
314 settings: '{mvn-settings}'
316 global-settings: 'odl-global-settings'
317 global-settings-type: cfp
320 - email-notification:
321 email-recipients: '{email-recipients}'
322 email-prefix: '{email-upstream}'
325 - opendaylight-infra-shiplogs:
326 maven-version: 'mvn33'
329 name: '{project-name}-merge-{stream}'
331 # Job template for ODL merge jobs
333 # The purpose of this job template is to setup a ODL merge job
334 # and deploy artifacts to Nexus.
336 # Required Variables:
337 # stream: release stream (eg. boron or carbon)
338 # branch: git branch (eg. stable/boron or master)
340 # Need to keep jobs that deploy to Nexus at end of build as Maven
341 # projects. Maybe reconsider this once upstream moves deploy to a
342 # separate lifecycle:
343 # https://issues.apache.org/jira/browse/MNG-5666
349 - opendaylight-infra-properties:
350 build-days-to-keep: 14
353 - opendaylight-infra-parameters:
356 refspec: 'refs/heads/{branch}'
357 artifacts: '{archive-artifacts}'
360 - gerrit-trigger-scm:
362 choosing-strategy: 'default'
365 - opendaylight-infra-wrappers:
366 build-timeout: '{build-timeout}'
370 - gerrit-trigger-patch-merged:
371 server-name: '{server-name}'
376 - jacoco-nojava-workaround
377 - provide-maven-settings:
378 global-settings-file: 'odl-global-settings'
379 settings-file: '{mvn-settings}'
381 # TODO: Do we want to apply sophisticated checks as in *-distribution-check-*?
384 goals: '{mvn-goals} -V -B -Djenkins -Dmerge -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
385 maven-opts: '{mvn-opts}'
386 settings: '{mvn-settings}'
388 global-settings: 'odl-global-settings'
389 global-settings-type: cfp
390 post-step-run-condition: UNSTABLE
394 condition-kind: file-exists
395 condition-filename: deploy-site.xml
396 condition-basedir: workspace
398 # The strategy here is intentional to run Maven site:deploy twice
399 # once using regular pom.xml to produce a staged-site which is
400 # then used by deploy-site.xml to push to Nexus. This is a
401 # workaround to Maven Site's default linking code which creates
402 # incorrect URLs for sites due to auto-detection assuming your
403 # project is configured in a certain way which ODL is not.
406 maven-version: 'mvn33'
408 goals: 'site:deploy -V -B -Dstream={stream}'
411 settings: '{mvn-settings}'
413 global-settings: 'odl-global-settings'
414 global-settings-type: cfp
416 maven-version: 'mvn33'
418 goals: 'site:deploy -V -B -Dstream={stream}'
421 settings: '{mvn-settings}'
423 global-settings: 'odl-global-settings'
424 global-settings-type: cfp
430 - email-notification:
431 email-recipients: '{email-recipients}'
432 email-prefix: '[{project-name}]'
436 deploy-unstable: false
438 - opendaylight-infra-shiplogs:
439 maven-version: 'mvn33'
441 project: 'distribution-merge-{stream}'
445 name: '{project-name}-sonar'
448 project-type: freestyle
453 - opendaylight-infra-properties:
454 build-days-to-keep: 7
457 - opendaylight-infra-parameters:
460 refspec: 'refs/heads/{branch}'
461 artifacts: '{archive-artifacts}'
469 - opendaylight-infra-wrappers:
470 build-timeout: '{build-timeout}'
474 - gerrit-trigger-patch-sonar:
475 server-name: '{server-name}'
477 # FIXME: Make sure this does not alter Gerrit votes, then update docs.
480 - jacoco-nojava-workaround
481 - provide-maven-settings:
482 global-settings-file: 'odl-global-settings'
483 settings-file: '{mvn-settings}'
485 maven-version: 'mvn33'
486 goals: '{mvn-goals} -V -B -Djenkins -Dsonar -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
489 settings: '{mvn-settings}'
491 global-settings: 'odl-global-settings'
492 global-settings-type: cfp
494 maven-version: 'mvn33'
495 # We should switch to the recommended configuration of sonar once
496 # JJB adds support for configurating the Sonar wrapper:
497 # http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
498 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'
501 settings: '{mvn-settings}'
503 global-settings: 'odl-global-settings'
504 global-settings-type: cfp
507 - email-notification:
508 email-recipients: '{email-recipients}'
509 email-prefix: '[{project-name}]'
512 - opendaylight-infra-shiplogs:
513 maven-version: 'mvn33'
516 name: '{project-name}-validate-autorelease-{stream}'
519 project-type: freestyle
525 - opendaylight-infra-properties:
526 build-days-to-keep: 7
529 - opendaylight-infra-parameters:
532 refspec: 'refs/heads/{branch}'
533 artifacts: '{archive-artifacts}'
534 - autorelease-release-tag:
535 release-tag: 'validate'
536 - autorelease-release-branch:
537 release-branch: '{branch}'
540 default: '{git-url}/releng/autorelease'
541 description: "Autorelease clone URL"
546 credentials-id: 'opendaylight-jenkins-ssh'
556 - opendaylight-infra-wrappers:
557 build-timeout: '{build-timeout}'
560 - gerrit-trigger-patch-submitted:
561 server: '{server-name}'
567 - jacoco-nojava-workaround
568 - autorelease-checkout-gerrit-patch
569 - autorelease-generate-release-patches
570 # In a perfect world projects should be releasing separately and we consume them
571 # via a project that pulls the release bits from each project from Nexus.
572 # Keep the patches compatible with that ideal, but apply an edit
573 # to enable building in a single maven reactor afterwards.
574 - autorelease-fix-relative-paths
576 maven-version: 'mvn33'
577 pom: validate-pom.xml
578 goals: 'clean install dependency:tree -V -B -T1.5C -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
581 settings: 'autorelease-settings'
583 global-settings: 'odl-global-settings'
584 global-settings-type: cfp
586 maven-version: 'mvn33'
588 goals: 'clean validate -V -B -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
590 - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
591 settings: 'autorelease-settings'
593 global-settings: 'odl-global-settings'
594 global-settings-type: cfp
595 - autorelease-sys-stats
598 - email-notification:
599 email-recipients: '{email-recipients}'
600 email-prefix: '[autorelease] [{project-name}]'
601 - opendaylight-infra-shiplogs:
602 maven-version: 'mvn33'
605 name: '{project-name}-verify-{stream}-{maven}-{jdks}'
607 # Job template for ODL verify jobs
609 # The purpose of this job template is to setup a ODL verify job
611 # Required Variables:
612 # stream: release stream (eg. boron or carbon)
613 # branch: git branch (eg. stable/boron or master)
615 project-type: freestyle
621 - opendaylight-infra-properties:
622 build-days-to-keep: 7
625 - opendaylight-infra-parameters:
628 refspec: 'refs/heads/{branch}'
629 artifacts: '{archive-artifacts}'
632 - gerrit-trigger-scm:
633 refspec: '$GERRIT_REFSPEC'
634 choosing-strategy: 'gerrit'
637 - opendaylight-infra-wrappers:
638 build-timeout: '{build-timeout}'
641 - gerrit-trigger-patch-submitted:
642 server: '{server-name}'
648 - jacoco-nojava-workaround
649 - provide-maven-settings:
650 global-settings-file: 'odl-global-settings'
651 settings-file: '{mvn-settings}'
653 maven-version: '{mvn-version}'
654 goals: '{mvn-goals} -V -B -Djenkins -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
657 settings: '{mvn-settings}'
659 global-settings: 'odl-global-settings'
660 global-settings-type: cfp
664 - email-notification:
665 email-recipients: '{email-recipients}'
666 email-prefix: '[{project-name}]'
668 - opendaylight-infra-shiplogs:
669 maven-version: '{mvn-version}'