Kailash Khalasi | 69c8fcd | 2018-05-09 09:43:49 -0700 | [diff] [blame] | 1 | --- |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 2 | # maven jobs for Java projects |
Kailash Khalasi | 69c8fcd | 2018-05-09 09:43:49 -0700 | [diff] [blame] | 3 | |
| 4 | - job-template: |
Zack Williams | 866ef3c | 2019-09-27 15:41:02 -0700 | [diff] [blame] | 5 | id: maven-test |
| 6 | name: 'verify_{project}_maven-test{name-extension}' |
Kailash Khalasi | 69c8fcd | 2018-05-09 09:43:49 -0700 | [diff] [blame] | 7 | description: | |
| 8 | <!-- Managed by Jenkins Job Builder --> |
Kailash Khalasi | 45f4e2c | 2018-05-09 14:09:50 -0700 | [diff] [blame] | 9 | Created by {id} job-template from ci-management/jjb/maven.yaml |
Kailash Khalasi | 69c8fcd | 2018-05-09 09:43:49 -0700 | [diff] [blame] | 10 | |
Hung-Wei Chiu | f6cbde2 | 2021-04-22 22:15:23 -0700 | [diff] [blame] | 11 | node: 'ubuntu18.04-basebuild-1c-2g' |
Matteo Scandolo | 0024038 | 2018-11-26 14:42:32 -0800 | [diff] [blame] | 12 | project-type: freestyle |
Kailash Khalasi | 69c8fcd | 2018-05-09 09:43:49 -0700 | [diff] [blame] | 13 | |
Kailash Khalasi | f3f15bd | 2018-05-09 09:58:52 -0700 | [diff] [blame] | 14 | parameters: |
| 15 | - string: |
hwchiu | 14f9785 | 2019-10-08 10:51:11 -0700 | [diff] [blame] | 16 | name: jdkDistro |
| 17 | default: '{jdk-distribution}' |
| 18 | description: 'Distribution of the JDK to use with update-java-alternatives' |
Zack Williams | 234dc92 | 2019-08-30 17:03:57 -0700 | [diff] [blame] | 19 | |
Kailash Khalasi | 69c8fcd | 2018-05-09 09:43:49 -0700 | [diff] [blame] | 20 | triggers: |
| 21 | - cord-infra-gerrit-trigger-patchset: |
| 22 | gerrit-server-name: '{gerrit-server-name}' |
Kailash Khalasi | 45f4e2c | 2018-05-09 14:09:50 -0700 | [diff] [blame] | 23 | project-regexp: '{project}' |
Kailash Khalasi | 69c8fcd | 2018-05-09 09:43:49 -0700 | [diff] [blame] | 24 | 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 Khalasi | a5ca0c7 | 2018-05-09 12:00:21 -0700 | [diff] [blame] | 32 | |
| 33 | scm: |
Zack Williams | 866ef3c | 2019-09-27 15:41:02 -0700 | [diff] [blame] | 34 | - lf-infra-gerrit-scm: |
| 35 | git-url: '$GIT_URL/$GERRIT_PROJECT' |
Kailash Khalasi | 45f4e2c | 2018-05-09 14:09:50 -0700 | [diff] [blame] | 36 | refspec: '$GERRIT_REFSPEC' |
Zack Williams | 866ef3c | 2019-09-27 15:41:02 -0700 | [diff] [blame] | 37 | branch: '$GERRIT_BRANCH' |
Zack Williams | ccc1474 | 2020-01-22 13:15:59 -0700 | [diff] [blame] | 38 | submodule-disable: '{submodule-disable}' |
Zack Williams | 866ef3c | 2019-09-27 15:41:02 -0700 | [diff] [blame] | 39 | submodule-recursive: 'false' |
Zack Williams | ccc1474 | 2020-01-22 13:15:59 -0700 | [diff] [blame] | 40 | submodule-timeout: '{submodule-timeout}' |
Zack Williams | 866ef3c | 2019-09-27 15:41:02 -0700 | [diff] [blame] | 41 | choosing-strategy: gerrit |
| 42 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 43 | |
Matteo Scandolo | 0024038 | 2018-11-26 14:42:32 -0800 | [diff] [blame] | 44 | builders: |
Zack Williams | 866ef3c | 2019-09-27 15:41:02 -0700 | [diff] [blame] | 45 | # Set JDK version |
Zack Williams | 234dc92 | 2019-08-30 17:03:57 -0700 | [diff] [blame] | 46 | - shell: | |
| 47 | #!/usr/bin/env bash |
| 48 | set -eu -o pipefail |
| 49 | echo "Setting JDK Distro to: $jdkDistro" |
Zack Williams | bfe8386 | 2019-09-19 22:18:04 -0700 | [diff] [blame] | 50 | sudo update-java-alternatives -s $jdkDistro |
Zack Williams | 234dc92 | 2019-08-30 17:03:57 -0700 | [diff] [blame] | 51 | echo "Java Version:" |
| 52 | java -version |
| 53 | |
Zack Williams | 866ef3c | 2019-09-27 15:41:02 -0700 | [diff] [blame] | 54 | # run tests and install |
Matteo Scandolo | 0024038 | 2018-11-26 14:42:32 -0800 | [diff] [blame] | 55 | - maven-target: |
| 56 | pom: pom.xml |
Matteo Scandolo | b9b70df | 2019-10-31 09:36:44 -0700 | [diff] [blame] | 57 | settings: 'cord-apps-maven-settings' |
Zack Williams | 866ef3c | 2019-09-27 15:41:02 -0700 | [diff] [blame] | 58 | settings-type: cfp |
Andrey Pozolotin | 7d4b1ab | 2020-08-14 23:57:40 +0200 | [diff] [blame] | 59 | goals: '-Pci-verify clean test install spotbugs:check' |
Hung-Wei Chiu | bfa8fe3 | 2021-04-27 10:59:40 -0700 | [diff] [blame] | 60 | maven-version: '{maven-version}' |
Zack Williams | 866ef3c | 2019-09-27 15:41:02 -0700 | [diff] [blame] | 61 | |
| 62 | publishers: |
| 63 | - junit: |
| 64 | results: "**/TEST-*.xml" |
| 65 | allow-empty-results: '{junit-allow-empty-results}' |
| 66 | - cobertura: |
| 67 | report-file: "**/*coverage.xml" |
| 68 | targets: |
| 69 | - files: |
| 70 | healthy: 80 |
| 71 | unhealthy: 0 |
| 72 | failing: 0 |
| 73 | - method: |
| 74 | healthy: 50 |
| 75 | unhealthy: 0 |
| 76 | failing: 0 |
Matteo Scandolo | 0024038 | 2018-11-26 14:42:32 -0800 | [diff] [blame] | 77 | |
Matteo Scandolo | 23cde38 | 2019-05-22 17:00:43 -0700 | [diff] [blame] | 78 | - job-template: |
Zack Williams | 866ef3c | 2019-09-27 15:41:02 -0700 | [diff] [blame] | 79 | id: maven-publish |
| 80 | name: 'maven-publish{name-extension}_{project}' |
Matteo Scandolo | 23cde38 | 2019-05-22 17:00:43 -0700 | [diff] [blame] | 81 | description: | |
| 82 | <!-- Managed by Jenkins Job Builder --> |
| 83 | Created by {id} job-template from ci-management/jjb/maven.yaml |
| 84 | |
Hung-Wei Chiu | f6cbde2 | 2021-04-22 22:15:23 -0700 | [diff] [blame] | 85 | node: 'ubuntu18.04-basebuild-1c-2g' |
Matteo Scandolo | 23cde38 | 2019-05-22 17:00:43 -0700 | [diff] [blame] | 86 | project-type: freestyle |
| 87 | |
| 88 | parameters: |
| 89 | - string: |
hwchiu | 14f9785 | 2019-10-08 10:51:11 -0700 | [diff] [blame] | 90 | name: jdkDistro |
| 91 | default: '{jdk-distribution}' |
| 92 | description: 'Distribution of the JDK to use with update-java-alternatives' |
Zack Williams | 234dc92 | 2019-08-30 17:03:57 -0700 | [diff] [blame] | 93 | |
Matteo Scandolo | 23cde38 | 2019-05-22 17:00:43 -0700 | [diff] [blame] | 94 | triggers: |
| 95 | - cord-infra-gerrit-trigger-merge: |
| 96 | gerrit-server-name: '{gerrit-server-name}' |
| 97 | project-regexp: '{project}' |
| 98 | branch-regexp: '{branch-regexp}' |
| 99 | file-include-regexp: '{all-files-regexp}' |
| 100 | dependency-jobs: '{dependency-jobs}' |
| 101 | |
| 102 | properties: |
| 103 | - cord-infra-properties: |
| 104 | build-days-to-keep: '{build-days-to-keep}' |
| 105 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 106 | |
| 107 | scm: |
Matteo Scandolo | 9de9dcf | 2019-10-30 15:43:50 -0700 | [diff] [blame] | 108 | - lf-infra-gerrit-scm: |
Zack Williams | 866ef3c | 2019-09-27 15:41:02 -0700 | [diff] [blame] | 109 | git-url: '$GIT_URL/$GERRIT_PROJECT' |
Matteo Scandolo | 23cde38 | 2019-05-22 17:00:43 -0700 | [diff] [blame] | 110 | refspec: '$GERRIT_REFSPEC' |
Zack Williams | 866ef3c | 2019-09-27 15:41:02 -0700 | [diff] [blame] | 111 | branch: '$GERRIT_BRANCH' |
Zack Williams | ccc1474 | 2020-01-22 13:15:59 -0700 | [diff] [blame] | 112 | submodule-disable: '{submodule-disable}' |
Zack Williams | 866ef3c | 2019-09-27 15:41:02 -0700 | [diff] [blame] | 113 | submodule-recursive: 'false' |
Zack Williams | ccc1474 | 2020-01-22 13:15:59 -0700 | [diff] [blame] | 114 | submodule-timeout: '{submodule-timeout}' |
Zack Williams | 866ef3c | 2019-09-27 15:41:02 -0700 | [diff] [blame] | 115 | choosing-strategy: gerrit |
| 116 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
Matteo Scandolo | 23cde38 | 2019-05-22 17:00:43 -0700 | [diff] [blame] | 117 | |
Zack Williams | 15cbd7e | 2019-10-30 13:01:39 -0700 | [diff] [blame] | 118 | wrappers: |
| 119 | - credentials-binding: |
| 120 | - file: |
| 121 | credential-id: 'gpg-creds-maven' |
| 122 | variable: 'GNUPG' |
| 123 | |
Matteo Scandolo | 23cde38 | 2019-05-22 17:00:43 -0700 | [diff] [blame] | 124 | builders: |
Zack Williams | 866ef3c | 2019-09-27 15:41:02 -0700 | [diff] [blame] | 125 | # Set JDK version |
Zack Williams | 234dc92 | 2019-08-30 17:03:57 -0700 | [diff] [blame] | 126 | - shell: | |
| 127 | #!/usr/bin/env bash |
| 128 | set -eu -o pipefail |
| 129 | echo "Setting JDK Distro to: $jdkDistro" |
Zack Williams | bfe8386 | 2019-09-19 22:18:04 -0700 | [diff] [blame] | 130 | sudo update-java-alternatives -s $jdkDistro |
Zack Williams | 234dc92 | 2019-08-30 17:03:57 -0700 | [diff] [blame] | 131 | echo "Java Version:" |
| 132 | java -version |
Zack Williams | 15cbd7e | 2019-10-30 13:01:39 -0700 | [diff] [blame] | 133 | echo "Unpacking GPG Keys" |
| 134 | tar -xvf $GNUPG -C ~ |
Zack Williams | 234dc92 | 2019-08-30 17:03:57 -0700 | [diff] [blame] | 135 | |
Matteo Scandolo | 23cde38 | 2019-05-22 17:00:43 -0700 | [diff] [blame] | 136 | - maven-target: |
Matteo Scandolo | 9de9dcf | 2019-10-30 15:43:50 -0700 | [diff] [blame] | 137 | pom: pom.xml |
Matteo Scandolo | b9b70df | 2019-10-31 09:36:44 -0700 | [diff] [blame] | 138 | settings: 'cord-apps-maven-settings' |
Matteo Scandolo | e7ee33c | 2019-05-23 13:23:13 -0700 | [diff] [blame] | 139 | settings-type: cfp |
Matteo Scandolo | 864e5a8 | 2019-10-31 10:27:17 -0700 | [diff] [blame] | 140 | goals: '-Prelease clean deploy' |
Hung-Wei Chiu | 77f7171 | 2021-04-29 10:07:02 -0700 | [diff] [blame] | 141 | maven-version: '{maven-version}' |