Skip to content

Commit e68ea64

Browse files
authored
Merge pull request #648 from jakauppila/add-corretto-15-update-certificate
Adds Amazon Corretto 15 support, changes to `java_certificate`
2 parents 9b5abe4 + 3f13e31 commit e68ea64

File tree

10 files changed

+249
-90
lines changed

10 files changed

+249
-90
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ jobs:
6161
- adoptopenjdk-14-openj9
6262
- adoptopenjdk-14-openj9-large-heap
6363
- adoptopenjdk-removal-11-openj9
64-
# - corretto-11
65-
# - corretto-8
64+
- corretto-8
65+
- corretto-11
66+
- corretto-15
6667
- custom-package-8
6768
- custom-package-11
6869
- custom-package-11-openj9

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This file is used to list changes made in each version of the Java cookbook.
44

55
## Unreleased
66

7+
- Added Amazon Corretto 15 support to `corretto_install`
8+
- Added configurable `file_cache_path` property to `java_certificate`
9+
- Added `cacerts` property to `java_certificate` for interacting with java cacerts file (Java 9+)
10+
711
## 8.5.0 - *2020-12-03*
812

913
- resolved cookstyle error: spec/spec_helper.rb:4:18 convention: `Style/RedundantFileExtensionInRequire`

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![OpenCollective](https://opencollective.com/sous-chefs/sponsors/badge.svg)](#sponsors)
77
[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)
88

9-
This cookbook installs a Java JDK/JRE. It defaults to installing OpenJDK, but it can also install AdoptOpenJDK.
9+
This cookbook installs a Java JDK/JRE. It defaults to installing [OpenJDK](https://openjdk.java.net/), but it can also install [AdoptOpenJDK](https://adoptopenjdk.net/) and [Amazon Corretto](https://corretto.aws/).
1010

1111
## Maintainers
1212

kitchen.yml

Lines changed: 55 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,70 +28,70 @@ suites:
2828
- name: openjdk-10
2929
run_list:
3030
- recipe[test::openjdk]
31-
attributes: {version: '10'}
31+
attributes: {version: "10"}
3232
verifier:
3333
inspec_tests: [test/integration/openjdk]
34-
inputs: {java_version: '10'}
34+
inputs: {java_version: "10"}
3535

3636
- name: openjdk-11
3737
run_list:
3838
- recipe[test::openjdk]
39-
attributes: {version: '11'}
39+
attributes: {version: "11"}
4040
verifier:
4141
inspec_tests: [test/integration/openjdk]
42-
inputs: {java_version: '11'}
42+
inputs: {java_version: "11"}
4343

4444
- name: openjdk-12
4545
run_list:
4646
- recipe[test::openjdk]
47-
attributes: {version: '12'}
47+
attributes: {version: "12"}
4848
verifier:
4949
inspec_tests: [test/integration/openjdk]
50-
inputs: {java_version: '12'}
50+
inputs: {java_version: "12"}
5151

5252
- name: openjdk-13
5353
run_list:
5454
- recipe[test::openjdk]
55-
attributes: {version: '13'}
55+
attributes: {version: "13"}
5656
verifier:
5757
inspec_tests: [test/integration/openjdk]
58-
inputs: {java_version: '13'}
58+
inputs: {java_version: "13"}
5959

6060
# OpenJDK_PKG
6161
- name: openjdk-pkg-7
6262
run_list:
6363
- recipe[test::openjdk_pkg]
64-
attributes: {version: '7'}
64+
attributes: {version: "7"}
6565
verifier:
6666
inspec_tests: [test/integration/openjdk_pkg]
67-
inputs: {java_version: '7'}
67+
inputs: {java_version: "7"}
6868
includes: ["amazon-linux", "amazonlinux-2", "centos-7"]
6969

7070
- name: openjdk-pkg-8
7171
run_list:
7272
- recipe[test::openjdk_pkg]
73-
attributes: {version: '8'}
73+
attributes: {version: "8"}
7474
verifier:
7575
inspec_tests: [test/integration/openjdk_pkg]
76-
inputs: {java_version: '8'}
76+
inputs: {java_version: "8"}
7777
excludes: ["debian-10"]
7878

7979
- name: openjdk-pkg-11
8080
run_list:
8181
- recipe[test::openjdk_pkg]
82-
attributes: {version: '11'}
82+
attributes: {version: "11"}
8383
verifier:
8484
inspec_tests: [test/integration/openjdk_pkg]
85-
inputs: {java_version: '11'}
85+
inputs: {java_version: "11"}
8686
excludes: ["amazon-linux", "debian-9"]
8787

8888
- name: openjdk-pkg-14
8989
run_list:
9090
- recipe[test::openjdk_pkg]
91-
attributes: {version: '14'}
91+
attributes: {version: "14"}
9292
verifier:
9393
inspec_tests: [test/integration/openjdk_pkg]
94-
inputs: {java_version: '14'}
94+
inputs: {java_version: "14"}
9595
includes: [ubuntu-20.04]
9696

9797
# AdoptOpenJDK
@@ -104,7 +104,8 @@ suites:
104104
variant: hotspot
105105
verifier:
106106
inspec_tests: [test/integration/adoptopenjdk]
107-
input_files: [test/integration/adoptopenjdk/attributes/adoptopenjdk-8-hotspot.yml]
107+
input_files:
108+
[test/integration/adoptopenjdk/attributes/adoptopenjdk-8-hotspot.yml]
108109
- name: adoptopenjdk-8-openj9
109110
run_list:
110111
- recipe[test::adoptopenjdk]
@@ -113,7 +114,8 @@ suites:
113114
variant: openj9
114115
verifier:
115116
inspec_tests: [test/integration/adoptopenjdk]
116-
input_files: [test/integration/adoptopenjdk/attributes/adoptopenjdk-8-openj9.yml]
117+
input_files:
118+
[test/integration/adoptopenjdk/attributes/adoptopenjdk-8-openj9.yml]
117119
- name: adoptopenjdk-8-openj9-large-heap
118120
run_list:
119121
- recipe[test::adoptopenjdk]
@@ -122,7 +124,10 @@ suites:
122124
variant: openj9-large-heap
123125
verifier:
124126
inspec_tests: [test/integration/adoptopenjdk]
125-
input_files: [test/integration/adoptopenjdk/attributes/adoptopenjdk-8-openj9-large-heap.yml]
127+
input_files:
128+
[
129+
test/integration/adoptopenjdk/attributes/adoptopenjdk-8-openj9-large-heap.yml,
130+
]
126131

127132
# Version 11
128133
- name: adoptopenjdk-11-hotspot
@@ -133,7 +138,8 @@ suites:
133138
variant: hotspot
134139
verifier:
135140
inspec_tests: [test/integration/adoptopenjdk]
136-
input_files: [test/integration/adoptopenjdk/attributes/adoptopenjdk-11-hotspot.yml]
141+
input_files:
142+
[test/integration/adoptopenjdk/attributes/adoptopenjdk-11-hotspot.yml]
137143
- name: adoptopenjdk-11-openj9
138144
run_list:
139145
- recipe[test::adoptopenjdk]
@@ -142,7 +148,8 @@ suites:
142148
variant: openj9
143149
verifier:
144150
inspec_tests: [test/integration/adoptopenjdk]
145-
input_files: [test/integration/adoptopenjdk/attributes/adoptopenjdk-11-openj9.yml]
151+
input_files:
152+
[test/integration/adoptopenjdk/attributes/adoptopenjdk-11-openj9.yml]
146153
- name: adoptopenjdk-11-openj9-large-heap
147154
run_list:
148155
- recipe[test::adoptopenjdk]
@@ -151,7 +158,10 @@ suites:
151158
variant: openj9-large-heap
152159
verifier:
153160
inspec_tests: [test/integration/adoptopenjdk]
154-
input_files: [test/integration/adoptopenjdk/attributes/adoptopenjdk-11-openj9-large-heap.yml]
161+
input_files:
162+
[
163+
test/integration/adoptopenjdk/attributes/adoptopenjdk-11-openj9-large-heap.yml,
164+
]
155165

156166
# Version 14
157167
- name: adoptopenjdk-14-openj9-large-heap
@@ -162,7 +172,10 @@ suites:
162172
variant: openj9-large-heap
163173
verifier:
164174
inspec_tests: [test/integration/adoptopenjdk]
165-
input_files: [test/integration/adoptopenjdk/attributes/adoptopenjdk-14-openj9-large-heap.yml]
175+
input_files:
176+
[
177+
test/integration/adoptopenjdk/attributes/adoptopenjdk-14-openj9-large-heap.yml,
178+
]
166179
- name: adoptopenjdk-14-openj9
167180
run_list:
168181
- recipe[test::adoptopenjdk]
@@ -172,7 +185,8 @@ suites:
172185
verifier:
173186
inspec_tests:
174187
- test/integration/adoptopenjdk
175-
input_files: [test/integration/adoptopenjdk/attributes/adoptopenjdk-14-openj9.yml]
188+
input_files:
189+
[test/integration/adoptopenjdk/attributes/adoptopenjdk-14-openj9.yml]
176190
- name: adoptopenjdk-14-hotspot
177191
run_list:
178192
- recipe[test::adoptopenjdk]
@@ -181,7 +195,8 @@ suites:
181195
variant: hotspot
182196
verifier:
183197
inspec_tests: [test/integration/adoptopenjdk]
184-
input_files: [test/integration/adoptopenjdk/attributes/adoptopenjdk-14-hotspot.yml]
198+
input_files:
199+
[test/integration/adoptopenjdk/attributes/adoptopenjdk-14-hotspot.yml]
185200

186201
# 11 Removal
187202
- name: adoptopenjdk-removal-11-openj9
@@ -192,23 +207,31 @@ suites:
192207
variant: openj9
193208
verifier:
194209
inspec_tests: [test/integration/remove-adoptopenjdk]
195-
input_files: [test/integration/adoptopenjdk/attributes/adoptopenjdk-11-openj9.yml]
210+
input_files:
211+
[test/integration/adoptopenjdk/attributes/adoptopenjdk-11-openj9.yml]
196212

197213
# Corretto
198214
- name: corretto-8
199215
run_list:
200216
- recipe[test::corretto]
201-
attributes: {version: '8'}
217+
attributes: {version: "8"}
202218
verifier:
203219
inspec_tests: [test/integration/corretto]
204-
inputs: {java_version: '8'}
220+
inputs: {java_version: "8"}
205221
- name: corretto-11
206222
run_list:
207223
- recipe[test::corretto]
208-
attributes: {version: '11'}
224+
attributes: {version: "11"}
209225
verifier:
210226
inspec_tests: [test/integration/corretto]
211-
inputs: {java_version: '11'}
227+
inputs: {java_version: "11"}
228+
- name: corretto-15
229+
run_list:
230+
- recipe[test::corretto]
231+
attributes: {version: "15"}
232+
verifier:
233+
inspec_tests: [test/integration/corretto]
234+
inputs: {java_version: "15"}
212235

213236
# Custom URL tests
214237
- name: custom-package-8
@@ -254,4 +277,5 @@ suites:
254277
checksum: 6524d85d2ce334c955a4347015567326067ef15fe5f6a805714b25cace256f40
255278
verifier:
256279
inspec_tests: [test/integration/custom-package]
257-
input_files: [test/integration/custom-package/attributes/openj9-large-heap-11.yml]
280+
input_files:
281+
[test/integration/custom-package/attributes/openj9-large-heap-11.yml]

libraries/certificate_helpers.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module Java
2+
module Cookbook
3+
module CertificateHelpers
4+
def default_truststore_path(version, java_home)
5+
if version.to_i > 8
6+
"#{java_home}/lib/security/cacerts"
7+
else
8+
"#{java_home}/jre/lib/security/cacerts"
9+
end
10+
end
11+
12+
def keystore_argument(version, cacerts, truststore_path)
13+
if version.to_i > 8 && cacerts
14+
'-cacerts'
15+
else
16+
"-keystore #{truststore_path}"
17+
end
18+
end
19+
end
20+
end
21+
end

libraries/corretto_helpers.rb

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,29 @@ def default_corretto_url(version)
1010
"https://corretto.aws/downloads/latest/amazon-corretto-8-#{corretto_arch}-linux-jdk.tar.gz"
1111
elsif version.to_s == '11'
1212
"https://corretto.aws/downloads/latest/amazon-corretto-11-#{corretto_arch}-linux-jdk.tar.gz"
13+
elsif version.to_s == '15'
14+
"https://corretto.aws/downloads/latest/amazon-corretto-15-#{corretto_arch}-linux-jdk.tar.gz"
1315
end
1416
end
1517

1618
def default_corretto_checksum(version)
1719
if version.to_s == '8'
1820
if node['kernel']['machine'].match?('x86_64')
19-
'1db9c4bd89b9949c97bc5e690aedce2872bb716cf35c670a29cadeeb80d0cb18'
21+
'5db96ea7c5fa34de4eadbc41e2adf1fccb7e373b5788f77e26e0d69b9e368b7f'
2022
elsif node['kernel']['machine'].match?('aarch64')
21-
'2e3755bac052ad7c502adbaec7823328644af3767abd1169974b144805eb718e'
23+
'124875d5d2b3b540d40a584605385c03e71bf57f782baf5130e0bfee18b680c1'
2224
end
2325
elsif version.to_s == '11'
2426
if node['kernel']['machine'].match?('x86_64')
25-
'dbbf98ca93b44a0c81df5a3a4f2cebf467ec5c30e28c359e26615ffbed0b454f'
27+
'bf9380ee0cdd78fafb6d0cdfa0c1a97baaaec44432a15c8c2f296696ad9ed631'
2628
elsif node['kernel']['machine'].match?('aarch64')
27-
'f278647d126d973a841d80b0b6836b723f14c63ee0d0f1804b8d4125843b13ed'
29+
'18f4716151f4786abe6b185aab2cc5f5ad7b15f899d7eb143a81ccda8690f6f6'
30+
end
31+
elsif version.to_s == '15'
32+
if node['kernel']['machine'].match?('x86_64')
33+
'6bd07d74e11deeba9f8927f8353aa689ffaa2ada263b09a4c297c0c58887af0f'
34+
elsif node['kernel']['machine'].match?('aarch64')
35+
'e5112fec0f4e6f3de048c5bd6a9a690dd07344436985755636df6dc18b4bfb62'
2836
end
2937
end
3038
end
@@ -34,14 +42,18 @@ def default_corretto_bin_cmds(version)
3442
%w(appletviewer clhsdb extcheck hsdb idlj jar jarsigner java java-rmi.cgi javac javadoc javafxpackager javah javap javapackager jcmd jconsole jdb jdeps jfr jhat jinfo jjs jmap jps jrunscript jsadebugd jstack jstat jstatd keytool native2ascii orbd pack200 policytool rmic rmid rmiregistry schemagen serialver servertool tnameserv unpack200 wsgen wsimport xjc)
3543
elsif version.to_s == '11'
3644
%w(jaotc jar jarsigner java javac javadoc javap jcmd jconsole jdb jdeprscan jdeps jfr jhsdb jimage jinfo jjs jlink jmap jmod jps jrunscript jshell jstack jstat jstatd keytool pack200 rmic rmid rmiregistry serialver unpack200)
45+
elsif version.to_s == '15'
46+
%w(jaotc jar jarsigner java javac javadoc javap jcmd jconsole jdb jdeprscan jdeps jfr jhsdb jimage jinfo jlink jmap jmod jpackage jps jrunscript jshell jstack jstat jstatd keytool rmid rmiregistry serialver)
3747
end
3848
end
3949

4050
def corretto_sub_dir(version, full_version = nil)
4151
ver = if version == '8'
42-
full_version || '8.265.01.1'
52+
full_version || '8.282.08.1'
4353
elsif version.to_s == '11'
44-
full_version || '11.0.8.10.1'
54+
full_version || '11.0.10.9.1'
55+
elsif version.to_s == '15'
56+
full_version || '15.0.1.9.1'
4557
end
4658
"amazon-corretto-#{ver}-linux-#{corretto_arch}"
4759
end

0 commit comments

Comments
 (0)