blob: c62e185a75ee3d43eb7ab636e4a5150c596d9a37 [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
Hung-Wei Chiuf6cbde22021-04-22 22:15:23 -070011 node: 'ubuntu18.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:
hwchiu14f97852019-10-08 10:51:11 -070016 name: jdkDistro
17 default: '{jdk-distribution}'
18 description: 'Distribution of the JDK to use with update-java-alternatives'
Zack Williams234dc922019-08-30 17:03:57 -070019
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'
Zack Williamsccc14742020-01-22 13:15:59 -070038 submodule-disable: '{submodule-disable}'
Zack Williams866ef3c2019-09-27 15:41:02 -070039 submodule-recursive: 'false'
Zack Williamsccc14742020-01-22 13:15:59 -070040 submodule-timeout: '{submodule-timeout}'
Zack Williams866ef3c2019-09-27 15:41:02 -070041 choosing-strategy: gerrit
42 jenkins-ssh-credential: '{jenkins-ssh-credential}'
Zack Williamsc3c83932018-10-30 13:56:37 -070043
Matteo Scandolo00240382018-11-26 14:42:32 -080044 builders:
Zack Williams866ef3c2019-09-27 15:41:02 -070045 # Set JDK version
Zack Williams234dc922019-08-30 17:03:57 -070046 - shell: |
47 #!/usr/bin/env bash
48 set -eu -o pipefail
49 echo "Setting JDK Distro to: $jdkDistro"
Zack Williamsbfe83862019-09-19 22:18:04 -070050 sudo update-java-alternatives -s $jdkDistro
Zack Williams234dc922019-08-30 17:03:57 -070051 echo "Java Version:"
52 java -version
53
Zack Williams866ef3c2019-09-27 15:41:02 -070054 # run tests and install
Matteo Scandolo00240382018-11-26 14:42:32 -080055 - maven-target:
56 pom: pom.xml
Matteo Scandolob9b70df2019-10-31 09:36:44 -070057 settings: 'cord-apps-maven-settings'
Zack Williams866ef3c2019-09-27 15:41:02 -070058 settings-type: cfp
Andrey Pozolotin7d4b1ab2020-08-14 23:57:40 +020059 goals: '-Pci-verify clean test install spotbugs:check'
Zack Williams866ef3c2019-09-27 15:41:02 -070060
61 publishers:
62 - junit:
63 results: "**/TEST-*.xml"
64 allow-empty-results: '{junit-allow-empty-results}'
65 - cobertura:
66 report-file: "**/*coverage.xml"
67 targets:
68 - files:
69 healthy: 80
70 unhealthy: 0
71 failing: 0
72 - method:
73 healthy: 50
74 unhealthy: 0
75 failing: 0
Matteo Scandolo00240382018-11-26 14:42:32 -080076
Matteo Scandolo23cde382019-05-22 17:00:43 -070077- job-template:
Zack Williams866ef3c2019-09-27 15:41:02 -070078 id: maven-publish
79 name: 'maven-publish{name-extension}_{project}'
Matteo Scandolo23cde382019-05-22 17:00:43 -070080 description: |
81 <!-- Managed by Jenkins Job Builder -->
82 Created by {id} job-template from ci-management/jjb/maven.yaml
83
Hung-Wei Chiuf6cbde22021-04-22 22:15:23 -070084 node: 'ubuntu18.04-basebuild-1c-2g'
Matteo Scandolo23cde382019-05-22 17:00:43 -070085 project-type: freestyle
86
87 parameters:
88 - string:
hwchiu14f97852019-10-08 10:51:11 -070089 name: jdkDistro
90 default: '{jdk-distribution}'
91 description: 'Distribution of the JDK to use with update-java-alternatives'
Zack Williams234dc922019-08-30 17:03:57 -070092
Matteo Scandolo23cde382019-05-22 17:00:43 -070093 triggers:
94 - cord-infra-gerrit-trigger-merge:
95 gerrit-server-name: '{gerrit-server-name}'
96 project-regexp: '{project}'
97 branch-regexp: '{branch-regexp}'
98 file-include-regexp: '{all-files-regexp}'
99 dependency-jobs: '{dependency-jobs}'
100
101 properties:
102 - cord-infra-properties:
103 build-days-to-keep: '{build-days-to-keep}'
104 artifact-num-to-keep: '{artifact-num-to-keep}'
105
106 scm:
Matteo Scandolo9de9dcf2019-10-30 15:43:50 -0700107 - lf-infra-gerrit-scm:
Zack Williams866ef3c2019-09-27 15:41:02 -0700108 git-url: '$GIT_URL/$GERRIT_PROJECT'
Matteo Scandolo23cde382019-05-22 17:00:43 -0700109 refspec: '$GERRIT_REFSPEC'
Zack Williams866ef3c2019-09-27 15:41:02 -0700110 branch: '$GERRIT_BRANCH'
Zack Williamsccc14742020-01-22 13:15:59 -0700111 submodule-disable: '{submodule-disable}'
Zack Williams866ef3c2019-09-27 15:41:02 -0700112 submodule-recursive: 'false'
Zack Williamsccc14742020-01-22 13:15:59 -0700113 submodule-timeout: '{submodule-timeout}'
Zack Williams866ef3c2019-09-27 15:41:02 -0700114 choosing-strategy: gerrit
115 jenkins-ssh-credential: '{jenkins-ssh-credential}'
Matteo Scandolo23cde382019-05-22 17:00:43 -0700116
Zack Williams15cbd7e2019-10-30 13:01:39 -0700117 wrappers:
118 - credentials-binding:
119 - file:
120 credential-id: 'gpg-creds-maven'
121 variable: 'GNUPG'
122
Matteo Scandolo23cde382019-05-22 17:00:43 -0700123 builders:
Zack Williams866ef3c2019-09-27 15:41:02 -0700124 # Set JDK version
Zack Williams234dc922019-08-30 17:03:57 -0700125 - shell: |
126 #!/usr/bin/env bash
127 set -eu -o pipefail
128 echo "Setting JDK Distro to: $jdkDistro"
Zack Williamsbfe83862019-09-19 22:18:04 -0700129 sudo update-java-alternatives -s $jdkDistro
Zack Williams234dc922019-08-30 17:03:57 -0700130 echo "Java Version:"
131 java -version
Zack Williams15cbd7e2019-10-30 13:01:39 -0700132 echo "Unpacking GPG Keys"
133 tar -xvf $GNUPG -C ~
Zack Williams234dc922019-08-30 17:03:57 -0700134
Matteo Scandolo23cde382019-05-22 17:00:43 -0700135 - maven-target:
Matteo Scandolo9de9dcf2019-10-30 15:43:50 -0700136 pom: pom.xml
Matteo Scandolob9b70df2019-10-31 09:36:44 -0700137 settings: 'cord-apps-maven-settings'
Matteo Scandoloe7ee33c2019-05-23 13:23:13 -0700138 settings-type: cfp
Matteo Scandolo864e5a82019-10-31 10:27:17 -0700139 goals: '-Prelease clean deploy'