blob: cc2bc62c186abaebade87532e099613668fe8067 [file] [log] [blame]
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -07001---
Zack Williamsc3c83932018-10-30 13:56:37 -07002# maven jobs for Java projects
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -07003
4- job-template:
Zack Williams866ef3c2019-09-27 15:41:02 -07005 id: maven-test
6 name: 'verify_{project}_maven-test{name-extension}'
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -07007 description: |
8 <!-- Managed by Jenkins Job Builder -->
Kailash Khalasi45f4e2c2018-05-09 14:09:50 -07009 Created by {id} job-template from ci-management/jjb/maven.yaml
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -070010
11 node: 'ubuntu16.04-basebuild-1c-2g'
Matteo Scandolo00240382018-11-26 14:42:32 -080012 project-type: freestyle
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -070013
Kailash Khalasif3f15bd2018-05-09 09:58:52 -070014 parameters:
15 - string:
Zack Williams234dc922019-08-30 17:03:57 -070016 name: jdkDistro
17 default: '{jdk-distribution}'
18 description: 'Distribution of the JDK to use with update-java-alternatives'
19
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -070020 triggers:
21 - cord-infra-gerrit-trigger-patchset:
22 gerrit-server-name: '{gerrit-server-name}'
Kailash Khalasi45f4e2c2018-05-09 14:09:50 -070023 project-regexp: '{project}'
Kailash Khalasi69c8fcd2018-05-09 09:43:49 -070024 branch-regexp: '{branch-regexp}'
25 file-include-regexp: '{all-files-regexp}'
26 dependency-jobs: '{dependency-jobs}'
27
28 properties:
29 - cord-infra-properties:
30 build-days-to-keep: '{build-days-to-keep}'
31 artifact-num-to-keep: '{artifact-num-to-keep}'
Kailash Khalasia5ca0c72018-05-09 12:00:21 -070032
33 scm:
Zack Williams866ef3c2019-09-27 15:41:02 -070034 - lf-infra-gerrit-scm:
35 git-url: '$GIT_URL/$GERRIT_PROJECT'
Kailash Khalasi45f4e2c2018-05-09 14:09:50 -070036 refspec: '$GERRIT_REFSPEC'
Zack Williams866ef3c2019-09-27 15:41:02 -070037 branch: '$GERRIT_BRANCH'
38 submodule-recursive: 'false'
39 choosing-strategy: gerrit
40 jenkins-ssh-credential: '{jenkins-ssh-credential}'
Zack Williamsc3c83932018-10-30 13:56:37 -070041
Matteo Scandolo00240382018-11-26 14:42:32 -080042 builders:
Zack Williams866ef3c2019-09-27 15:41:02 -070043 # Set JDK version
Zack Williams234dc922019-08-30 17:03:57 -070044 - shell: |
45 #!/usr/bin/env bash
46 set -eu -o pipefail
47 echo "Setting JDK Distro to: $jdkDistro"
Zack Williamsbfe83862019-09-19 22:18:04 -070048 sudo update-java-alternatives -s $jdkDistro
Zack Williams234dc922019-08-30 17:03:57 -070049 echo "Java Version:"
50 java -version
51
Zack Williams866ef3c2019-09-27 15:41:02 -070052 # run tests and install
Matteo Scandolo00240382018-11-26 14:42:32 -080053 - maven-target:
54 pom: pom.xml
Zack Williams866ef3c2019-09-27 15:41:02 -070055 settings: onoscord-apps
56 settings-type: cfp
57 goals: 'clean test install'
58
59 publishers:
60 - junit:
61 results: "**/TEST-*.xml"
62 allow-empty-results: '{junit-allow-empty-results}'
63 - cobertura:
64 report-file: "**/*coverage.xml"
65 targets:
66 - files:
67 healthy: 80
68 unhealthy: 0
69 failing: 0
70 - method:
71 healthy: 50
72 unhealthy: 0
73 failing: 0
Matteo Scandolo00240382018-11-26 14:42:32 -080074
Matteo Scandolo23cde382019-05-22 17:00:43 -070075- job-template:
Zack Williams866ef3c2019-09-27 15:41:02 -070076 id: maven-publish
77 name: 'maven-publish{name-extension}_{project}'
Matteo Scandolo23cde382019-05-22 17:00:43 -070078 description: |
79 <!-- Managed by Jenkins Job Builder -->
80 Created by {id} job-template from ci-management/jjb/maven.yaml
81
82 node: 'ubuntu16.04-basebuild-1c-2g'
83 project-type: freestyle
84
85 parameters:
86 - string:
Zack Williams234dc922019-08-30 17:03:57 -070087 name: jdkDistro
88 default: '{jdk-distribution}'
89 description: 'Distribution of the JDK to use with update-java-alternatives'
90
Matteo Scandolo23cde382019-05-22 17:00:43 -070091 triggers:
92 - cord-infra-gerrit-trigger-merge:
93 gerrit-server-name: '{gerrit-server-name}'
94 project-regexp: '{project}'
95 branch-regexp: '{branch-regexp}'
96 file-include-regexp: '{all-files-regexp}'
97 dependency-jobs: '{dependency-jobs}'
98
99 properties:
100 - cord-infra-properties:
101 build-days-to-keep: '{build-days-to-keep}'
102 artifact-num-to-keep: '{artifact-num-to-keep}'
103
104 scm:
Zack Williams866ef3c2019-09-27 15:41:02 -0700105 - lf-infra-gerrit-scm:
106 git-url: '$GIT_URL/$GERRIT_PROJECT'
Matteo Scandolo23cde382019-05-22 17:00:43 -0700107 refspec: '$GERRIT_REFSPEC'
Zack Williams866ef3c2019-09-27 15:41:02 -0700108 branch: '$GERRIT_BRANCH'
109 submodule-recursive: 'false'
110 choosing-strategy: gerrit
111 jenkins-ssh-credential: '{jenkins-ssh-credential}'
Matteo Scandolo23cde382019-05-22 17:00:43 -0700112
113 builders:
Zack Williams866ef3c2019-09-27 15:41:02 -0700114 # Set JDK version
Zack Williams234dc922019-08-30 17:03:57 -0700115 - shell: |
116 #!/usr/bin/env bash
117 set -eu -o pipefail
118 echo "Setting JDK Distro to: $jdkDistro"
Zack Williamsbfe83862019-09-19 22:18:04 -0700119 sudo update-java-alternatives -s $jdkDistro
Zack Williams234dc922019-08-30 17:03:57 -0700120 echo "Java Version:"
121 java -version
122
Matteo Scandolo23cde382019-05-22 17:00:43 -0700123 - maven-target:
124 pom: pom.xml
125 settings: onoscord-apps
Matteo Scandoloe7ee33c2019-05-23 13:23:13 -0700126 settings-type: cfp
Matteo Scandolo23cde382019-05-22 17:00:43 -0700127 goals: 'clean deploy'