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: |
Kailash Khalasi | 45f4e2c | 2018-05-09 14:09:50 -0700 | [diff] [blame] | 5 | id: maven-install |
| 6 | name: '{project}-gerrit' |
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 | |
| 11 | node: 'ubuntu16.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: |
Kailash Khalasi | a5ca0c7 | 2018-05-09 12:00:21 -0700 | [diff] [blame] | 16 | name: GERRIT_BRANCH |
| 17 | default: 'master' |
Kailash Khalasi | f3f15bd | 2018-05-09 09:58:52 -0700 | [diff] [blame] | 18 | description: 'Use default when using "Build Now"' |
| 19 | |
| 20 | - string: |
Kailash Khalasi | a5ca0c7 | 2018-05-09 12:00:21 -0700 | [diff] [blame] | 21 | name: GERRIT_REFSPEC |
| 22 | default: 'refs/heads/master' |
Kailash Khalasi | f3f15bd | 2018-05-09 09:58:52 -0700 | [diff] [blame] | 23 | description: 'Use default when using "Build Now"' |
| 24 | |
Zack Williams | 234dc92 | 2019-08-30 17:03:57 -0700 | [diff] [blame] | 25 | - string: |
| 26 | name: jdkDistro |
| 27 | default: '{jdk-distribution}' |
| 28 | description: 'Distribution of the JDK to use with update-java-alternatives' |
| 29 | |
Kailash Khalasi | 69c8fcd | 2018-05-09 09:43:49 -0700 | [diff] [blame] | 30 | triggers: |
| 31 | - cord-infra-gerrit-trigger-patchset: |
| 32 | gerrit-server-name: '{gerrit-server-name}' |
Kailash Khalasi | 45f4e2c | 2018-05-09 14:09:50 -0700 | [diff] [blame] | 33 | project-regexp: '{project}' |
Kailash Khalasi | 69c8fcd | 2018-05-09 09:43:49 -0700 | [diff] [blame] | 34 | branch-regexp: '{branch-regexp}' |
| 35 | file-include-regexp: '{all-files-regexp}' |
| 36 | dependency-jobs: '{dependency-jobs}' |
| 37 | |
| 38 | properties: |
| 39 | - cord-infra-properties: |
| 40 | build-days-to-keep: '{build-days-to-keep}' |
| 41 | artifact-num-to-keep: '{artifact-num-to-keep}' |
Kailash Khalasi | a5ca0c7 | 2018-05-09 12:00:21 -0700 | [diff] [blame] | 42 | |
| 43 | scm: |
| 44 | - git: |
Kailash Khalasi | 45f4e2c | 2018-05-09 14:09:50 -0700 | [diff] [blame] | 45 | url: '{gerrit-server-url}/{project}' |
Kailash Khalasi | 1b3d3fe | 2018-05-09 13:20:22 -0700 | [diff] [blame] | 46 | branches: |
| 47 | - '$GERRIT_BRANCH' |
Kailash Khalasi | 45f4e2c | 2018-05-09 14:09:50 -0700 | [diff] [blame] | 48 | refspec: '$GERRIT_REFSPEC' |
Kailash Khalasi | a5ca0c7 | 2018-05-09 12:00:21 -0700 | [diff] [blame] | 49 | choosing-strategy: 'gerrit' |
Kailash Khalasi | a5ca0c7 | 2018-05-09 12:00:21 -0700 | [diff] [blame] | 50 | shallow-clone: true |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 51 | |
Matteo Scandolo | 0024038 | 2018-11-26 14:42:32 -0800 | [diff] [blame] | 52 | builders: |
| 53 | # NOTE: this env var is only required to fix a bug in the "surefire" dependency: |
| 54 | # https://issues.apache.org/jira/browse/SUREFIRE-1588 |
| 55 | # https://github.com/apache/maven-surefire/pull/197 |
| 56 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911925 |
| 57 | # should be removed as soon as this problem is resolved |
| 58 | - inject: |
| 59 | properties-content: | |
| 60 | _JAVA_OPTIONS=-Djdk.net.URLClassPath.disableClassPathURLCheck=true |
Zack Williams | 234dc92 | 2019-08-30 17:03:57 -0700 | [diff] [blame] | 61 | |
| 62 | - shell: | |
| 63 | #!/usr/bin/env bash |
| 64 | set -eu -o pipefail |
| 65 | echo "Setting JDK Distro to: $jdkDistro" |
Zack Williams | bfe8386 | 2019-09-19 22:18:04 -0700 | [diff] [blame] | 66 | sudo update-java-alternatives -s $jdkDistro |
Zack Williams | 234dc92 | 2019-08-30 17:03:57 -0700 | [diff] [blame] | 67 | echo "Java Version:" |
| 68 | java -version |
| 69 | |
Matteo Scandolo | 0024038 | 2018-11-26 14:42:32 -0800 | [diff] [blame] | 70 | - maven-target: |
| 71 | pom: pom.xml |
| 72 | goals: 'clean install' |
| 73 | |
Matteo Scandolo | 23cde38 | 2019-05-22 17:00:43 -0700 | [diff] [blame] | 74 | - job-template: |
| 75 | id: maven-deploy |
| 76 | name: '{project}-gerrit-deploy' |
| 77 | description: | |
| 78 | <!-- Managed by Jenkins Job Builder --> |
| 79 | Created by {id} job-template from ci-management/jjb/maven.yaml |
| 80 | |
| 81 | node: 'ubuntu16.04-basebuild-1c-2g' |
| 82 | project-type: freestyle |
| 83 | |
| 84 | parameters: |
| 85 | - string: |
| 86 | name: GERRIT_BRANCH |
| 87 | default: 'master' |
| 88 | description: 'Use default when using "Build Now"' |
| 89 | |
| 90 | - string: |
| 91 | name: GERRIT_REFSPEC |
| 92 | default: 'refs/heads/master' |
| 93 | description: 'Use default when using "Build Now"' |
| 94 | |
Zack Williams | 234dc92 | 2019-08-30 17:03:57 -0700 | [diff] [blame] | 95 | - string: |
| 96 | name: jdkDistro |
| 97 | default: '{jdk-distribution}' |
| 98 | description: 'Distribution of the JDK to use with update-java-alternatives' |
| 99 | |
Matteo Scandolo | 23cde38 | 2019-05-22 17:00:43 -0700 | [diff] [blame] | 100 | triggers: |
| 101 | - cord-infra-gerrit-trigger-merge: |
| 102 | gerrit-server-name: '{gerrit-server-name}' |
| 103 | project-regexp: '{project}' |
| 104 | branch-regexp: '{branch-regexp}' |
| 105 | file-include-regexp: '{all-files-regexp}' |
| 106 | dependency-jobs: '{dependency-jobs}' |
| 107 | |
| 108 | properties: |
| 109 | - cord-infra-properties: |
| 110 | build-days-to-keep: '{build-days-to-keep}' |
| 111 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 112 | |
| 113 | scm: |
| 114 | - git: |
| 115 | url: '{gerrit-server-url}/{project}' |
| 116 | branches: |
| 117 | - '$GERRIT_BRANCH' |
| 118 | refspec: '$GERRIT_REFSPEC' |
| 119 | choosing-strategy: 'gerrit' |
| 120 | shallow-clone: true |
| 121 | |
| 122 | builders: |
| 123 | - inject: |
| 124 | properties-content: | |
| 125 | _JAVA_OPTIONS=-Djdk.net.URLClassPath.disableClassPathURLCheck=true |
Zack Williams | 234dc92 | 2019-08-30 17:03:57 -0700 | [diff] [blame] | 126 | |
| 127 | - shell: | |
| 128 | #!/usr/bin/env bash |
| 129 | set -eu -o pipefail |
| 130 | echo "Setting JDK Distro to: $jdkDistro" |
Zack Williams | bfe8386 | 2019-09-19 22:18:04 -0700 | [diff] [blame] | 131 | sudo update-java-alternatives -s $jdkDistro |
Zack Williams | 234dc92 | 2019-08-30 17:03:57 -0700 | [diff] [blame] | 132 | echo "Java Version:" |
| 133 | java -version |
| 134 | |
Matteo Scandolo | 23cde38 | 2019-05-22 17:00:43 -0700 | [diff] [blame] | 135 | - maven-target: |
| 136 | pom: pom.xml |
| 137 | settings: onoscord-apps |
Matteo Scandolo | e7ee33c | 2019-05-23 13:23:13 -0700 | [diff] [blame] | 138 | settings-type: cfp |
Matteo Scandolo | 23cde38 | 2019-05-22 17:00:43 -0700 | [diff] [blame] | 139 | goals: 'clean deploy' |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 140 | |
| 141 | - job-template: |
| 142 | id: maven-test |
| 143 | name: 'verify_{project}_maven-test' |
| 144 | description: | |
| 145 | <!-- Managed by Jenkins Job Builder --> |
| 146 | Created by {id} job-template from ci-management/jjb/maven.yaml |
| 147 | |
Zack Williams | 234dc92 | 2019-08-30 17:03:57 -0700 | [diff] [blame] | 148 | parameters: |
| 149 | - string: |
| 150 | name: jdkDistro |
| 151 | default: '{jdk-distribution}' |
| 152 | description: 'Distribution of the JDK to use with update-java-alternatives' |
| 153 | |
Zack Williams | c3c8393 | 2018-10-30 13:56:37 -0700 | [diff] [blame] | 154 | triggers: |
| 155 | - cord-infra-gerrit-trigger-patchset: |
| 156 | gerrit-server-name: '{gerrit-server-name}' |
| 157 | project-regexp: '{project}' |
| 158 | branch-regexp: '{branch-regexp}' |
| 159 | file-include-regexp: '{all-files-regexp}' |
| 160 | dependency-jobs: '{dependency-jobs}' |
| 161 | |
| 162 | properties: |
| 163 | - cord-infra-properties: |
| 164 | build-days-to-keep: '{build-days-to-keep}' |
| 165 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 166 | |
| 167 | |
| 168 | wrappers: |
| 169 | - lf-infra-wrappers: |
| 170 | build-timeout: 30 |
| 171 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 172 | |
| 173 | scm: |
| 174 | - lf-infra-gerrit-scm: |
| 175 | git-url: '$GIT_URL/$GERRIT_PROJECT' |
| 176 | refspec: '$GERRIT_REFSPEC' |
| 177 | branch: '$GERRIT_BRANCH' |
| 178 | submodule-recursive: 'false' |
| 179 | choosing-strategy: gerrit |
| 180 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 181 | |
| 182 | node: 'ubuntu16.04-basebuild-1c-2g' |
| 183 | project-type: maven |
| 184 | concurrent: true |
| 185 | |
Matteo Scandolo | 0024038 | 2018-11-26 14:42:32 -0800 | [diff] [blame] | 186 | builders: |
| 187 | # NOTE: this env var is only required to fix a bug in the "surefire" dependency: |
| 188 | # https://issues.apache.org/jira/browse/SUREFIRE-1588 |
| 189 | # https://github.com/apache/maven-surefire/pull/197 |
| 190 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911925 |
| 191 | # should be removed as soon as this problem is resolved |
| 192 | - inject: |
| 193 | properties-content: | |
| 194 | _JAVA_OPTIONS=-Djdk.net.URLClassPath.disableClassPathURLCheck=true |
Zack Williams | 234dc92 | 2019-08-30 17:03:57 -0700 | [diff] [blame] | 195 | |
| 196 | - shell: | |
| 197 | #!/usr/bin/env bash |
| 198 | set -eu -o pipefail |
| 199 | echo "Setting JDK Distro to: $jdkDistro" |
Zack Williams | bfe8386 | 2019-09-19 22:18:04 -0700 | [diff] [blame] | 200 | sudo update-java-alternatives -s $jdkDistro |
Zack Williams | 234dc92 | 2019-08-30 17:03:57 -0700 | [diff] [blame] | 201 | echo "Java Version:" |
| 202 | java -version |
| 203 | |
Matteo Scandolo | 0024038 | 2018-11-26 14:42:32 -0800 | [diff] [blame] | 204 | - maven-target: |
| 205 | pom: pom.xml |
| 206 | goals: 'test' |