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