From 90acc28c256788c720518ab44b79e3c29fe7b16f Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 19 Oct 2021 03:30:56 -0700 Subject: [PATCH 001/188] Standardise files with files in sous-chefs/repo-management (#664) Signed-off-by: kitchen-porter --- .github/workflows/md-links.yml | 2 +- CHANGELOG.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/md-links.yml b/.github/workflows/md-links.yml index ba5e3bb2..ba887a16 100644 --- a/.github/workflows/md-links.yml +++ b/.github/workflows/md-links.yml @@ -1,5 +1,5 @@ --- -name: 'Markdown Link Check' +name: md-links "on": pull_request: diff --git a/CHANGELOG.md b/CHANGELOG.md index 99ee26a6..02e32deb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +Standardise files with files in sous-chefs/repo-management + ## 10.1.0 - *2021-10-06* - Revert worklfow split out From 67505a5405eb9e9b57382a681e50517b1dec2d1c Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 19 Oct 2021 03:30:58 -0700 Subject: [PATCH 002/188] Update changelog for 10.1.1 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02e32deb..de1d9b83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 10.1.1 - *2021-10-19* Standardise files with files in sous-chefs/repo-management From f4435502ec22cdf3fae7ebf36b75cca05a6f31ed Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 19 Oct 2021 03:30:59 -0700 Subject: [PATCH 003/188] Update metadata for 10.1.1 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 86d2243b..1ef04ad6 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 15.3' -version '10.1.0' +version '10.1.1' supports 'debian' supports 'ubuntu' From f84e00578bdd552a1a8cf71fd00624f489fa6e00 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 19 Oct 2021 03:31:01 -0700 Subject: [PATCH 004/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index de1d9b83..e2aff987 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 10.1.1 - *2021-10-19* Standardise files with files in sous-chefs/repo-management From 768a2ae772d528f71da1ea082d177a5130e1a7d6 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Wed, 26 Jan 2022 11:43:37 +0000 Subject: [PATCH 005/188] Add test reusable workflow (#665) * Remove Homebrew from the MacOS runlist Signed-off-by: Dan Webb --- .delivery/project.toml | 9 ----- .../{delivery.yml => test-kitchen.yml} | 33 +++---------------- Berksfile | 1 - CHANGELOG.md | 2 ++ kitchen.macos.yml | 1 - 5 files changed, 7 insertions(+), 39 deletions(-) delete mode 100644 .delivery/project.toml rename .github/workflows/{delivery.yml => test-kitchen.yml} (79%) diff --git a/.delivery/project.toml b/.delivery/project.toml deleted file mode 100644 index 0d6f0ae9..00000000 --- a/.delivery/project.toml +++ /dev/null @@ -1,9 +0,0 @@ -[local_phases] -unit = "rspec spec/" -lint = 'cookstyle --display-cop-names --extra-details' -syntax = "echo skipping" -provision = "echo skipping" -deploy = "echo skipping" -smoke = "echo skipping" -functional = "echo skipping" -cleanup = "echo skipping" diff --git a/.github/workflows/delivery.yml b/.github/workflows/test-kitchen.yml similarity index 79% rename from .github/workflows/delivery.yml rename to .github/workflows/test-kitchen.yml index 75a8158a..773ffbc9 100644 --- a/.github/workflows/delivery.yml +++ b/.github/workflows/test-kitchen.yml @@ -1,5 +1,5 @@ --- -name: 'Lint & Unit Test' +name: 'Test' 'on': pull_request: @@ -7,34 +7,11 @@ name: 'Lint & Unit Test' branches: [main] jobs: - delivery: - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v2 - - name: Run Chef Delivery - uses: actionshub/chef-delivery@main - env: - CHEF_LICENSE: accept-no-persist - - yamllint: - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v2 - - name: Run yaml Lint - uses: actionshub/yamllint@main - - mdl: - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v2 - - name: Run Markdown Lint - uses: actionshub/markdownlint@main + lint-unit: + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@0.0.1 integration: - needs: [delivery, yamllint, mdl] + needs: 'lint-unit' runs-on: ubuntu-latest strategy: matrix: @@ -83,7 +60,7 @@ jobs: os: ${{ matrix.os }} integration-macos: - needs: [delivery, yamllint, mdl] + needs: 'lint-unit' runs-on: macos-latest steps: - name: Check out code diff --git a/Berksfile b/Berksfile index 8275f4f3..e09849c7 100644 --- a/Berksfile +++ b/Berksfile @@ -3,6 +3,5 @@ source 'https://supermarket.chef.io' metadata group :integration do - cookbook 'homebrew' cookbook 'test', path: 'test/fixtures/cookbooks/test' end diff --git a/CHANGELOG.md b/CHANGELOG.md index e2aff987..5766f237 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +- Remove delivery and move to calling RSpec directly via a reusable workflow + ## 10.1.1 - *2021-10-19* Standardise files with files in sous-chefs/repo-management diff --git a/kitchen.macos.yml b/kitchen.macos.yml index 7a316d5a..2fc17f27 100644 --- a/kitchen.macos.yml +++ b/kitchen.macos.yml @@ -22,7 +22,6 @@ platforms: suites: - name: adoptopenjdk-14 run_list: - - recipe[homebrew] - recipe[test::adoptopenjdk] attributes: version: 14 From 66954d21b38fa0185c986fdfcdaa7dc0af85f3b3 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 26 Jan 2022 03:43:40 -0800 Subject: [PATCH 006/188] Update changelog for 10.1.2 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5766f237..b71cf68b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 10.1.2 - *2022-01-26* - Remove delivery and move to calling RSpec directly via a reusable workflow From 097843a3f99d5eaaacf3f14899d26ae14e7c4279 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 26 Jan 2022 03:43:40 -0800 Subject: [PATCH 007/188] Update metadata for 10.1.2 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 1ef04ad6..bbed210f 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 15.3' -version '10.1.1' +version '10.1.2' supports 'debian' supports 'ubuntu' From 4f0ad57f55219e887220f350cba19053c7b92b63 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 26 Jan 2022 03:43:42 -0800 Subject: [PATCH 008/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b71cf68b..0e66adb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 10.1.2 - *2022-01-26* - Remove delivery and move to calling RSpec directly via a reusable workflow From 4605b4d06b4bc4d87513524e00e2c575b19af098 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Wed, 26 Jan 2022 11:48:00 +0000 Subject: [PATCH 009/188] Remove brew tap --full option (#666) --full is no longer a valid option Signed-off-by: Dan Webb --- CHANGELOG.md | 2 ++ documentation/resources/adoptopenjdk_install.md | 1 - documentation/resources/adoptopenjdk_macos_install.md | 1 - resources/adoptopenjdk_install.rb | 3 --- resources/adoptopenjdk_macos_install.rb | 5 ----- 5 files changed, 2 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e66adb2..13e67776 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +- Remove tap_full option as this is no longer supported and there is no replacement + ## 10.1.2 - *2022-01-26* - Remove delivery and move to calling RSpec directly via a reusable workflow diff --git a/documentation/resources/adoptopenjdk_install.md b/documentation/resources/adoptopenjdk_install.md index b13aeb84..d4fbea4f 100644 --- a/documentation/resources/adoptopenjdk_install.md +++ b/documentation/resources/adoptopenjdk_install.md @@ -25,7 +25,6 @@ Introduced: v7.0.0 | bin_cmds | Array | | A list of bin_cmds based on the version and variant | | alternatives_priority | Integer | | Alternatives priority to set for this Java | | reset_alternatives | [true, false] | | Whether to reset alternatives before setting | -| tap_full | [true, false] | `true` | Perform a full clone on the tap, as opposed to a shallow clone | | tap_url | String, | | The URL of the tap | | cask_options | String, | | Options to pass to the brew command during installation | | homebrew_path | String, | | The path to the homebrew binary | diff --git a/documentation/resources/adoptopenjdk_macos_install.md b/documentation/resources/adoptopenjdk_macos_install.md index a1da02a3..f5f47dfa 100644 --- a/documentation/resources/adoptopenjdk_macos_install.md +++ b/documentation/resources/adoptopenjdk_macos_install.md @@ -13,7 +13,6 @@ Introduced: v8.1.0 | Name | Type | Default | Description | Allowed Values | | ------------- | ----------------- | -------------------------- | -------------------------------------------------------------- | -| tap_full | [true, false] | `true` | Perform a full clone on the tap, as opposed to a shallow clone | | tap_url | String | | The URL of the tap | | cask_options | String | | Options to pass to the brew command during installation | | homebrew_path | String | | The path to the homebrew binary | diff --git a/resources/adoptopenjdk_install.rb b/resources/adoptopenjdk_install.rb index da258284..6b628708 100644 --- a/resources/adoptopenjdk_install.rb +++ b/resources/adoptopenjdk_install.rb @@ -18,7 +18,6 @@ property :reset_alternatives, [true, false], description: 'Whether to reset alternatives before setting' # MacOS options -property :tap_full, [true, false], default: true, description: 'Perform a full clone on the tap, as opposed to a shallow clone' property :tap_url, String, description: 'The URL of the tap' property :cask_options, String, description: 'Options to pass to the brew command during installation' property :homebrew_path, String, description: 'The path to the homebrew binary' @@ -34,7 +33,6 @@ end adoptopenjdk_macos_install 'homebrew' do - tap_full new_resource.tap_full tap_url new_resource.tap_url cask_options new_resource.cask_options homebrew_path new_resource.homebrew_path @@ -59,7 +57,6 @@ case node['platform_family'] when 'mac_os_x' adoptopenjdk_macos_install 'homebrew' do - tap_full new_resource.tap_full tap_url new_resource.tap_url cask_options new_resource.cask_options homebrew_path new_resource.homebrew_path diff --git a/resources/adoptopenjdk_macos_install.rb b/resources/adoptopenjdk_macos_install.rb index 3e6abf24..21d9dddd 100644 --- a/resources/adoptopenjdk_macos_install.rb +++ b/resources/adoptopenjdk_macos_install.rb @@ -2,10 +2,6 @@ unified_mode true include Java::Cookbook::AdoptOpenJdkMacOsHelpers -property :tap_full, [true, false], - default: true, - description: 'Perform a full clone on the tap, as opposed to a shallow clone' - property :tap_url, String, description: 'The URL of the tap' @@ -40,7 +36,6 @@ action :install do homebrew_tap 'AdoptOpenJDK/openjdk' do - full new_resource.tap_full homebrew_path new_resource.homebrew_path owner new_resource.owner url new_resource.tap_url From 399c915f2c6eb58f0d5d7af9da8e1c52e6fc7f27 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 26 Jan 2022 03:48:04 -0800 Subject: [PATCH 010/188] Update changelog for 10.2.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13e67776..eeece2f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 10.2.0 - *2022-01-26* - Remove tap_full option as this is no longer supported and there is no replacement From d671e4169d099cdc22a45bf2efccaff16374e90c Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 26 Jan 2022 03:48:05 -0800 Subject: [PATCH 011/188] Update metadata for 10.2.0 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index bbed210f..2f86b0c0 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 15.3' -version '10.1.2' +version '10.2.0' supports 'debian' supports 'ubuntu' From 3d96081012bfca15b77b914475c7779dab08be32 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 26 Jan 2022 03:48:07 -0800 Subject: [PATCH 012/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eeece2f4..b87729b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 10.2.0 - *2022-01-26* - Remove tap_full option as this is no longer supported and there is no replacement From 70c1b497e1cff48f649e6ba01e8e391e0deee7c7 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Wed, 2 Feb 2022 11:48:19 +0000 Subject: [PATCH 013/188] Add Cookstyle back into the required checks (#670) * Add Cookstyle back into the required checks Signed-off-by: Dan Webb * Fix name of step Signed-off-by: Dan Webb --- .github/workflows/test-kitchen.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index 773ffbc9..6506fcf0 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -8,7 +8,7 @@ name: 'Test' jobs: lint-unit: - uses: sous-chefs/.github/.github/workflows/lint-unit.yml@0.0.1 + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@0.0.3 integration: needs: 'lint-unit' From dfd00e19bdd510607706c6e652974d556f8d64ed Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 2 Feb 2022 03:48:21 -0800 Subject: [PATCH 014/188] Update changelog for 10.2.1 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b87729b2..ec26d026 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 10.2.1 - *2022-02-02* ## 10.2.0 - *2022-01-26* From 6ad42ed7ac945afdcd7afa01888e7e946ae866f7 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 2 Feb 2022 03:48:22 -0800 Subject: [PATCH 015/188] Update metadata for 10.2.1 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 2f86b0c0..6739f6e3 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 15.3' -version '10.2.0' +version '10.2.1' supports 'debian' supports 'ubuntu' From f7df4aece95ff24b6e33c85126eb2abd377efd91 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 2 Feb 2022 03:48:24 -0800 Subject: [PATCH 016/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec26d026..35fcfafd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 10.2.1 - *2022-02-02* ## 10.2.0 - *2022-01-26* From d5afa1371cf3504499136df1788f684da3462842 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 14 Feb 2022 01:30:27 -0800 Subject: [PATCH 017/188] Standardise files with files in sous-chefs/repo-management (#671) Signed-off-by: kitchen-porter --- .overcommit.yml | 4 ---- CHANGELOG.md | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.overcommit.yml b/.overcommit.yml index 1d27ed8d..cd8682a0 100644 --- a/.overcommit.yml +++ b/.overcommit.yml @@ -11,10 +11,6 @@ PreCommit: enabled: true required_executable: 'cookstyle' command: ["cookstyle"] - Delivery: - enabled: true - required_executable: 'delivery' - flags: ['local', 'all'] CommitMsg: HardTabs: enabled: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 35fcfafd..7d285404 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +Standardise files with files in sous-chefs/repo-management + ## 10.2.1 - *2022-02-02* ## 10.2.0 - *2022-01-26* From 91adf2eb772a993ab9f3cff11df60e74b31c17fe Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 14 Feb 2022 01:30:29 -0800 Subject: [PATCH 018/188] Update changelog for 10.2.2 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d285404..ef3136ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 10.2.2 - *2022-02-14* Standardise files with files in sous-chefs/repo-management From 583e985c456380f6e2c2f7bdbb0c70993cc1f245 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 14 Feb 2022 01:30:30 -0800 Subject: [PATCH 019/188] Update metadata for 10.2.2 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 6739f6e3..6c4a2775 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 15.3' -version '10.2.1' +version '10.2.2' supports 'debian' supports 'ubuntu' From cff777a59cbb64f2a917f38ed333ccf87046f20d Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 14 Feb 2022 01:30:32 -0800 Subject: [PATCH 020/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef3136ce..745fdae7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 10.2.2 - *2022-02-14* Standardise files with files in sous-chefs/repo-management From c8d12caae966cc712ddeccd42be11ab17670dc13 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Wed, 16 Feb 2022 00:32:03 +0000 Subject: [PATCH 021/188] Resource partials (#668) - Require Chef 16 for resource partials - Add resource partials for: MacOS, Linux, Java Home and Common as these are used in a multiple places Signed-off-by: Dan Webb Co-authored-by: Lance Albertson --- CHANGELOG.md | 7 +- metadata.rb | 2 +- resources/adoptopenjdk_install.rb | 41 +++++------ resources/adoptopenjdk_linux_install.rb | 51 ++++---------- resources/adoptopenjdk_macos_install.rb | 44 +++++------- resources/alternatives.rb | 31 +++++---- resources/certificate.rb | 91 ++++++++++++++----------- resources/corretto_install.rb | 45 ++++-------- resources/jce.rb | 34 +++++++-- resources/openjdk_install.rb | 50 +++++++++----- resources/openjdk_pkg_install.rb | 31 +++------ resources/openjdk_source_install.rb | 48 ++++--------- resources/partial/_common.rb | 3 + resources/partial/_java_home.rb | 11 +++ resources/partial/_linux.rb | 11 +++ resources/partial/_macos.rb | 15 ++++ 16 files changed, 267 insertions(+), 248 deletions(-) create mode 100644 resources/partial/_common.rb create mode 100644 resources/partial/_java_home.rb create mode 100644 resources/partial/_linux.rb create mode 100644 resources/partial/_macos.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 745fdae7..fcd9f993 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,17 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +- Require Chef 16 for resource partials +- Add resource partials for: MacOS, Linux, Java Home and Common as these are used in a multiple places + ## 10.2.2 - *2022-02-14* -Standardise files with files in sous-chefs/repo-management +- Standardise files with files in sous-chefs/repo-management ## 10.2.1 - *2022-02-02* +- Standardise files with files in sous-chefs/repo-management + ## 10.2.0 - *2022-01-26* - Remove tap_full option as this is no longer supported and there is no replacement diff --git a/metadata.rb b/metadata.rb index 6c4a2775..407840bd 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,7 +5,7 @@ description 'Recipes and resources for installing Java and managing certificates' source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' -chef_version '>= 15.3' +chef_version '>= 16.0' version '10.2.2' supports 'debian' diff --git a/resources/adoptopenjdk_install.rb b/resources/adoptopenjdk_install.rb index 6b628708..45743a19 100644 --- a/resources/adoptopenjdk_install.rb +++ b/resources/adoptopenjdk_install.rb @@ -1,27 +1,30 @@ provides :adoptopenjdk_install unified_mode true -# Common options -property :version, String, name_property: true, description: 'Java version to install' +property :variant, + String, + description: 'Install flavour', default: 'openj9' -# Linux options -property :variant, String, description: 'Install flavour', default: 'openj9' -property :url, String, description: 'The URL to download from' -property :checksum, String, description: 'The checksum for the downloaded file' -property :java_home, String, description: 'Set to override the java_home' -property :java_home_mode, String, description: 'The permission for the Java home directory' -property :java_home_owner, String, description: 'Owner of the Java Home' -property :java_home_group, String, description: 'Group for the Java Home' -property :default, [true, false], description: ' Whether to set this as the default Java' -property :bin_cmds, Array, description: 'A list of bin_cmds based on the version and variant' -property :alternatives_priority, Integer, description: 'Alternatives priority to set for this Java' -property :reset_alternatives, [true, false], description: 'Whether to reset alternatives before setting' +property :url, + String, + description: 'The URL to download from' -# MacOS options -property :tap_url, String, description: 'The URL of the tap' -property :cask_options, String, description: 'Options to pass to the brew command during installation' -property :homebrew_path, String, description: 'The path to the homebrew binary' -property :owner, [String, Integer], description: 'The owner of the Homebrew installation' +property :checksum, + String, + description: 'The checksum for the downloaded file' + +property :java_home, + String, + description: 'Set to override the java_home' + +property :bin_cmds, + Array, + description: 'A list of bin_cmds based on the version and variant' + +use 'partial/_common' +use 'partial/_linux' +use 'partial/_java_home' +use 'partial/_macos' action :install do case node['platform_family'] diff --git a/resources/adoptopenjdk_linux_install.rb b/resources/adoptopenjdk_linux_install.rb index 631d9246..126652b9 100644 --- a/resources/adoptopenjdk_linux_install.rb +++ b/resources/adoptopenjdk_linux_install.rb @@ -2,52 +2,31 @@ unified_mode true include Java::Cookbook::AdoptOpenJdkHelpers -property :version, String, name_property: true, description: 'Java version to install' - property :variant, String, - equal_to: %w(hotspot openj9 openj9-large-heap), - default: 'openj9', - description: 'Install flavour' + equal_to: %w(hotspot openj9 openj9-large-heap), + default: 'openj9', + description: 'Install flavour' property :url, String, - default: lazy { default_adopt_openjdk_url(version)[variant] }, - description: 'The URL to download from' + default: lazy { default_adopt_openjdk_url(version)[variant] }, + description: 'The URL to download from' property :checksum, String, - regex: /^[0-9a-f]{32}$|^[a-zA-Z0-9]{40,64}$/, - default: lazy { default_adopt_openjdk_checksum(version)[variant] }, - description: 'The checksum for the downloaded file' + regex: /^[0-9a-f]{32}$|^[a-zA-Z0-9]{40,64}$/, + default: lazy { default_adopt_openjdk_checksum(version)[variant] }, + description: 'The checksum for the downloaded file' property :java_home, String, - default: lazy { "/usr/lib/jvm/java-#{version}-adoptopenjdk-#{variant}/#{sub_dir(url)}" }, - description: 'Set to override the java_home' - -property :java_home_mode, String, - description: 'The permission for the Java home directory' - -property :java_home_owner, String, - default: 'root', - description: 'Owner of the Java Home' - -property :java_home_group, String, - default: lazy { node['root_group'] }, - description: 'Group for the Java Home' - -property :default, [true, false], - default: true, - description: ' Whether to set this as the defalut Java' + default: lazy { "/usr/lib/jvm/java-#{version}-adoptopenjdk-#{variant}/#{sub_dir(url)}" }, + description: 'Set to override the java_home' property :bin_cmds, Array, - default: lazy { default_adopt_openjdk_bin_cmds(version)[variant] }, - description: 'A list of bin_cmds based on the version and variant' - -property :alternatives_priority, Integer, - default: 1, - description: 'Alternatives priority to set for this Java' + default: lazy { default_adopt_openjdk_bin_cmds(version)[variant] }, + description: 'A list of bin_cmds based on the version and variant' -property :reset_alternatives, [true, false], - default: true, - description: 'Whether to reset alternatives before setting' +use 'partial/_common' +use 'partial/_linux' +use 'partial/_java_home' action :install do extract_dir = new_resource.java_home.split('/')[0..-2].join('/') diff --git a/resources/adoptopenjdk_macos_install.rb b/resources/adoptopenjdk_macos_install.rb index 21d9dddd..92fd6c7e 100644 --- a/resources/adoptopenjdk_macos_install.rb +++ b/resources/adoptopenjdk_macos_install.rb @@ -2,37 +2,27 @@ unified_mode true include Java::Cookbook::AdoptOpenJdkMacOsHelpers -property :tap_url, String, - description: 'The URL of the tap' - -property :cask_options, String, - description: 'Options to pass to the brew command during installation' - -property :homebrew_path, String, - description: 'The path to the homebrew binary' - -property :owner, [String, Integer], - description: 'The owner of the Homebrew installation' +use 'partial/_macos' property :java_home, String, - default: lazy { macos_java_home(version) }, - description: 'MacOS specific JAVA_HOME' + default: lazy { macos_java_home(version) }, + description: 'MacOS specific JAVA_HOME' property :version, String, - default: 'adoptopenjdk14', - equal_to: %w( - adoptopenjdk8 adoptopenjdk8-openj9 adoptopenjdk8-openj9-large - adoptopenjdk8-jre adoptopenjdk8-openj9-jre adoptopenjdk8-jre-large - adoptopenjdk9 adoptopenjdk10 - adoptopenjdk11 adoptopenjdk11-openj9 adoptopenjdk11-openj9-large - adoptopenjdk11-jre adoptopenjdk11-openj9-jre adoptopenjdk11-openj9-jre-large - adoptopenjdk12 adoptopenjdk12-openj9 adoptopenjdk12-openj9-large - adoptopenjdk12-jre adoptopenjdk12-openj9-jre adoptopenjdk12-openj9-jre-large - adoptopenjdk13 adoptopenjdk13-openj9 adoptopenjdk13-openj9-large - adoptopenjdk13-jre adoptopenjdk13-openj9-jre adoptopenjdk13-openj9-jre-large - adoptopenjdk14 adoptopenjdk14-openj9 adoptopenjdk14-openj9-large - adoptopenjdk14-jre adoptopenjdk14-openj9-jre adoptopenjdk14-openj9-jre-large - ) + default: 'adoptopenjdk14', + equal_to: %w( + adoptopenjdk8 adoptopenjdk8-openj9 adoptopenjdk8-openj9-large + adoptopenjdk8-jre adoptopenjdk8-openj9-jre adoptopenjdk8-jre-large + adoptopenjdk9 adoptopenjdk10 + adoptopenjdk11 adoptopenjdk11-openj9 adoptopenjdk11-openj9-large + adoptopenjdk11-jre adoptopenjdk11-openj9-jre adoptopenjdk11-openj9-jre-large + adoptopenjdk12 adoptopenjdk12-openj9 adoptopenjdk12-openj9-large + adoptopenjdk12-jre adoptopenjdk12-openj9-jre adoptopenjdk12-openj9-jre-large + adoptopenjdk13 adoptopenjdk13-openj9 adoptopenjdk13-openj9-large + adoptopenjdk13-jre adoptopenjdk13-openj9-jre adoptopenjdk13-openj9-jre-large + adoptopenjdk14 adoptopenjdk14-openj9 adoptopenjdk14-openj9-large + adoptopenjdk14-jre adoptopenjdk14-openj9-jre adoptopenjdk14-openj9-jre-large + ) action :install do homebrew_tap 'AdoptOpenJDK/openjdk' do diff --git a/resources/alternatives.rb b/resources/alternatives.rb index 26bb6ec1..bb5b820a 100644 --- a/resources/alternatives.rb +++ b/resources/alternatives.rb @@ -1,22 +1,27 @@ unified_mode true -property :java_location, String, - description: 'Java installation location' +property :java_location, + String, + description: 'Java installation location' -property :bin_cmds, Array, - description: 'Array of Java tool names to set or unset alternatives on' +property :bin_cmds, + Array, + description: 'Array of Java tool names to set or unset alternatives on' -property :default, [true, false], - default: true, - description: 'Whether to set the Java tools as system default. Boolean, defaults to `true`' +property :default, + [true, false], + default: true, + description: 'Whether to set the Java tools as system default. Boolean, defaults to `true`' -property :priority, Integer, - default: 1061, - description: ' Priority of the alternatives. Integer, defaults to `1061`' +property :priority, + Integer, + default: 1061, + description: ' Priority of the alternatives. Integer, defaults to `1061`' -property :reset_alternatives, [true, false], - default: true, - description: 'Whether to reset alternatives before setting them' +property :reset_alternatives, + [true, false], + default: true, + description: 'Whether to reset alternatives before setting them' action :set do if new_resource.bin_cmds diff --git a/resources/certificate.rb b/resources/certificate.rb index 6fc1f32a..1c5286fe 100644 --- a/resources/certificate.rb +++ b/resources/certificate.rb @@ -1,46 +1,57 @@ unified_mode true include Java::Cookbook::CertificateHelpers -property :cert_alias, String, - name_property: true, - description: 'The alias of the certificate in the keystore. This defaults to the name of the resource' - -property :java_home, String, - default: lazy { node['java']['java_home'] }, - description: 'The java home directory' - -property :java_version, String, - default: lazy { node['java']['jdk_version'] }, - description: 'The major java version' - -property :cacerts, [true, false], - default: true, - description: 'Specify true for interacting with the Java installation cacerts file. (Java 9+)' - -property :keystore_path, String, - default: lazy { default_truststore_path(java_version, java_home) }, - description: 'Path to the keystore' - -property :keystore_passwd, String, - default: 'changeit', - description: 'Password to the keystore' - -property :cert_data, String, - description: 'The certificate data to install' - -property :cert_file, String, - description: 'Path to a certificate file to install' - -property :ssl_endpoint, String, - description: 'An SSL end-point from which to download the certificate' - -property :starttls, String, - equal_to: %w(smtp pop3 imap ftp xmpp xmpp-server irc postgres mysql lmtp nntp sieve ldap), - description: 'A protocol specific STARTTLS argument to use when fetching from an ssl_endpoint' - -property :file_cache_path, String, - default: Chef::Config[:file_cache_path], - description: 'Location to store certificate files' +property :cert_alias, + String, + name_property: true, + description: 'The alias of the certificate in the keystore. This defaults to the name of the resource' + +property :java_home, + String, + default: lazy { node['java']['java_home'] }, + description: 'The java home directory' + +property :java_version, + String, + default: lazy { node['java']['jdk_version'] }, + description: 'The major java version' + +property :cacerts, + [true, false], + default: true, + description: 'Specify true for interacting with the Java installation cacerts file. (Java 9+)' + +property :keystore_path, + String, + default: lazy { default_truststore_path(java_version, java_home) }, + description: 'Path to the keystore' + +property :keystore_passwd, + String, + default: 'changeit', + description: 'Password to the keystore' + +property :cert_data, + String, + description: 'The certificate data to install' + +property :cert_file, + String, + description: 'Path to a certificate file to install' + +property :ssl_endpoint, + String, + description: 'An SSL end-point from which to download the certificate' + +property :starttls, + String, + equal_to: %w(smtp pop3 imap ftp xmpp xmpp-server irc postgres mysql lmtp nntp sieve ldap), + description: 'A protocol specific STARTTLS argument to use when fetching from an ssl_endpoint' + +property :file_cache_path, + String, + default: Chef::Config[:file_cache_path], + description: 'Location to store certificate files' action :install do require 'openssl' diff --git a/resources/corretto_install.rb b/resources/corretto_install.rb index 7bec5112..245cea2e 100644 --- a/resources/corretto_install.rb +++ b/resources/corretto_install.rb @@ -2,49 +2,28 @@ unified_mode true include Java::Cookbook::CorrettoHelpers -property :version, String, name_property: true, description: 'Java version to install' property :full_version, String, - description: 'Used to configure the package directory, change this is the version installed by the package is no longer correct' + description: 'Used to configure the package directory, change this is the version installed by the package is no longer correct' property :url, String, - default: lazy { default_corretto_url(version) }, - description: 'The URL to download from' + default: lazy { default_corretto_url(version) }, + description: 'The URL to download from' property :checksum, String, - regex: /^[0-9a-f]{32}$|^[a-zA-Z0-9]{40,64}$/, - description: 'The checksum for the downloaded file' + regex: /^[0-9a-f]{32}$|^[a-zA-Z0-9]{40,64}$/, + description: 'The checksum for the downloaded file' property :java_home, String, - default: lazy { "/usr/lib/jvm/java-#{version}-corretto/#{corretto_sub_dir(version, full_version)}" }, - description: 'Set to override the java_home' - -property :java_home_mode, String, - default: '0755', - description: 'The permission for the Java home directory' - -property :java_home_owner, String, - default: 'root', - description: 'Owner of the Java Home' - -property :java_home_group, String, - default: lazy { node['root_group'] }, - description: 'Group for the Java Home' - -property :default, [true, false], - default: true, - description: ' Whether to set this as the defalut Java' + default: lazy { "/usr/lib/jvm/java-#{version}-corretto/#{corretto_sub_dir(version, full_version)}" }, + description: 'Set to override the java_home' property :bin_cmds, Array, - default: lazy { default_corretto_bin_cmds(version) }, - description: 'A list of bin_cmds based on the version and variant' - -property :alternatives_priority, Integer, - default: 1, - description: 'Alternatives priority to set for this Java' + default: lazy { default_corretto_bin_cmds(version) }, + description: 'A list of bin_cmds based on the version and variant' -property :reset_alternatives, [true, false], - default: true, - description: 'Whether to reset alternatives before setting' +use 'partial/_common' +use 'partial/_linux' +use 'partial/_java_home' action :install do extract_dir = new_resource.java_home.split('/')[0..-2].join('/') diff --git a/resources/jce.rb b/resources/jce.rb index e2df51cd..ee11918b 100644 --- a/resources/jce.rb +++ b/resources/jce.rb @@ -1,12 +1,32 @@ unified_mode true -property :jdk_version, String, default: lazy { node['java']['jdk_version'].to_s }, description: 'The Java version to install into' -property :jce_url, String, default: lazy { node['java']['oracle']['jce'][jdk_version]['url'] }, description: 'The URL for the JCE distribution' -property :jce_checksum, String, default: lazy { node['java']['oracle']['jce'][jdk_version]['checksum'] }, description: 'The checksum of the JCE distribution' -property :java_home, String, default: lazy { node['java']['java_home'] }, description: 'The location of the Java installation' -property :jce_home, String, default: lazy { node['java']['oracle']['jce']['home'] }, description: 'The location where JCE files will be decompressed for installation' -property :jce_cookie, String, default: lazy { node['java']['oracle']['accept_oracle_download_terms'] ? 'oraclelicense=accept-securebackup-cookie' : '' }, description: 'Indicates that you accept Oracles EULA' -property :principal, String, default: lazy { platform_family?('windows') ? node['java']['windows']['owner'] : 'administrator' }, description: 'For Windows installations only, this determines the owner of the JCE files' +property :jdk_version, + String, + default: lazy { node['java']['jdk_version'].to_s }, description: 'The Java version to install into' + +property :jce_url, + String, + default: lazy { node['java']['oracle']['jce'][jdk_version]['url'] }, description: 'The URL for the JCE distribution' + +property :jce_checksum, + String, + default: lazy { node['java']['oracle']['jce'][jdk_version]['checksum'] }, description: 'The checksum of the JCE distribution' + +property :java_home, + String, + default: lazy { node['java']['java_home'] }, description: 'The location of the Java installation' + +property :jce_home, + String, + default: lazy { node['java']['oracle']['jce']['home'] }, description: 'The location where JCE files will be decompressed for installation' + +property :jce_cookie, + String, + default: lazy { node['java']['oracle']['accept_oracle_download_terms'] ? 'oraclelicense=accept-securebackup-cookie' : '' }, description: 'Indicates that you accept Oracles EULA' + +property :principal, + String, + default: lazy { platform_family?('windows') ? node['java']['windows']['owner'] : 'administrator' }, description: 'For Windows installations only, this determines the owner of the JCE files' action :install do jdk_version = new_resource.jdk_version diff --git a/resources/openjdk_install.rb b/resources/openjdk_install.rb index 58532609..137a13b2 100644 --- a/resources/openjdk_install.rb +++ b/resources/openjdk_install.rb @@ -2,23 +2,39 @@ unified_mode true include Java::Cookbook::OpenJdkHelpers -property :version, String, name_property: true, description: 'Java major version to install' -property :install_type, String, - default: lazy { default_openjdk_install_method(version) }, - equal_to: %w( package source ), - description: 'Installation type' -property :pkg_names, [String, Array], description: 'List of packages to install' -property :pkg_version, String, description: 'Package version to install' -property :java_home, String, description: 'Set to override the java_home' -property :default, [true, false], description: ' Whether to set this as the defalut Java' -property :bin_cmds, Array, description: 'A list of bin_cmds based on the version and variant' -property :alternatives_priority, Integer, description: 'Alternatives priority to set for this Java' -property :reset_alternatives, [true, false], description: 'Whether to reset alternatives before setting' -property :url, String, description: 'The URL to download from' -property :checksum, String, description: 'The checksum for the downloaded file' -property :java_home_mode, String, description: 'The permission for the Java home directory' -property :java_home_owner, String, description: 'Owner of the Java Home' -property :java_home_group, String, description: 'Group for the Java Home' +property :install_type, + String, + default: lazy { default_openjdk_install_method(version) }, + equal_to: %w( package source ), + description: 'Installation type' + +property :pkg_names, + [String, Array], + description: 'List of packages to install' + +property :pkg_version, + String, + description: 'Package version to install' + +property :java_home, + String, + description: 'Set to override the java_home' + +property :bin_cmds, + Array, + description: 'A list of bin_cmds based on the version and variant' + +property :url, + String, + description: 'The URL to download from' + +property :checksum, + String, + description: 'The checksum for the downloaded file' + +use 'partial/_common' +use 'partial/_linux' +use 'partial/_java_home' action :install do if new_resource.install_type == 'package' diff --git a/resources/openjdk_pkg_install.rb b/resources/openjdk_pkg_install.rb index 4d053e7f..7e2f7725 100644 --- a/resources/openjdk_pkg_install.rb +++ b/resources/openjdk_pkg_install.rb @@ -2,36 +2,27 @@ unified_mode true include Java::Cookbook::OpenJdkHelpers -property :version, String, - name_property: true, - description: 'Java major version to install' - property :pkg_names, [String, Array], - default: lazy { default_openjdk_pkg_names(version) }, - description: 'List of packages to install' + default: lazy { default_openjdk_pkg_names(version) }, + description: 'List of packages to install' property :pkg_version, String, - description: 'Package version to install' + description: 'Package version to install' property :java_home, String, - default: lazy { default_openjdk_pkg_java_home(version) }, - description: 'Set to override the java_home' - -property :default, [true, false], - default: true, - description: ' Whether to set this as the defalut Java' + default: lazy { default_openjdk_pkg_java_home(version) }, + description: 'Set to override the java_home' property :bin_cmds, Array, - default: lazy { default_openjdk_bin_cmds(version) }, - description: 'A list of bin_cmds based on the version and variant' + default: lazy { default_openjdk_bin_cmds(version) }, + description: 'A list of bin_cmds based on the version and variant' property :alternatives_priority, Integer, - default: 1062, - description: 'Alternatives priority to set for this Java' + default: 1062, + description: 'Alternatives priority to set for this Java' -property :reset_alternatives, [true, false], - default: true, - description: 'Whether to reset alternatives before setting' +use 'partial/_common' +use 'partial/_linux' action :install do if platform?('ubuntu') diff --git a/resources/openjdk_source_install.rb b/resources/openjdk_source_install.rb index 61fa7e54..f999712e 100644 --- a/resources/openjdk_source_install.rb +++ b/resources/openjdk_source_install.rb @@ -3,49 +3,29 @@ include Java::Cookbook::OpenJdkHelpers property :version, String, - name_property: true, - description: 'Java version to install' + name_property: true, + description: 'Java version to install' property :url, String, - default: lazy { default_openjdk_url(version) }, - description: 'The URL to download from' + default: lazy { default_openjdk_url(version) }, + description: 'The URL to download from' property :checksum, String, - regex: /^[0-9a-f]{32}$|^[a-zA-Z0-9]{40,64}$/, - default: lazy { default_openjdk_checksum(version) }, - description: 'The checksum for the downloaded file' + regex: /^[0-9a-f]{32}$|^[a-zA-Z0-9]{40,64}$/, + default: lazy { default_openjdk_checksum(version) }, + description: 'The checksum for the downloaded file' property :java_home, String, - default: lazy { "/usr/lib/jvm/java-#{version}-openjdk/jdk-#{version}" }, - description: 'Set to override the java_home' - -property :java_home_mode, String, - default: '0755', - description: 'The permission for the Java home directory' - -property :java_home_owner, String, - default: 'root', - description: 'Owner of the Java Home' - -property :java_home_group, String, - default: lazy { node['root_group'] }, - description: 'Group for the Java Home' - -property :default, [true, false], - default: true, - description: ' Whether to set this as the defalut Java' + default: lazy { "/usr/lib/jvm/java-#{version}-openjdk/jdk-#{version}" }, + description: 'Set to override the java_home' property :bin_cmds, Array, - default: lazy { default_openjdk_bin_cmds(version) }, - description: 'A list of bin_cmds based on the version and variant' - -property :alternatives_priority, Integer, - default: 1, - description: 'Alternatives priority to set for this Java' + default: lazy { default_openjdk_bin_cmds(version) }, + description: 'A list of bin_cmds based on the version and variant' -property :reset_alternatives, [true, false], - default: true, - description: 'Whether to reset alternatives before setting' +use 'partial/_common' +use 'partial/_linux' +use 'partial/_java_home' action :install do extract_dir = new_resource.java_home.split('/')[0..-2].join('/') diff --git a/resources/partial/_common.rb b/resources/partial/_common.rb new file mode 100644 index 00000000..1e8f424c --- /dev/null +++ b/resources/partial/_common.rb @@ -0,0 +1,3 @@ +property :version, String, + name_property: true, + description: 'Java version to install' diff --git a/resources/partial/_java_home.rb b/resources/partial/_java_home.rb new file mode 100644 index 00000000..8abdfc15 --- /dev/null +++ b/resources/partial/_java_home.rb @@ -0,0 +1,11 @@ +property :java_home_mode, String, + default: '0755', + description: 'The permission for the Java home directory' + +property :java_home_owner, String, + default: 'root', + description: 'Owner of the Java Home' + +property :java_home_group, String, + default: lazy { node['root_group'] }, + description: 'Group for the Java Home' diff --git a/resources/partial/_linux.rb b/resources/partial/_linux.rb new file mode 100644 index 00000000..3fcad6c0 --- /dev/null +++ b/resources/partial/_linux.rb @@ -0,0 +1,11 @@ +property :alternatives_priority, Integer, + default: 1, + description: 'Alternatives priority to set for this Java' + +property :reset_alternatives, [true, false], + default: true, + description: 'Whether to reset alternatives before setting' + +property :default, [true, false], + default: true, + description: ' Whether to set this as the default Java' diff --git a/resources/partial/_macos.rb b/resources/partial/_macos.rb new file mode 100644 index 00000000..2e872fc3 --- /dev/null +++ b/resources/partial/_macos.rb @@ -0,0 +1,15 @@ +property :tap_url, + String, + description: 'The URL of the tap' + +property :cask_options, + String, + description: 'Options to pass to the brew command during installation' + +property :homebrew_path, + String, + description: 'The path to the homebrew binary' + +property :owner, + [String, Integer], + description: 'The owner of the Homebrew installation' From 1e6f9171824d621251664b20b0fc6071daee6065 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 15 Feb 2022 16:32:05 -0800 Subject: [PATCH 022/188] Update changelog for 11.0.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcd9f993..2da5506a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.0.0 - *2022-02-16* - Require Chef 16 for resource partials - Add resource partials for: MacOS, Linux, Java Home and Common as these are used in a multiple places From 6cdb766a1424fedae6f604979997c046a2f6d286 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 15 Feb 2022 16:32:06 -0800 Subject: [PATCH 023/188] Update metadata for 11.0.0 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 407840bd..39af0012 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '10.2.2' +version '11.0.0' supports 'debian' supports 'ubuntu' From df2f641d4dcad6aa7480414001cba27013c116f4 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 15 Feb 2022 16:32:08 -0800 Subject: [PATCH 024/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2da5506a..a1fa4063 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.0.0 - *2022-02-16* - Require Chef 16 for resource partials From 801ee50cd4a0f2a755e8e010e20da822dca5e5cd Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Wed, 16 Feb 2022 13:55:07 +0000 Subject: [PATCH 025/188] Elevate permissions for GitHub reuable workflow (#672) This will allow the reusable workflow to post problems back to the open PR Signed-off-by: Dan Webb --- .github/workflows/test-kitchen.yml | 6 ++++++ CHANGELOG.md | 2 ++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index 6506fcf0..c5a70cee 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -9,6 +9,12 @@ name: 'Test' jobs: lint-unit: uses: sous-chefs/.github/.github/workflows/lint-unit.yml@0.0.3 + permissions: + actions: write + checks: write + pull-requests: write + statuses: write + issues: write integration: needs: 'lint-unit' diff --git a/CHANGELOG.md b/CHANGELOG.md index a1fa4063..026a48bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +- Elevate permissions for reuable workflow + ## 11.0.0 - *2022-02-16* - Require Chef 16 for resource partials From ac468761780afc953140a92b7221eaf4e3677889 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 16 Feb 2022 05:55:10 -0800 Subject: [PATCH 026/188] Update changelog for 11.0.1 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 026a48bf..63e6095b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.0.1 - *2022-02-16* - Elevate permissions for reuable workflow From e27c321de70c0a0e5a23596f0a4b4f134a8105b9 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 16 Feb 2022 05:55:10 -0800 Subject: [PATCH 027/188] Update metadata for 11.0.1 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 39af0012..f63687ac 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.0.0' +version '11.0.1' supports 'debian' supports 'ubuntu' From 0755cd24ee85af691324229b3f306c81291e4310 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 16 Feb 2022 05:55:12 -0800 Subject: [PATCH 028/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63e6095b..2dcee4f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.0.1 - *2022-02-16* - Elevate permissions for reuable workflow From 82b910c194392483f2c4467889bb379377f60a55 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 20 Apr 2022 07:31:20 -0700 Subject: [PATCH 029/188] Standardise files with files in sous-chefs/repo-management (#673) Signed-off-by: kitchen-porter --- CHANGELOG.md | 2 ++ chefignore | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dcee4f9..d40ad508 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +Standardise files with files in sous-chefs/repo-management + ## 11.0.1 - *2022-02-16* - Elevate permissions for reuable workflow diff --git a/chefignore b/chefignore index cc170ea7..a27b0b25 100644 --- a/chefignore +++ b/chefignore @@ -61,7 +61,7 @@ Dangerfile examples/* features/* Guardfile -kitchen.yml* +kitchen*.yml mlc_config.json Procfile Rakefile From 4ddc0bffa3382d4bac73ee7eef97130dde4c8498 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 20 Apr 2022 07:31:23 -0700 Subject: [PATCH 030/188] Update changelog for 11.0.2 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d40ad508..865f8619 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.0.2 - *2022-04-20* Standardise files with files in sous-chefs/repo-management From b87f675e86f60b3aaa9a9f218ec8a973228acd51 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 20 Apr 2022 07:31:23 -0700 Subject: [PATCH 031/188] Update metadata for 11.0.2 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index f63687ac..285f9c22 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.0.1' +version '11.0.2' supports 'debian' supports 'ubuntu' From ef927e5820fbf3db1d914f1cba4420f132362503 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 20 Apr 2022 07:31:25 -0700 Subject: [PATCH 032/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 865f8619..c30be027 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.0.2 - *2022-04-20* Standardise files with files in sous-chefs/repo-management From 8437399621e26717afef88947a574625a62a7b9a Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Tue, 26 Apr 2022 13:15:31 +0100 Subject: [PATCH 033/188] Update Corretto URLs (#675) - Remove Correto 15 and 16 - Add Corretto 17 and 18 - Change the default download URL for Corretto to the versioned resources URL, rather than the latest. - Add default_corretto_minor helper to find out a default minor version for a given major - Fix default_corretto_minor helper to accept full versions - Move logic for full_version out of the major-to-minor method Signed-off-by: Dan Webb --- .github/workflows/test-kitchen.yml | 4 +- CHANGELOG.md | 6 +- kitchen.yml | 12 +- libraries/corretto_helpers.rb | 43 +++--- spec/libraries/corretto_helpers_spec.rb | 170 ++++++++++++------------ 5 files changed, 119 insertions(+), 116 deletions(-) diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index c5a70cee..9997005c 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -44,8 +44,8 @@ jobs: - adoptopenjdk-removal-11-openj9 - corretto-8 - corretto-11 - - corretto-15 - - corretto-16 + - corretto-17 + - corretto-18 - custom-package-8 - custom-package-11 - custom-package-11-openj9 diff --git a/CHANGELOG.md b/CHANGELOG.md index c30be027..4e94ae93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,13 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +- Remove Correto 15 and 16 +- Add Corretto 17 and 18 +- Change the defualt download URL for Corretto to the versioned resources URL, rather than latest. + ## 11.0.2 - *2022-04-20* -Standardise files with files in sous-chefs/repo-management +- Standardise files with files in sous-chefs/repo-management ## 11.0.1 - *2022-02-16* diff --git a/kitchen.yml b/kitchen.yml index 3dc6ae76..7b14a831 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -166,20 +166,20 @@ suites: verifier: inspec_tests: [test/integration/corretto] inputs: {java_version: "11"} - - name: corretto-15 + - name: corretto-17 run_list: - recipe[test::corretto] - attributes: {version: "15"} + attributes: {version: "17"} verifier: inspec_tests: [test/integration/corretto] - inputs: {java_version: "15"} - - name: corretto-16 + inputs: {java_version: "17"} + - name: corretto-18 run_list: - recipe[test::corretto] - attributes: {version: "16"} + attributes: {version: "18"} verifier: inspec_tests: [test/integration/corretto] - inputs: {java_version: "16"} + inputs: {java_version: "18"} # Custom URL tests - name: custom-package-8 diff --git a/libraries/corretto_helpers.rb b/libraries/corretto_helpers.rb index a6c48faa..350e5f54 100644 --- a/libraries/corretto_helpers.rb +++ b/libraries/corretto_helpers.rb @@ -5,45 +5,44 @@ def corretto_arch node['kernel']['machine'].match?('aarch64') ? 'aarch64' : 'x64' end - def default_corretto_url(version) - "https://corretto.aws/downloads/latest/amazon-corretto-#{version}-#{corretto_arch}-linux-jdk.tar.gz" - end - def default_corretto_bin_cmds(version) case version.to_s when '8' %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) when '11' %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) - when '15' - %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) - when '16' + when '15', '17', '18' %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) else raise 'Corretto version not recognised' end end - def corretto_sub_dir(version, full_version = nil) - if full_version.nil? - case version - when '8' - ver = '8.302.08.1' - when '11' - ver = '11.0.12.7.1' - when '15' - ver = '15.0.2.7.1' - when '16' - ver = '16.0.2.7.1' - else - raise 'Corretto version not recognised' - end + def default_corretto_minor(version) + case version + when '8' + '8.332.08.1' + when '11' + '11.0.15.9.1' + when '17' + '17.0.3.6.1' + when '18' + '18.0.1.10.1' else - ver = full_version + raise 'Corretto version not recognised' end + end + def corretto_sub_dir(version, full_version = nil) + ver = full_version.nil? ? default_corretto_minor(version) : full_version "amazon-corretto-#{ver}-linux-#{corretto_arch}" end + + def default_corretto_url(version) + ver = version.include?('.') ? version : default_corretto_minor(version) + + "https://corretto.aws/downloads/resources/#{ver}/amazon-corretto-#{ver}-linux-#{corretto_arch}.tar.gz" + end end end end diff --git a/spec/libraries/corretto_helpers_spec.rb b/spec/libraries/corretto_helpers_spec.rb index 9bc1cc32..c7239dad 100644 --- a/spec/libraries/corretto_helpers_spec.rb +++ b/spec/libraries/corretto_helpers_spec.rb @@ -31,21 +31,21 @@ class DummyClass < Chef::Node end end - context 'Corretto 15 x64' do - let(:version) { '15' } + context 'Corretto 17 x64' do + let(:version) { '17' } let(:machine) { 'x86_64' } it 'returns the correct URL' do - expect(subject.default_corretto_url(version)).to match /corretto-15.+\.tar.gz/ + expect(subject.default_corretto_url(version)).to match /corretto-17.+\.tar.gz/ end end - context 'Corretto 16 x64' do - let(:version) { '16' } + context 'Corretto 18 x64' do + let(:version) { '18' } let(:machine) { 'x86_64' } it 'returns the correct URL' do - expect(subject.default_corretto_url(version)).to match /corretto-16.+\.tar.gz/ + expect(subject.default_corretto_url(version)).to match /corretto-18.+\.tar.gz/ end end @@ -67,21 +67,21 @@ class DummyClass < Chef::Node end end - context 'Corretto 15 aarch64' do - let(:version) { '15' } + context 'Corretto 17 aarch64' do + let(:version) { '17' } let(:machine) { 'aarch64' } it 'returns the correct URL' do - expect(subject.default_corretto_url(version)).to match /corretto-15.+\.tar.gz/ + expect(subject.default_corretto_url(version)).to match /corretto-17.+\.tar.gz/ end end - context 'Corretto 16 aarch64' do - let(:version) { '16' } + context 'Corretto 18 aarch64' do + let(:version) { '18' } let(:machine) { 'aarch64' } it 'returns the correct URL' do - expect(subject.default_corretto_url(version)).to match /corretto-16.+\.tar.gz/ + expect(subject.default_corretto_url(version)).to match /corretto-18.+\.tar.gz/ end end end @@ -109,120 +109,120 @@ class DummyClass < Chef::Node end end - context 'Corretto 15' do - let(:version) { '15' } + context 'Corretto 17' do + let(:version) { '17' } it 'returns the correct bin command array' do - expect(subject.default_corretto_bin_cmds(version)).to_not include 'unpack200' + expect(subject.default_corretto_bin_cmds(version)).to_not include 'jjs' expect(subject.default_corretto_bin_cmds(version)).to include 'jaotc' end end - context 'Corretto 16' do - let(:version) { '16' } + context 'Corretto 18' do + let(:version) { '18' } it 'returns the correct bin command array' do - expect(subject.default_corretto_bin_cmds(version)).to_not include 'unpack200' + expect(subject.default_corretto_bin_cmds(version)).to_not include 'jjs' expect(subject.default_corretto_bin_cmds(version)).to include 'jaotc' end end - end - describe '#corretto_sub_dir' do - before do - allow(subject).to receive(:[]).with('version', 'full_version').and_return(version) - allow(subject).to receive(:[]).with('kernel').and_return('machine' => machine) - end + describe '#corretto_sub_dir' do + before do + allow(subject).to receive(:[]).with('version', 'full_version').and_return(version) + allow(subject).to receive(:[]).with('kernel').and_return('machine' => machine) + end - context 'No full_version passed for Corretto 8 x64' do - let(:version) { '8' } - let(:machine) { 'x86_64' } + context 'No full_version passed for Corretto 8 x64' do + let(:version) { '8' } + let(:machine) { 'x86_64' } - it 'returns the default directory value for Corrretto 8 x64' do - expect(subject.corretto_sub_dir(version)).to include '8.302.08.1' + it 'returns the default directory value for Corrretto 8 x64' do + expect(subject.corretto_sub_dir(version)).to include '8.332.08.1' + end end - end - context 'No full_version passed for Corretto 8 aarch64' do - let(:version) { '8' } - let(:machine) { 'aarch64' } + context 'No full_version passed for Corretto 8 aarch64' do + let(:version) { '8' } + let(:machine) { 'aarch64' } - it 'returns the default directory value for Corrretto 8 aarch64' do - expect(subject.corretto_sub_dir(version)).to include '8.302.08.1' + it 'returns the default directory value for Corrretto 8 aarch64' do + expect(subject.corretto_sub_dir(version)).to include '8.332.08.1' + end end - end - context 'No full_version passed for Corretto 11 x64' do - let(:version) { '11' } - let(:machine) { 'x86_64' } + context 'No full_version passed for Corretto 11 x64' do + let(:version) { '11' } + let(:machine) { 'x86_64' } - it 'returns the default directory value for Corrretto 11 x64' do - expect(subject.corretto_sub_dir(version)).to include '11.0.12.7.1' + it 'returns the default directory value for Corrretto 11 x64' do + expect(subject.corretto_sub_dir(version)).to include '11.0.15.9.1' + end end - end - context 'No full_version passed for Corretto 11 aarch64' do - let(:version) { '11' } - let(:machine) { 'aarch64' } + context 'No full_version passed for Corretto 11 aarch64' do + let(:version) { '11' } + let(:machine) { 'aarch64' } - it 'returns the default directory value for Corrretto 11 aarch64' do - expect(subject.corretto_sub_dir(version)).to include '11.0.12.7.1' + it 'returns the default directory value for Corrretto 11 aarch64' do + expect(subject.corretto_sub_dir(version)).to include '11.0.15.9.1' + end end - end - context 'No full_version passed for Corretto 15 x64' do - let(:version) { '15' } - let(:machine) { 'x86_64' } + context 'No full_version passed for Corretto 17 x64' do + let(:version) { '17' } + let(:machine) { 'x86_64' } - it 'returns the default directory value for Corrretto 15 x64' do - expect(subject.corretto_sub_dir(version)).to include '15.0.2.7.1' + it 'returns the default directory value for Corrretto 17 x64' do + expect(subject.corretto_sub_dir(version)).to include '17.0.3.6.1' + end end - end - context 'No full_version passed for Corretto 15 aarch64' do - let(:version) { '15' } - let(:machine) { 'aarch64' } + context 'No full_version passed for Corretto 17 aarch64' do + let(:version) { '17' } + let(:machine) { 'aarch64' } - it 'returns the default directory value for Corrretto 15 aarch64' do - expect(subject.corretto_sub_dir(version)).to include '15.0.2.7.1' + it 'returns the default directory value for Corrretto 17 aarch64' do + expect(subject.corretto_sub_dir(version)).to include '17.0.3.6.1' + end end - end - context 'No full_version passed for Corretto 16 x64' do - let(:version) { '16' } - let(:machine) { 'x86_64' } + context 'No full_version passed for Corretto 18 x64' do + let(:version) { '18' } + let(:machine) { 'x86_64' } - it 'returns the default directory value for Corrretto 16 x64' do - expect(subject.corretto_sub_dir(version)).to include '16.0.2.7.1' + it 'returns the default directory value for Corrretto 18 x64' do + expect(subject.corretto_sub_dir(version)).to include '18.0.1.10.1' + end end - end - context 'No full_version passed for Corretto 16 aarch64' do - let(:version) { '16' } - let(:machine) { 'aarch64' } + context 'No full_version passed for Corretto 18 aarch64' do + let(:version) { '18' } + let(:machine) { 'aarch64' } - it 'returns the default directory value for Corrretto 16 aarch64' do - expect(subject.corretto_sub_dir(version)).to include '16.0.2.7.1' + it 'returns the default directory value for Corrretto 18 aarch64' do + expect(subject.corretto_sub_dir(version)).to include '18.0.1.10.1' + end end - end - context 'A full version passed for for Corretto 8 x64' do - let(:version) { '8' } - let(:full_version) { '8.123.45.6' } - let(:machine) { 'x86_64' } + context 'A full version passed for for Corretto 8 x64' do + let(:version) { '8' } + let(:full_version) { '8.123.45.6' } + let(:machine) { 'x86_64' } - it 'returns the default directory value for Corrretto 8 x64' do - expect(subject.corretto_sub_dir(version, full_version)).to include '8.123.45.6' + it 'returns the default directory value for Corrretto 8 x64' do + expect(subject.corretto_sub_dir(version, full_version)).to include '8.123.45.6' + end end - end - context 'A full version passed for for Corretto 8 aarch64' do - let(:version) { '8' } - let(:full_version) { '8.123.45.6' } - let(:machine) { 'aarch64' } + context 'A full version passed for for Corretto 8 aarch64' do + let(:version) { '8' } + let(:full_version) { '8.123.45.6' } + let(:machine) { 'aarch64' } - it 'returns the default directory value for Corrretto 8 aarch64' do - expect(subject.corretto_sub_dir(version, full_version)).to include '8.123.45.6' + it 'returns the default directory value for Corrretto 8 aarch64' do + expect(subject.corretto_sub_dir(version, full_version)).to include '8.123.45.6' + end end end end From 76aead96be5d96d320f3025d001288b0906d3f7e Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 26 Apr 2022 05:15:34 -0700 Subject: [PATCH 034/188] Update changelog for 11.1.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e94ae93..0aa770f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.1.0 - *2022-04-26* - Remove Correto 15 and 16 - Add Corretto 17 and 18 From ba52f53690ca6f24c9629cc279f9ae2b58a32f00 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 26 Apr 2022 05:15:35 -0700 Subject: [PATCH 035/188] Update metadata for 11.1.0 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 285f9c22..cf25b4db 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.0.2' +version '11.1.0' supports 'debian' supports 'ubuntu' From cb3cda7b1cdd59cdc2306d1e4c199c88ffec6ff5 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 26 Apr 2022 05:15:37 -0700 Subject: [PATCH 036/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0aa770f8..55d48c0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.1.0 - *2022-04-26* - Remove Correto 15 and 16 From 32a2ac2d727086a3d4557c903647fe45f92048ec Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 7 Dec 2022 21:06:16 -0800 Subject: [PATCH 037/188] Standardise files with files in sous-chefs/repo-management (#678) Signed-off-by: kitchen-porter Signed-off-by: kitchen-porter --- .github/workflows/md-links.yml | 2 +- CHANGELOG.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/md-links.yml b/.github/workflows/md-links.yml index ba887a16..13a60f3a 100644 --- a/.github/workflows/md-links.yml +++ b/.github/workflows/md-links.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: markdown-link-check uses: gaurav-nelson/github-action-markdown-link-check@v1 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 55d48c0d..2d90881f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +Standardise files with files in sous-chefs/repo-management + ## 11.1.0 - *2022-04-26* - Remove Correto 15 and 16 From 2d9033d677517ccefe3e4fe266783d2eac0ea424 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 7 Dec 2022 21:06:21 -0800 Subject: [PATCH 038/188] Update changelog for 11.1.1 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d90881f..93345c74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.1.1 - *2022-12-08* Standardise files with files in sous-chefs/repo-management From 11fba1eac556f5dae531353716626da325642284 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 7 Dec 2022 21:06:22 -0800 Subject: [PATCH 039/188] Update metadata for 11.1.1 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index cf25b4db..c8051858 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.1.0' +version '11.1.1' supports 'debian' supports 'ubuntu' From 248e5e3b887fffd1138d37ce16c787c2f8ce47f2 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 7 Dec 2022 21:06:24 -0800 Subject: [PATCH 040/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93345c74..7fd2fc53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.1.1 - *2022-12-08* Standardise files with files in sous-chefs/repo-management From f6bc1fbe5dec35da13b9b811434c2a4429bc85d7 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Tue, 14 Feb 2023 08:58:50 +0000 Subject: [PATCH 041/188] Remove CircleCI (#681) --- .circleci/config.yml | 10 ---------- .github/workflows/test-kitchen.yml | 18 +++++++++--------- 2 files changed, 9 insertions(+), 19 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 8af810ef..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -version: 2.1 -orbs: - kitchen: sous-chefs/kitchen@2 -workflows: - danger: - jobs: - - kitchen/danger: - name: danger - context: Danger-Minimal diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index 9997005c..db4db09a 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -1,7 +1,7 @@ --- -name: 'Test' +name: "Test" -'on': +"on": pull_request: push: branches: [main] @@ -17,7 +17,7 @@ jobs: issues: write integration: - needs: 'lint-unit' + needs: "lint-unit" runs-on: ubuntu-latest strategy: matrix: @@ -55,9 +55,9 @@ jobs: - name: Check out code uses: actions/checkout@v2 - name: Install Chef - uses: actionshub/chef-install@main + uses: actionshub/chef-install@2.0.4 - name: Dokken - uses: actionshub/test-kitchen@main + uses: actionshub/test-kitchen@2.1.0 env: CHEF_LICENSE: accept-no-persist KITCHEN_LOCAL_YAML: kitchen.dokken.yml @@ -66,15 +66,15 @@ jobs: os: ${{ matrix.os }} integration-macos: - needs: 'lint-unit' + needs: "lint-unit" runs-on: macos-latest steps: - name: Check out code uses: actions/checkout@v2 - name: Install Chef - uses: actionshub/chef-install@main + uses: actionshub/chef-install@2.0.4 - name: Kitchen Converge - uses: actionshub/test-kitchen@main + uses: actionshub/test-kitchen@2.1.0 env: CHEF_LICENSE: accept-no-persist KITCHEN_LOCAL_YAML: kitchen.macos.yml @@ -91,7 +91,7 @@ jobs: # Magic line for github actions to persist the change echo "JAVA_HOME=${JAVA_HOME}" >> $GITHUB_ENV - name: Kitchen Verify - uses: actionshub/test-kitchen@main + uses: actionshub/test-kitchen@2.1.0 env: CHEF_LICENSE: accept-no-persist KITCHEN_LOCAL_YAML: kitchen.macos.yml From b60976e4fbf5e6a3d773256f99339fd39896b9da Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 14 Feb 2023 00:58:53 -0800 Subject: [PATCH 042/188] Update changelog for 11.1.2 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fd2fc53..c6d5f0f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.1.2 - *2023-02-14* ## 11.1.1 - *2022-12-08* From b9942b8ce0d87acb51c49f64b9d6a53e4e1be1d5 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 14 Feb 2023 00:58:54 -0800 Subject: [PATCH 043/188] Update metadata for 11.1.2 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index c8051858..bf3be9fc 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.1.1' +version '11.1.2' supports 'debian' supports 'ubuntu' From b9678884a76d695ec8fcf8786730a162828228b2 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 14 Feb 2023 00:58:58 -0800 Subject: [PATCH 044/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6d5f0f2..4272cd8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.1.2 - *2023-02-14* ## 11.1.1 - *2022-12-08* From f30a946f169598f44e517cfb5b2d8fe5a8472874 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 14 Feb 2023 08:04:39 -0800 Subject: [PATCH 045/188] Standardise files with files in sous-chefs/repo-management (#682) Signed-off-by: kitchen-porter --- CHANGELOG.md | 2 ++ renovate.json | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 renovate.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 4272cd8b..81f9ae3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +Standardise files with files in sous-chefs/repo-management + ## 11.1.2 - *2023-02-14* ## 11.1.1 - *2022-12-08* diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..7e7a8bad --- /dev/null +++ b/renovate.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:base"], + "packageRules": [{ + "groupName": "Actions", + "matchUpdateTypes": ["patch", "pin", "digest"], + "automerge": true, + "addLabels": ["Release: Patch", "Skip: Announcements"] + }, + { + "groupName": "Actions", + "matchUpdateTypes": ["major"], + "automerge": false, + "addLabels": ["Release: Patch", "Skip: Announcements"] + } + ] +} From 4ae068f042b0ffc647f484fe173834f60f221d3e Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 14 Feb 2023 08:04:43 -0800 Subject: [PATCH 046/188] Update changelog for 11.1.3 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81f9ae3a..d7f0839c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.1.3 - *2023-02-14* Standardise files with files in sous-chefs/repo-management From cabd4652802a1a1913229d4184b739be7ec5b133 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 14 Feb 2023 08:04:44 -0800 Subject: [PATCH 047/188] Update metadata for 11.1.3 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index bf3be9fc..c5d668b5 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.1.2' +version '11.1.3' supports 'debian' supports 'ubuntu' From 4cca24b9b248bc94b37fdae7f0ca9bbf95ec51e9 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 14 Feb 2023 08:04:58 -0800 Subject: [PATCH 048/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7f0839c..3675d621 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.1.3 - *2023-02-14* Standardise files with files in sous-chefs/repo-management From 6d8e27844490a4d61fb630ace96c4f6de62546a0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Feb 2023 15:14:24 +0000 Subject: [PATCH 049/188] Update Actions (#683) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/stale.yml | 2 +- .github/workflows/test-kitchen.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 9e2ff38e..19d86dbe 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -8,7 +8,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v3 + - uses: actions/stale@v7 with: repo-token: ${{ secrets.GITHUB_TOKEN }} close-issue-message: > diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index db4db09a..3ddc2f27 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -53,7 +53,7 @@ jobs: fail-fast: false steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Chef uses: actionshub/chef-install@2.0.4 - name: Dokken @@ -70,7 +70,7 @@ jobs: runs-on: macos-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Chef uses: actionshub/chef-install@2.0.4 - name: Kitchen Converge From dfb8ccaad120dfb5ab276009a588808a9b2a0100 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 15 Feb 2023 15:14:31 +0000 Subject: [PATCH 050/188] Update changelog for 11.1.4 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3675d621..d72e0a14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.1.4 - *2023-02-15* ## 11.1.3 - *2023-02-14* From e46298033772334bb2b3196607f4e1f01c7f311f Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 15 Feb 2023 15:14:32 +0000 Subject: [PATCH 051/188] Update metadata for 11.1.4 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index c5d668b5..55fcbd80 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.1.3' +version '11.1.4' supports 'debian' supports 'ubuntu' From f7664cf3ca085853e9cdba7e5d3937decaf5f4e9 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 15 Feb 2023 15:14:34 +0000 Subject: [PATCH 052/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d72e0a14..f902cb1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.1.4 - *2023-02-15* ## 11.1.3 - *2023-02-14* From 5ea8e6b53163343d0562498fb0fdb9ca9de195aa Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 20 Feb 2023 14:47:05 +0000 Subject: [PATCH 053/188] Automated PR: Standardising Files (#685) * Standardise files with files in sous-chefs/repo-management Signed-off-by: kitchen-porter * Standardise files with files in sous-chefs/repo-management Signed-off-by: kitchen-porter --------- Signed-off-by: kitchen-porter --- .github/workflows/md-links.yml | 2 +- CHANGELOG.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/md-links.yml b/.github/workflows/md-links.yml index 13a60f3a..208cb1a2 100644 --- a/.github/workflows/md-links.yml +++ b/.github/workflows/md-links.yml @@ -13,7 +13,7 @@ jobs: - name: Check out code uses: actions/checkout@v3 - name: markdown-link-check - uses: gaurav-nelson/github-action-markdown-link-check@v1 + uses: gaurav-nelson/github-action-markdown-link-check@1.0.13 with: use-verbose-mode: "yes" folder-path: "documentation" diff --git a/CHANGELOG.md b/CHANGELOG.md index f902cb1a..57576a31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +Standardise files with files in sous-chefs/repo-management + +Standardise files with files in sous-chefs/repo-management + ## 11.1.4 - *2023-02-15* ## 11.1.3 - *2023-02-14* From e13311988d30e2c54f57223a3c3e4ff1438f9d3f Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 20 Feb 2023 14:47:09 +0000 Subject: [PATCH 054/188] Update changelog for 11.1.5 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57576a31..8483c628 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.1.5 - *2023-02-20* Standardise files with files in sous-chefs/repo-management From 0a6fadc317ae57fe7dc8c714d696af7e49a5a3f8 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 20 Feb 2023 14:47:10 +0000 Subject: [PATCH 055/188] Update metadata for 11.1.5 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 55fcbd80..60394c5e 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.1.4' +version '11.1.5' supports 'debian' supports 'ubuntu' From eebad3086fd83f98517ddde2a07d287b5e5f42b6 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 20 Feb 2023 14:47:12 +0000 Subject: [PATCH 056/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8483c628..a6215de3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.1.5 - *2023-02-20* Standardise files with files in sous-chefs/repo-management From 0ce8130cd4e6e0d90135f915c770eebe89ec985e Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Thu, 2 Mar 2023 16:20:07 +0000 Subject: [PATCH 057/188] [skip ci] Fix yaml & markdown (#688) --- .github/workflows/md-links.yml | 19 ------- .github/workflows/test-kitchen.yml | 2 +- .markdownlint-cli2.yaml | 4 ++ .vscode/extensions.json | 6 +-- CHANGELOG.md | 49 ++----------------- .../resources/adoptopenjdk_install.md | 4 +- .../resources/adoptopenjdk_linux_install.md | 3 +- .../resources/adoptopenjdk_macos_install.md | 3 +- documentation/resources/alternatives.md | 3 +- documentation/resources/certificate.md | 7 +-- documentation/resources/corretto_install.md | 3 +- documentation/resources/jce.md | 3 +- documentation/resources/openjdk_install.md | 3 +- .../resources/openjdk_pkg_install.md | 3 +- .../resources/openjdk_source_install.md | 3 +- 15 files changed, 34 insertions(+), 81 deletions(-) delete mode 100644 .github/workflows/md-links.yml create mode 100644 .markdownlint-cli2.yaml diff --git a/.github/workflows/md-links.yml b/.github/workflows/md-links.yml deleted file mode 100644 index 208cb1a2..00000000 --- a/.github/workflows/md-links.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: md-links - -"on": - pull_request: - push: - branches: [main] - -jobs: - md-links: - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v3 - - name: markdown-link-check - uses: gaurav-nelson/github-action-markdown-link-check@1.0.13 - with: - use-verbose-mode: "yes" - folder-path: "documentation" diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index 3ddc2f27..05f162c4 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -8,7 +8,7 @@ name: "Test" jobs: lint-unit: - uses: sous-chefs/.github/.github/workflows/lint-unit.yml@0.0.3 + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@2.0.1 permissions: actions: write checks: write diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml new file mode 100644 index 00000000..dffb96a8 --- /dev/null +++ b/.markdownlint-cli2.yaml @@ -0,0 +1,4 @@ +config: + ul-indent: false # MD007 + line-length: false # MD013 + no-duplicate-heading/no-duplicate-header: false # MD024 diff --git a/.vscode/extensions.json b/.vscode/extensions.json index cd777250..80fa82bd 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,7 +1,7 @@ { "recommendations": [ - "chef-software.chef", - "rebornix.ruby", - "editorconfig.editorconfig" + "chef-software.chef", + "rebornix.ruby", + "editorconfig.editorconfig" ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index a6215de3..a2eee0ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,14 +4,16 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased -## 11.1.5 - *2023-02-20* - Standardise files with files in sous-chefs/repo-management +## 11.1.5 - *2023-02-20* + Standardise files with files in sous-chefs/repo-management ## 11.1.4 - *2023-02-15* +Standardise files with files in sous-chefs/repo-management + ## 11.1.3 - *2023-02-14* Standardise files with files in sous-chefs/repo-management @@ -184,41 +186,24 @@ Standardise files with files in sous-chefs/repo-management ## 7.0.0 (2020-03-05) - Refactored and sped up unit tests. - -## Added - - Added `adoptopenjdk_install` resource & documentation - Added AdoptOpenJDK 13 testing - -## Deprecated - - Removed the adoptopenjdk recipe, please use the `adoptopenjdk_install` resource instead. - Increased the minimum Chef requirement to Chef 15 to use the archive resource. - Removed AdoptOpenJDK 10 testing ## 6.0.0 (2020-03-02) -## Deprecated - - The resource alias `java_ark` has been deprecated in favour of `java_oracle_install` ## 5.0.0 (2020-02-21) -### Added - -### Changed - - Fixed java_certificate regex where it checks if cert exists in cacert file. - Make Homebrew Cask name an attribute to allow for other options (ex: adoptopenjdk) - Switch homebrew tap to homebrew/cask-versions - Make builds parallel - Updates package name and link changes for adoptopenjdk - Migrated testing to github actions - -### Deprecated - -### Removed - - Removes openjdk-6 - Removes openjdk-7 for Ubuntu 16.04 - Removes openjdk-11 for Ubuntu @@ -589,19 +574,13 @@ Refactor the cookbook to better support wrapper cookbooks and other cookbook aut ## v1.17.4 -### Bug - - **[#111](https://github.com/socrata-cookbooks/java/pull/111)** - Fix alternatives for centos -### Improvement - - **[COOK-4165](https://tickets.opscode.com/browse/COOK-4165)** - Replace curl with remote_file with cookie header - **[#110](https://github.com/socrata-cookbooks/java/pull/110)** - Update openjdk to use the alternatives resource ## v1.17.2 -### Bug - - **[COOK-4136](https://tickets.opscode.com/browse/COOK-4136)** - Add md5 parameter to java_ark resource ## v1.17.0 @@ -617,28 +596,20 @@ Refactor the cookbook to better support wrapper cookbooks and other cookbook aut ## v1.16.4 -### Bug - - **[#103](https://github.com/socrata/java/pull/103)** - set alternatives when using ibm_tar recipe - **[#104](https://github.com/socrata/java/pull/104)** - Specify windows attributes in attribute files ## v1.16.2 -### Improvement - - **[COOK-3488](https://tickets.opscode.com/browse/COOK-3488)** - set alternatives for ibm jdk - **[COOK-3764](https://tickets.opscode.com/browse/COOK-3764)** - IBM Java installer needs 'rpm' package on Ubuntu -### Bug - - **[COOK-3857](https://tickets.opscode.com/browse/COOK-3857)** - do not unescape the java windows url before parsing it - **[#95](https://github.com/socrata/java/pull/95)** - fixes update-alternatives for openjdk installs - **[#100](https://github.com/socrata/java/pull/100)** - Use escaped quotes for Windows INSTALLDIR ## v1.16.0 -### Improvement - - **[COOK-3823](https://tickets.opscode.com/browse/COOK-3823)** - Upgrade to JDK 7u45-b18 ## v1.15.4 @@ -651,8 +622,6 @@ Refactor the cookbook to better support wrapper cookbooks and other cookbook aut ## v1.15.0 -### Bug - - Fixing version number. Accidently released at 0.15.x instead of 1.15.x ## v0.15.2 @@ -663,8 +632,6 @@ Refactor the cookbook to better support wrapper cookbooks and other cookbook aut ## v1.14.0 -### Bug - - **[COOK-3704](https://tickets.opscode.com/browse/COOK-3704)** - Fix alternatives when the package is already installed - **[COOK-3668](https://tickets.opscode.com/browse/COOK-3668)** - Fix a condition that would result in an error executing action `run` on resource 'bash[update-java-alternatives]' - **[COOK-3569](https://tickets.opscode.com/browse/COOK-3569)** - Fix bad checksum length @@ -672,19 +639,13 @@ Refactor the cookbook to better support wrapper cookbooks and other cookbook aut - **[COOK-3518](https://tickets.opscode.com/browse/COOK-3518)** - Allow Windoes recipe to download from signed S3 url - **[COOK-2996](https://tickets.opscode.com/browse/COOK-2996)** - Fix a failure on Centos 6.4 and Oracle JDK 7 -### Improvement - - **[COOK-2793](https://tickets.opscode.com/browse/COOK-2793)** - Improve Windows support ## v1.13.0 -### Bug - - **[COOK-3295](https://tickets.opscode.com/browse/COOK-3295)** - Add default `platform_family` option in Java helper - **[COOK-3277](https://tickets.opscode.com/browse/COOK-3277)** - Fix support for Fedora -### Improvement - - **[COOK-3278](https://tickets.opscode.com/browse/COOK-3278)** - Upgrade to Oracle Java 7u25 - **[COOK-3029](https://tickets.opscode.com/browse/COOK-3029)** - Add Oracle RPM support - **[COOK-2931](https://tickets.opscode.com/browse/COOK-2931)** - Add support for the platform `xenserver` @@ -692,8 +653,6 @@ Refactor the cookbook to better support wrapper cookbooks and other cookbook aut ## v1.12.0 -### Improvement - - [COOK-2154]: Add SmartOS support to java::openjdk recipe - [COOK-3278]: upgrade to Oracle Java 7u25 - [COOK-2931]: Adding support for the platform 'xenserver' (for installations of java in DOM0) diff --git a/documentation/resources/adoptopenjdk_install.md b/documentation/resources/adoptopenjdk_install.md index d4fbea4f..6edee611 100644 --- a/documentation/resources/adoptopenjdk_install.md +++ b/documentation/resources/adoptopenjdk_install.md @@ -1,7 +1,7 @@ -[back to resource list](https://github.com/sous-chefs/java#resources) - # adoptopenjdk_install +[back to resource list](https://github.com/sous-chefs/java#resources) + Introduced: v7.0.0 ## Actions diff --git a/documentation/resources/adoptopenjdk_linux_install.md b/documentation/resources/adoptopenjdk_linux_install.md index 022ec848..3e20ccbf 100644 --- a/documentation/resources/adoptopenjdk_linux_install.md +++ b/documentation/resources/adoptopenjdk_linux_install.md @@ -1,7 +1,8 @@ -[back to resource list](https://github.com/sous-chefs/java#resources) # adoptopenjdk_linux_install +[back to resource list](https://github.com/sous-chefs/java#resources) + Introduced: v8.1.0 ## Actions diff --git a/documentation/resources/adoptopenjdk_macos_install.md b/documentation/resources/adoptopenjdk_macos_install.md index f5f47dfa..9336a334 100644 --- a/documentation/resources/adoptopenjdk_macos_install.md +++ b/documentation/resources/adoptopenjdk_macos_install.md @@ -1,7 +1,8 @@ -[back to resource list](https://github.com/sous-chefs/java#resources) # adoptopenjdk_macos_install +[back to resource list](https://github.com/sous-chefs/java#resources) + Introduced: v8.1.0 ## Actions diff --git a/documentation/resources/alternatives.md b/documentation/resources/alternatives.md index fabc67e7..902e4f6b 100644 --- a/documentation/resources/alternatives.md +++ b/documentation/resources/alternatives.md @@ -1,7 +1,8 @@ -[back to resource list](https://github.com/sous-chefs/java#resources) # java_alternatives +[back to resource list](https://github.com/sous-chefs/java#resources) + The `java_alternatives` resource uses `update-alternatives` command to set and unset command alternatives for various Java tools such as java, javac, etc. ## Actions diff --git a/documentation/resources/certificate.md b/documentation/resources/certificate.md index e6922b17..019f1a77 100644 --- a/documentation/resources/certificate.md +++ b/documentation/resources/certificate.md @@ -1,7 +1,8 @@ -[back to resource list](https://github.com/sous-chefs/java#resources) # java_certificate +[back to resource list](https://github.com/sous-chefs/java#resources) + Java certificate simplifies adding certificates to a java keystore. It can also populate the keystore with a certificate retrieved from a given SSL end-point. @@ -14,8 +15,8 @@ It can also populate the keystore with a certificate retrieved from a given SSL | Name | Type | Default | Description | | ----------------- | ------ | --------------------------- | --------------------------------------------------------------------------------------- | -| `java_home` | | node['java']['java_home'] | The java home directory | -| `java_version` | | node['java']['jdk_version'] | The java version | +| `java_home` | | `node['java']['java_home']` | The java home directory | +| `java_version` | | `node['java']['jdk_version']` | The java version | | `keystore_path` | String | | Path to the keystore | | `keystore_passwd` | String | `changeit` | Password to the keystore | | `cert_alias` | String | | The alias of the certificate in the keystore. This defaults to the name of the resource | diff --git a/documentation/resources/corretto_install.md b/documentation/resources/corretto_install.md index 05e62498..2bf76155 100644 --- a/documentation/resources/corretto_install.md +++ b/documentation/resources/corretto_install.md @@ -1,7 +1,8 @@ -[back to resource list](https://github.com/sous-chefs/java#resources) # corretto_install +[back to resource list](https://github.com/sous-chefs/java#resources) + Introduced: v8.0.0 ## Actions diff --git a/documentation/resources/jce.md b/documentation/resources/jce.md index 2c73db8a..d0714855 100644 --- a/documentation/resources/jce.md +++ b/documentation/resources/jce.md @@ -1,7 +1,8 @@ -[back to resource list](https://github.com/sous-chefs/java#resources) # java_jce +[back to resource list](https://github.com/sous-chefs/java#resources) + `java_jce` installs the Java Cryptography Extension (JCE) policy files for a given Java installation. ## Actions diff --git a/documentation/resources/openjdk_install.md b/documentation/resources/openjdk_install.md index 4a5f563c..1ca8903f 100644 --- a/documentation/resources/openjdk_install.md +++ b/documentation/resources/openjdk_install.md @@ -1,7 +1,8 @@ -[back to resource list](https://github.com/sous-chefs/java#resources) # openjdk_install +[back to resource list](https://github.com/sous-chefs/java#resources) + Introduced: v8.0.0 ## Actions diff --git a/documentation/resources/openjdk_pkg_install.md b/documentation/resources/openjdk_pkg_install.md index f7374d90..49045cec 100644 --- a/documentation/resources/openjdk_pkg_install.md +++ b/documentation/resources/openjdk_pkg_install.md @@ -1,7 +1,8 @@ -[back to resource list](https://github.com/sous-chefs/java#resources) # openjdk_pkg_install +[back to resource list](https://github.com/sous-chefs/java#resources) + Introduced: v8.1.0 ## Actions diff --git a/documentation/resources/openjdk_source_install.md b/documentation/resources/openjdk_source_install.md index c6356ae6..b2ad8b5a 100644 --- a/documentation/resources/openjdk_source_install.md +++ b/documentation/resources/openjdk_source_install.md @@ -1,7 +1,8 @@ -[back to resource list](https://github.com/sous-chefs/java#resources) # openjdk_install +[back to resource list](https://github.com/sous-chefs/java#resources) + Introduced: v8.0.0 ## Actions From 2453f69350e66c093defcbe069621bd786643b4c Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Thu, 2 Mar 2023 16:20:11 +0000 Subject: [PATCH 058/188] Update changelog for 11.1.6 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2eee0ba..2d839ebf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.1.6 - *2023-03-02* Standardise files with files in sous-chefs/repo-management From 2964ddb837f737083a36faea7231aac788869229 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Thu, 2 Mar 2023 16:20:11 +0000 Subject: [PATCH 059/188] Update metadata for 11.1.6 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 60394c5e..e0a8f2ba 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.1.5' +version '11.1.6' supports 'debian' supports 'ubuntu' From deb05989ee2549e15c5955c94cd28b95321d4189 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Thu, 2 Mar 2023 16:20:14 +0000 Subject: [PATCH 060/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d839ebf..b836e070 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.1.6 - *2023-03-02* Standardise files with files in sous-chefs/repo-management From 523403a5b54e7d0c484ab8cf1e33313999b0fa48 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Sat, 1 Apr 2023 08:18:05 +0100 Subject: [PATCH 061/188] Automated PR: Standardising Files [skip ci] This PR will standardise the files we have with out agreed spec in sous-chefs/repo-management. This repo has been identified by topic(s) of chef-cookbook --- .github/workflows/md-links.yml | 19 +++++++++++++++++++ .markdownlint-cli2.yaml | 3 ++- .vscode/extensions.json | 3 ++- .yamllint | 2 ++ CHANGELOG.md | 4 ++++ 5 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/md-links.yml diff --git a/.github/workflows/md-links.yml b/.github/workflows/md-links.yml new file mode 100644 index 00000000..208cb1a2 --- /dev/null +++ b/.github/workflows/md-links.yml @@ -0,0 +1,19 @@ +--- +name: md-links + +"on": + pull_request: + push: + branches: [main] + +jobs: + md-links: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + - name: markdown-link-check + uses: gaurav-nelson/github-action-markdown-link-check@1.0.13 + with: + use-verbose-mode: "yes" + folder-path: "documentation" diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml index dffb96a8..6fa8e776 100644 --- a/.markdownlint-cli2.yaml +++ b/.markdownlint-cli2.yaml @@ -1,4 +1,5 @@ config: ul-indent: false # MD007 line-length: false # MD013 - no-duplicate-heading/no-duplicate-header: false # MD024 + no-duplicate-heading: false # MD024 + reference-links-images: false # MD052 diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 80fa82bd..51d0ae7a 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,6 +2,7 @@ "recommendations": [ "chef-software.chef", "rebornix.ruby", - "editorconfig.editorconfig" + "editorconfig.editorconfig", + "DavidAnson.vscode-markdownlint" ] } diff --git a/.yamllint b/.yamllint index 1b5cea09..0046b237 100644 --- a/.yamllint +++ b/.yamllint @@ -11,3 +11,5 @@ rules: max-spaces-inside: 1 min-spaces-inside-empty: -1 max-spaces-inside-empty: -1 + comments: + min-spaces-from-content: 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index b836e070..250e9b6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +Standardise files with files in sous-chefs/repo-management + +Standardise files with files in sous-chefs/repo-management + ## 11.1.6 - *2023-03-02* Standardise files with files in sous-chefs/repo-management From 7f16c2d2f57ab1b696c4e319e1cbad32f78f5d0a Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Sat, 1 Apr 2023 08:18:09 +0100 Subject: [PATCH 062/188] Update changelog for 11.1.7 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 250e9b6b..841892ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.1.7 - *2023-04-01* Standardise files with files in sous-chefs/repo-management From 37cb9d8501e50d2631d0ca0e1361fcdc5a8308c6 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Sat, 1 Apr 2023 08:18:09 +0100 Subject: [PATCH 063/188] Update metadata for 11.1.7 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index e0a8f2ba..552e696a 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.1.6' +version '11.1.7' supports 'debian' supports 'ubuntu' From fdbd2ce24cc75948185d525118b973060da7c9b7 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Sat, 1 Apr 2023 08:18:11 +0100 Subject: [PATCH 064/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 841892ce..2a5e610b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.1.7 - *2023-04-01* Standardise files with files in sous-chefs/repo-management From a23ee111c6fad976b73b108b64d87200b2aecf0b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 1 Apr 2023 20:44:04 +0800 Subject: [PATCH 065/188] Update actions/stale action to v8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [skip ci] [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/stale](https://togithub.com/actions/stale) | action | major | `v7` -> `v8` | --- ### Release Notes
actions/stale ### [`v8`](https://togithub.com/actions/stale/compare/v7...v8) [Compare Source](https://togithub.com/actions/stale/compare/v7...v8)
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/sous-chefs/java). --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 19d86dbe..4bb59c62 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -8,7 +8,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v7 + - uses: actions/stale@v8 with: repo-token: ${{ secrets.GITHUB_TOKEN }} close-issue-message: > From cf2abfc36ab84e9b638a47dac52dc341144c49aa Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Sat, 1 Apr 2023 13:44:07 +0100 Subject: [PATCH 066/188] Update changelog for 11.1.8 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a5e610b..30be6868 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.1.8 - *2023-04-01* ## 11.1.7 - *2023-04-01* From f7ee895cdf415f7d55f0813980e0cab160976c7b Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Sat, 1 Apr 2023 13:44:08 +0100 Subject: [PATCH 067/188] Update metadata for 11.1.8 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 552e696a..2f09e5aa 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.1.7' +version '11.1.8' supports 'debian' supports 'ubuntu' From c84019d97315c3387f74007871dceb3511a2e97b Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Sat, 1 Apr 2023 13:44:10 +0100 Subject: [PATCH 068/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30be6868..da3e09d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.1.8 - *2023-04-01* ## 11.1.7 - *2023-04-01* From b114906b25a78a00c4de28cf1edc0ae6036cbb22 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 1 Apr 2023 20:51:31 +0800 Subject: [PATCH 069/188] Update gaurav-nelson/github-action-markdown-link-check action to v1.0.15 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [skip ci] [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [gaurav-nelson/github-action-markdown-link-check](https://togithub.com/gaurav-nelson/github-action-markdown-link-check) | action | patch | `1.0.13` -> `1.0.15` | --- ### Release Notes
gaurav-nelson/github-action-markdown-link-check ### [`v1.0.15`](https://togithub.com/gaurav-nelson/github-action-markdown-link-check/releases/tag/1.0.15) [Compare Source](https://togithub.com/gaurav-nelson/github-action-markdown-link-check/compare/1.0.14...1.0.15) ##### Changes - [https://github.com/gaurav-nelson/github-action-markdown-link-check/pull/168](https://togithub.com/gaurav-nelson/github-action-markdown-link-check/pull/168) - Respect folder-path when check-modified-files-only == yes: Thank you [@​exoego](https://togithub.com/exoego) Thank you [@​mgrojo](https://togithub.com/mgrojo) [@​qaristote](https://togithub.com/qaristote) [@​RezaRahemtola](https://togithub.com/RezaRahemtola) for minor typo fixes. ### [`v1.0.14`](https://togithub.com/gaurav-nelson/github-action-markdown-link-check/releases/tag/1.0.14) [Compare Source](https://togithub.com/gaurav-nelson/github-action-markdown-link-check/compare/1.0.13...1.0.14) ### Important ‼️ This version is in beta. Use `1.0.13` or `v1` which are the stable versions. *** ##### Changes - [https://github.com/gaurav-nelson/github-action-markdown-link-check/pull/116](https://togithub.com/gaurav-nelson/github-action-markdown-link-check/pull/116) - Changed the base image to more stage Node image `node:lts-alpine` - [https://github.com/gaurav-nelson/github-action-markdown-link-check/pull/126](https://togithub.com/gaurav-nelson/github-action-markdown-link-check/pull/126) - Use markdown-link-check version 3.9.3 - [https://github.com/gaurav-nelson/github-action-markdown-link-check/pull/148](https://togithub.com/gaurav-nelson/github-action-markdown-link-check/pull/148) - Fully disable the Git ownership check - [https://github.com/gaurav-nelson/github-action-markdown-link-check/pull/144](https://togithub.com/gaurav-nelson/github-action-markdown-link-check/pull/144) - Update markdown-lint-check to v3.10.2 Thank you [@​thanethomson](https://togithub.com/thanethomson) [@​edumco](https://togithub.com/edumco) [@​Pandapip1](https://togithub.com/Pandapip1) [@​creachadair](https://togithub.com/creachadair) [@​bogdandrutu](https://togithub.com/bogdandrutu)
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/sous-chefs/java). --- .github/workflows/md-links.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/md-links.yml b/.github/workflows/md-links.yml index 208cb1a2..e5c1e7a2 100644 --- a/.github/workflows/md-links.yml +++ b/.github/workflows/md-links.yml @@ -13,7 +13,7 @@ jobs: - name: Check out code uses: actions/checkout@v3 - name: markdown-link-check - uses: gaurav-nelson/github-action-markdown-link-check@1.0.13 + uses: gaurav-nelson/github-action-markdown-link-check@1.0.15 with: use-verbose-mode: "yes" folder-path: "documentation" From e0333f36255c735aa03d797915d247c43936652f Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Sat, 1 Apr 2023 13:51:35 +0100 Subject: [PATCH 070/188] Update changelog for 11.1.9 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da3e09d7..914bb22d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.1.9 - *2023-04-01* ## 11.1.8 - *2023-04-01* From 31e68d1a5072d89a00201e3e1ef9fc7ef432d6b3 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Sat, 1 Apr 2023 13:51:35 +0100 Subject: [PATCH 071/188] Update metadata for 11.1.9 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 2f09e5aa..dac5e913 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.1.8' +version '11.1.9' supports 'debian' supports 'ubuntu' From 629d1473f433df1b801aa429070afaa414d13d83 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Sat, 1 Apr 2023 13:51:38 +0100 Subject: [PATCH 072/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 914bb22d..223e3171 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.1.9 - *2023-04-01* ## 11.1.8 - *2023-04-01* From dc5159f2a3cf7ccbe185e7bdf917844e9721b65a Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Fri, 7 Apr 2023 06:00:32 +0100 Subject: [PATCH 073/188] Automated PR: Standardising Files [skip ci] This PR will standardise the files we have with out agreed spec in sous-chefs/repo-management. This repo has been identified by topic(s) of chef-cookbook --- .overcommit.yml | 14 +++++-- CHANGELOG.md | 2 + kitchen.dokken.yml | 97 ++++++++++++++++++++++++++++++++-------------- kitchen.exec.yml | 7 ++++ kitchen.global.yml | 38 ++++++++++++++++++ 5 files changed, 126 insertions(+), 32 deletions(-) create mode 100644 kitchen.exec.yml create mode 100644 kitchen.global.yml diff --git a/.overcommit.yml b/.overcommit.yml index cd8682a0..0e89a3c1 100644 --- a/.overcommit.yml +++ b/.overcommit.yml @@ -4,13 +4,21 @@ PreCommit: enabled: true YamlLint: enabled: true - Rspec: + required_executable: "yamllint" + ChefSpec: enabled: true - required_executable: 'rspec' + required_executable: "chef" + command: ["chef", "exec", "rspec"] Cookstyle: enabled: true - required_executable: 'cookstyle' + required_executable: "cookstyle" command: ["cookstyle"] + MarkdownLint: + enabled: false + required_executable: "npx" + command: ["npx", "markdownlint-cli2", "'**/*.md'"] + include: ["**/*.md"] + CommitMsg: HardTabs: enabled: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 223e3171..a0fe7c70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +Standardise files with files in sous-chefs/repo-management + ## 11.1.9 - *2023-04-01* ## 11.1.8 - *2023-04-01* diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index 65665279..47eff95d 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -1,74 +1,113 @@ ---- driver: name: dokken - privileged: true # because Docker and SystemD/Upstart + privileged: true + chef_version: <%= ENV['CHEF_VERSION'] || 'current' %> -transport: - name: dokken +transport: { name: dokken } +provisioner: { name: dokken } -provisioner: - name: dokken +platforms: + - name: almalinux-8 + driver: + image: dokken/almalinux-8 + pid_one_command: /usr/lib/systemd/systemd + + - name: almalinux-9 + driver: + image: dokken/almalinux-9 + pid_one_command: /usr/lib/systemd/systemd -verifier: - name: inspec + - name: amazonlinux-2023 + driver: + image: dokken/amazonlinux-2023 + pid_one_command: /usr/lib/systemd/systemd -platforms: - - name: amazonlinux-2 + - name: centos-7 driver: - image: dokken/amazonlinux-2 + image: dokken/centos-7 + pid_one_command: /usr/lib/systemd/systemd + + - name: centos-stream-8 + driver: + image: dokken/centos-stream-8 + pid_one_command: /usr/lib/systemd/systemd + + - name: centos-stream-9 + driver: + image: dokken/centos-stream-9 pid_one_command: /usr/lib/systemd/systemd - name: debian-9 driver: image: dokken/debian-9 pid_one_command: /bin/systemd - # intermediate_instructions: - # - RUN /usr/bin/apt-get update - name: debian-10 driver: image: dokken/debian-10 pid_one_command: /bin/systemd - # intermediate_instructions: - # - RUN /usr/bin/apt-get update - name: debian-11 driver: image: dokken/debian-11 pid_one_command: /bin/systemd - # intermediate_instructions: - # - RUN /usr/bin/apt-get update - - name: centos-7 + - name: debian-12 driver: - image: dokken/centos-7 + image: dokken/debian-12 + pid_one_command: /bin/systemd + + - name: fedora-latest + driver: + image: dokken/fedora-latest pid_one_command: /usr/lib/systemd/systemd - - name: centos-8 + - name: opensuse-leap-15 driver: - image: dokken/centos-8 + image: dokken/opensuse-leap-15 pid_one_command: /usr/lib/systemd/systemd - - name: fedora-latest + - name: oraclelinux-7 driver: - image: dokken/fedora-latest + image: dokken/oraclelinux-7 + pid_one_command: /usr/lib/systemd/systemd + + - name: oraclelinux-8 + driver: + image: dokken/oraclelinux-8 + pid_one_command: /usr/lib/systemd/systemd + + - name: oraclelinux-9 + driver: + image: dokken/oraclelinux-9 + pid_one_command: /usr/lib/systemd/systemd + + - name: rockylinux-8 + driver: + image: dokken/rockylinux-8 + pid_one_command: /usr/lib/systemd/systemd + + - name: rockylinux-9 + driver: + image: dokken/rockylinux-9 pid_one_command: /usr/lib/systemd/systemd - name: ubuntu-18.04 driver: image: dokken/ubuntu-18.04 pid_one_command: /bin/systemd - intermediate_instructions: - - RUN /usr/bin/apt-get update - name: ubuntu-20.04 driver: image: dokken/ubuntu-20.04 pid_one_command: /bin/systemd - intermediate_instructions: - - RUN /usr/bin/apt-get update - - name: opensuse-leap-15 + - name: ubuntu-22.04 driver: - image: dokken/opensuse-leap-15 + image: dokken/ubuntu-22.04 + pid_one_command: /bin/systemd + + - name: ubuntu-23.04 + driver: + image: dokken/ubuntu-23.04 pid_one_command: /bin/systemd diff --git a/kitchen.exec.yml b/kitchen.exec.yml new file mode 100644 index 00000000..ba7b2a96 --- /dev/null +++ b/kitchen.exec.yml @@ -0,0 +1,7 @@ +--- +driver: { name: exec } +transport: { name: exec } + +platforms: + - name: macos-latest + - name: windows-latest diff --git a/kitchen.global.yml b/kitchen.global.yml new file mode 100644 index 00000000..a382fcd0 --- /dev/null +++ b/kitchen.global.yml @@ -0,0 +1,38 @@ +--- +provisioner: + name: chef_infra + product_name: chef + product_version: <%= ENV['CHEF_VERSION'] || 'latest' %> + channel: stable + install_strategy: once + chef_license: accept + enforce_idempotency: <%= ENV['ENFORCE_IDEMPOTENCY'] || true %> + multiple_converge: <%= ENV['MULTIPLE_CONVERGE'] || 2 %> + deprecations_as_errors: true + log_level: <%= ENV['CHEF_LOG_LEVEL'] || 'auto' %> + +verifier: + name: inspec + +platforms: + - name: almalinux-8 + - name: almalinux-9 + - name: amazonlinux-2023 + - name: centos-7 + - name: centos-stream-8 + - name: centos-stream-9 + - name: debian-9 + - name: debian-10 + - name: debian-11 + - name: debian-12 + - name: fedora-latest + - name: opensuse-leap-15 + - name: oraclelinux-7 + - name: oraclelinux-8 + - name: oraclelinux-9 + - name: rockylinux-8 + - name: rockylinux-9 + - name: ubuntu-18.04 + - name: ubuntu-20.04 + - name: ubuntu-22.04 + - name: ubuntu-23.04 From 0fbd0cbac6012754bb9681e75c66e66b653502ee Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Fri, 7 Apr 2023 06:00:36 +0100 Subject: [PATCH 074/188] Update changelog for 11.1.10 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0fe7c70..f307f15e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.1.10 - *2023-04-07* Standardise files with files in sous-chefs/repo-management From 8d2f446c70e60ba799104c6e2283b5d3324de89b Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Fri, 7 Apr 2023 06:00:37 +0100 Subject: [PATCH 075/188] Update metadata for 11.1.10 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index dac5e913..66a0b670 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.1.9' +version '11.1.10' supports 'debian' supports 'ubuntu' From 80cc8ffab07ce394578b86270da1e02ad9d0d7cb Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Fri, 7 Apr 2023 06:00:39 +0100 Subject: [PATCH 076/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f307f15e..820d999e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.1.10 - *2023-04-07* Standardise files with files in sous-chefs/repo-management From d87a4322fa48c580ba1a18de53d6aa8ba1ec1087 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 17 Apr 2023 12:45:14 +0100 Subject: [PATCH 077/188] Update sous-chefs/.github action to v2.0.2 (#694) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/test-kitchen.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index 05f162c4..46cf6d7b 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -8,7 +8,7 @@ name: "Test" jobs: lint-unit: - uses: sous-chefs/.github/.github/workflows/lint-unit.yml@2.0.1 + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@2.0.2 permissions: actions: write checks: write From 39121b246e8c723a38511c1b13504d4503e2a6ce Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 17 Apr 2023 12:45:17 +0100 Subject: [PATCH 078/188] Update changelog for 11.1.11 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 820d999e..e8e4a615 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.1.11 - *2023-04-17* ## 11.1.10 - *2023-04-07* From ef390c76882a9e6767f55598de2580440f650995 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 17 Apr 2023 12:45:18 +0100 Subject: [PATCH 079/188] Update metadata for 11.1.11 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 66a0b670..4ce3d758 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.1.10' +version '11.1.11' supports 'debian' supports 'ubuntu' From 186a5e91619aa04ac2544213c49d60aab280afe4 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 17 Apr 2023 12:45:20 +0100 Subject: [PATCH 080/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8e4a615..33e4fe3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.1.11 - *2023-04-17* ## 11.1.10 - *2023-04-07* From bdccb3c8a24c4e451edad37ac4e11001e1328cbc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 14:48:47 +0100 Subject: [PATCH 081/188] Update sous-chefs/.github action to v2.0.4 (#695) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/test-kitchen.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index 46cf6d7b..b3eee4e4 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -8,7 +8,7 @@ name: "Test" jobs: lint-unit: - uses: sous-chefs/.github/.github/workflows/lint-unit.yml@2.0.2 + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@2.0.4 permissions: actions: write checks: write From 91b8c231280fc60d89887e26749ea1a36eb1f0b4 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 16 May 2023 14:48:51 +0100 Subject: [PATCH 082/188] Update changelog for 11.1.12 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33e4fe3e..ee86bc0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.1.12 - *2023-05-16* ## 11.1.11 - *2023-04-17* From c635155787517b18fa60f3989485a81578a26fa7 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 16 May 2023 14:48:52 +0100 Subject: [PATCH 083/188] Update metadata for 11.1.12 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 4ce3d758..105ed026 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.1.11' +version '11.1.12' supports 'debian' supports 'ubuntu' From 656c836c5bdbf0919539aaeb62fc87a6bbe71ea7 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 16 May 2023 14:48:55 +0100 Subject: [PATCH 084/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee86bc0d..43b301b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.1.12 - *2023-05-16* ## 11.1.11 - *2023-04-17* From c571f1e52b15cfaaab83611baedd22d68b0f8360 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 10:27:33 +0100 Subject: [PATCH 085/188] Update sous-chefs/.github action to v2.0.5 (#696) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/test-kitchen.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index b3eee4e4..6ea97ce2 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -8,7 +8,7 @@ name: "Test" jobs: lint-unit: - uses: sous-chefs/.github/.github/workflows/lint-unit.yml@2.0.4 + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@2.0.5 permissions: actions: write checks: write From 8e34ae0df87f0664f77a1f387ad1033bf7f097f0 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 10 Jul 2023 10:27:37 +0100 Subject: [PATCH 086/188] Update changelog for 11.1.13 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43b301b4..87fedebb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.1.13 - *2023-07-10* ## 11.1.12 - *2023-05-16* From b7a2e6d2da2d6a4ddbe73bd4b9c354ab6ec354e2 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 10 Jul 2023 10:27:38 +0100 Subject: [PATCH 087/188] Update metadata for 11.1.13 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 105ed026..cffdf5b3 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.1.12' +version '11.1.13' supports 'debian' supports 'ubuntu' From 84498f40f32ae03b6b97480388f54902ccee9075 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 10 Jul 2023 10:27:40 +0100 Subject: [PATCH 088/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87fedebb..84b9f8d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.1.13 - *2023-07-10* ## 11.1.12 - *2023-05-16* From 3e36b1fb818b418a7e1f0d291703736e9f916689 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 15:53:47 +0100 Subject: [PATCH 089/188] Update actions/checkout action to v4 (#697) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/md-links.yml | 2 +- .github/workflows/test-kitchen.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/md-links.yml b/.github/workflows/md-links.yml index e5c1e7a2..b4f2de13 100644 --- a/.github/workflows/md-links.yml +++ b/.github/workflows/md-links.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 - name: markdown-link-check uses: gaurav-nelson/github-action-markdown-link-check@1.0.15 with: diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index 6ea97ce2..0f28c542 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -53,7 +53,7 @@ jobs: fail-fast: false steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 - name: Install Chef uses: actionshub/chef-install@2.0.4 - name: Dokken @@ -70,7 +70,7 @@ jobs: runs-on: macos-latest steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 - name: Install Chef uses: actionshub/chef-install@2.0.4 - name: Kitchen Converge From b405e06dff5c38bc7bf9c4137bb4cb0f2a0d4edc Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 4 Sep 2023 15:53:50 +0100 Subject: [PATCH 090/188] Update changelog for 11.1.14 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84b9f8d9..18b8537d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.1.14 - *2023-09-04* ## 11.1.13 - *2023-07-10* From 6f49c0467a8be027478f597d163b304b4e3b8b68 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 4 Sep 2023 15:53:51 +0100 Subject: [PATCH 091/188] Update metadata for 11.1.14 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index cffdf5b3..818a42f4 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.1.13' +version '11.1.14' supports 'debian' supports 'ubuntu' From fccf996bc40d305481cdb8bfa6dd15549419edb4 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 4 Sep 2023 15:53:54 +0100 Subject: [PATCH 092/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18b8537d..763caab7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.1.14 - *2023-09-04* ## 11.1.13 - *2023-07-10* From 644ffc0cfa5bb0f2c791e6988fe5f4d1fac71004 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Tue, 12 Sep 2023 14:44:51 +0100 Subject: [PATCH 093/188] Remove EOL Debian 9 (#699) --- .github/workflows/test-kitchen.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index 0f28c542..c38cabb9 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -22,14 +22,16 @@ jobs: strategy: matrix: os: + - almalinux-8 - amazonlinux-2 - - debian-9 - debian-10 - debian-11 - centos-7 - - centos-8 + - centos-stream-8 - ubuntu-1804 - ubuntu-2004 + - ubuntu-2204 + - rockylinux-8 suite: - openjdk-11 - openjdk-16 From 5f14c9baef02664166296b5a5343e158bd28f0b4 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 12 Sep 2023 14:44:55 +0100 Subject: [PATCH 094/188] Update changelog for 11.2.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 763caab7..f466e4d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.2.0 - *2023-09-12* ## 11.1.14 - *2023-09-04* From e4b547592236862b14520564ca747bb550c88b8c Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 12 Sep 2023 14:44:55 +0100 Subject: [PATCH 095/188] Update metadata for 11.2.0 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 818a42f4..5725f95e 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.1.14' +version '11.2.0' supports 'debian' supports 'ubuntu' From b2c04f6fc9968e4e2e79c53af1a355f5a332be8f Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 12 Sep 2023 14:44:58 +0100 Subject: [PATCH 096/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f466e4d4..d783620c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.2.0 - *2023-09-12* ## 11.1.14 - *2023-09-04* From 422fa55c2247fe5b133baec2508b58b244e8abab Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:03:55 +0100 Subject: [PATCH 097/188] Update sous-chefs/.github action to v2.0.6 (#698) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/test-kitchen.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index c38cabb9..8fb0a6d0 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -8,7 +8,7 @@ name: "Test" jobs: lint-unit: - uses: sous-chefs/.github/.github/workflows/lint-unit.yml@2.0.5 + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@2.0.6 permissions: actions: write checks: write From dd489a078464311420084456336e92cb184b27ed Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:03:58 +0100 Subject: [PATCH 098/188] Update changelog for 11.2.1 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d783620c..3962600a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.2.1 - *2023-09-12* ## 11.2.0 - *2023-09-12* From 5437e02ed807e24b80851ce486deb1d5ccb5c000 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:03:59 +0100 Subject: [PATCH 099/188] Update metadata for 11.2.1 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 5725f95e..55ac99a3 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.2.0' +version '11.2.1' supports 'debian' supports 'ubuntu' From 9c645f37aa426fd6e44ccbc3a098e4102e321a39 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:04:02 +0100 Subject: [PATCH 100/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3962600a..0e8462fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.2.1 - *2023-09-12* ## 11.2.0 - *2023-09-12* From 4ffd00e40d7e6c1c9517301165ea6284c9980989 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 09:40:22 +0800 Subject: [PATCH 101/188] Update actions/checkout digest to 8ade135 (#700) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/md-links.yml | 2 +- .github/workflows/test-kitchen.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/md-links.yml b/.github/workflows/md-links.yml index b4f2de13..abdae233 100644 --- a/.github/workflows/md-links.yml +++ b/.github/workflows/md-links.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 - name: markdown-link-check uses: gaurav-nelson/github-action-markdown-link-check@1.0.15 with: diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index 8fb0a6d0..29cdac56 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -55,7 +55,7 @@ jobs: fail-fast: false steps: - name: Check out code - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 - name: Install Chef uses: actionshub/chef-install@2.0.4 - name: Dokken @@ -72,7 +72,7 @@ jobs: runs-on: macos-latest steps: - name: Check out code - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 - name: Install Chef uses: actionshub/chef-install@2.0.4 - name: Kitchen Converge From c836a08fbe433b8ac3f092d56030ac8fddb26834 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Thu, 28 Sep 2023 02:40:25 +0100 Subject: [PATCH 102/188] Update changelog for 11.2.2 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e8462fb..61c9380e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 11.2.2 - *2023-09-28* ## 11.2.1 - *2023-09-12* From a6e7163028c2b1e6fe36746a7fd1e75a40fd4506 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Thu, 28 Sep 2023 02:40:25 +0100 Subject: [PATCH 103/188] Update metadata for 11.2.2 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 55ac99a3..8fd5609e 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.2.1' +version '11.2.2' supports 'debian' supports 'ubuntu' From 9d3e63a35d64be61bd7c7f89d0b305828cc36681 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Thu, 28 Sep 2023 02:40:28 +0100 Subject: [PATCH 104/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61c9380e..a8df71e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 11.2.2 - *2023-09-28* ## 11.2.1 - *2023-09-12* From 00570a6f0c07020186fae2aeedd2c49eb82d1e13 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Fri, 29 Sep 2023 15:47:00 +0100 Subject: [PATCH 105/188] AdoptOpenJDK --> Termurin/Semeru # Description Remove AdoptOpenJDK and replace with Adoptium Termurin & IBM Semeru ## Issues Resolved #674 ## Check List - [ ] A summary of changes made is included in the CHANGELOG under `## Unreleased` - [ ] New functionality includes testing. - [ ] New functionality has been documented in the README if applicable. --- CHANGELOG.md | 275 +++++++++--------- kitchen.yml | 77 ++--- libraries/adopt_openjdk_helpers.rb | 102 ------- libraries/openjdk_helpers.rb | 57 +++- resources/adoptopenjdk_linux_install.rb | 147 +++------- resources/openjdk_source_install.rb | 12 +- spec/libraries/adopt_openjdk_helpers_spec.rb | 159 ---------- .../adopt_openjdk_macos_helpers_spec.rb | 47 --- spec/libraries/openjdk_helpers_spec.rb | 2 +- spec/libraries/semeru_helpers_spec.rb | 73 +++++ spec/spec_helper.rb | 1 - .../cookbooks/test/recipes/adoptopenjdk.rb | 14 - .../cookbooks/test/recipes/openjdk.rb | 7 +- 13 files changed, 373 insertions(+), 600 deletions(-) delete mode 100644 libraries/adopt_openjdk_helpers.rb delete mode 100644 spec/libraries/adopt_openjdk_helpers_spec.rb delete mode 100644 spec/libraries/adopt_openjdk_macos_helpers_spec.rb create mode 100644 spec/libraries/semeru_helpers_spec.rb delete mode 100644 test/fixtures/cookbooks/test/recipes/adoptopenjdk.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index a8df71e4..baad3e85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,18 +18,22 @@ This file is used to list changes made in each version of the Java cookbook. ## 11.1.11 - *2023-04-17* +Standardise files with files in sous-chefs/repo-management + ## 11.1.10 - *2023-04-07* Standardise files with files in sous-chefs/repo-management ## 11.1.9 - *2023-04-01* -## 11.1.8 - *2023-04-01* +Standardise files with files in sous-chefs/repo-management -## 11.1.7 - *2023-04-01* +## 11.1.8 - *2023-04-01* Standardise files with files in sous-chefs/repo-management +## 11.1.7 - *2023-04-01* + Standardise files with files in sous-chefs/repo-management ## 11.1.6 - *2023-03-02* @@ -103,16 +107,19 @@ Standardise files with files in sous-chefs/repo-management - Remove testing for end of life OpenJDK suites - Primarily support OpenJDK LTS versions 11, 17 - Drop support for OpenJDK package installs for non-LTS versions - - These packages are still possible to install though they will now default to a source install + + These packages are still possible to install though they will now default to a source install - Direct Amazon users to Amazon Corretto instead of installing OpenJDK - Drop package install support for Java 8. Most supported operating systems no longer support OpenJDK 8 - - To install OpenJDK 8, a 'source' install from an internal mirror is now recommended + + To install OpenJDK 8, a 'source' install from an internal mirror is now recommended ## 10.0.1 - *2021-09-21* - Split out workflows to allow standardfiles to control markdown, yaml and delivery - Adds a "Final" workflow to set a known pass/failure hook - - This allows us to have Terraform set the Final workflow as a required check + + This allows us to have Terraform set the Final workflow as a required check ## 10.0.0 - *2021-09-02* @@ -489,9 +496,9 @@ Standardise files with files in sous-chefs/repo-management ## v1.29.0 - (11/14/2014) -- **[#216](https://github.com/agileorbit-cookbooks/java/pull/216)** - Ensure dirs, links, and jinfo files are owned correctly -- **[#217](https://github.com/agileorbit-cookbooks/java/pull/217)** - Update to Oracle JDK 8u25 -- **[#214](https://github.com/agileorbit-cookbooks/java/pull/214)** - Update to Oracle JDK 7u71-b14 +- Ensure dirs, links, and jinfo files are owned correctly +- Update to Oracle JDK 8u25 +- Update to Oracle JDK 7u71-b14 - Adding a connect_timeout option for downloading java. - Switched to chef-zero provisioner in test suites. - Adding ISSUES.md for guidance on creating new issues for the Java cookbook. @@ -509,15 +516,15 @@ Standardise files with files in sous-chefs/repo-management ## v1.26.0 - (8/16/2014) -- **[#201](https://github.com/agileorbit-cookbooks/java/pull/201)** - Allow pinning of package versions for openjdk -- **[#198](https://github.com/agileorbit-cookbooks/java/pull/198)** - Update Oracle JDK7 to version 7u67 -- **[#189](https://github.com/agileorbit-cookbooks/java/pull/184)** - Support specific version and name for Oracle RPM +- Allow pinning of package versions for openjdk +- Update Oracle JDK7 to version 7u67 +- Support specific version and name for Oracle RPM ## v1.25.0 - (8/1/2014) -- **[#189](https://github.com/agileorbit-cookbooks/java/pull/189)** - Resource ark -> attribute bin_cmds default value -- **[#168](https://github.com/agileorbit-cookbooks/java/pull/168)** - Add option to put JAVA_HOME in /etc/environment -- **[#172](https://github.com/agileorbit-cookbooks/java/pull/172)** - Allow ark to pull from http and files ending in .gz. +- Resource ark -> attribute bin_cmds default value +- Add option to put JAVA_HOME in /etc/environment +- Allow ark to pull from http and files ending in .gz. - Recommendations for inclusion in community cookbooks - Production Deployment with Oracle Java - Update testing instructions for chefdk @@ -530,15 +537,15 @@ Standardise files with files in sous-chefs/repo-management New Cookbook maintainer! **[Agile Orbit](http://agileorbit.com)** -- **[#192](https://github.com/agileorbit-cookbooks/java/pull/192)** - Bump JDK7 URLs to 7u65 -- **[#191](https://github.com/agileorbit-cookbooks/java/pull/192)** - Upgrade Oracle's Java 8 to u11 -- **[#188](https://github.com/agileorbit-cookbooks/java/pull/188)** - Allow for alternatives priority to be set from attribute. -- **[#176](https://github.com/agileorbit-cookbooks/java/pull/176)** - Change ownership of extracted files -- **[#169](https://github.com/agileorbit-cookbooks/java/pull/169)** - Add retries and retry_delay parameters to java_ark LWRP -- **[#167](https://github.com/agileorbit-cookbooks/java/pull/167)** - default: don't fail when using java 8 on windows -- **[#165](https://github.com/agileorbit-cookbooks/java/pull/165)** - Support for Server JRE -- **[#158](https://github.com/agileorbit-cookbooks/java/pull/158)** - Updated README for accepting oracle terms -- **[#157](https://github.com/agileorbit-cookbooks/java/pull/157)** -Remove VirtualBox specific box_urls +- Bump JDK7 URLs to 7u65 +- Upgrade Oracle's Java 8 to u11 +- Allow for alternatives priority to be set from attribute. +- Change ownership of extracted files +- Add retries and retry_delay parameters to java_ark LWRP +- default: don't fail when using java 8 on windows +- Support for Server JRE +- Updated README for accepting oracle terms +-Remove VirtualBox specific box_urls - List AgileOrbit as the maintainer (AgileOrbit took over from Socrata in July 2014) ## v1.23.0 - (7/25/2014) @@ -547,100 +554,100 @@ New Cookbook maintainer! **[Agile Orbit](http://agileorbit.com)** ## v1.22.0 -- **[#148](https://github.com/socrata-cookbooks/java/pull/148)** - Add support for Oracle JDK 1.8.0 -- **[#150](https://github.com/socrata-cookbooks/java/pull/150)** - Make use of Chef's cache directory instead of /tmp -- **[#151](https://github.com/socrata-cookbooks/java/pull/151)** - Update Test Kitchen suites -- **[#154](https://github.com/socrata-cookbooks/java/pull/154)** - Add safety check for JDK 8 on non-Oracle +- Add support for Oracle JDK 1.8.0 +- Make use of Chef's cache directory instead of /tmp +- Update Test Kitchen suites +- Add safety check for JDK 8 on non-Oracle ## v1.21.2 -- **[#146](https://github.com/socrata-cookbooks/java/pull/146)** - Update Oracle accept-license-terms cookie format +- Update Oracle accept-license-terms cookie format ## v1.21.0 -- **[#143](https://github.com/socrata-cookbooks/java/pull/143)** - Symlink /usr/lib/jvm/default-java for both OpenJDK and Oracle -- **[#144](https://github.com/socrata-cookbooks/java/pull/144)** - Remove /var/lib/alternatives/#{cmd} before calling alternatives (Hopefully fixes sporadic issues when setting alternatives) -- **[Make default_java_symlink conditional on set_default attribute](https://github.com/socrata-cookbooks/java/commit/e300e235a463382a5022e1dddaac674930b4d138)** +- Symlink /usr/lib/jvm/default-java for both OpenJDK and Oracle +- Remove /var/lib/alternatives/#{cmd} before calling alternatives (Hopefully fixes sporadic issues when setting alternatives) +- Make default_java_symlink conditional on set_default attribute ## v1.20.0 -- **[#137](https://github.com/socrata-cookbooks/java/pull/137)** - Create /usr/lib/jvm/default-java on Debian -- **[#138](https://github.com/socrata-cookbooks/java/pull/138)** - allow wrapping cookbook without providing templates -- **[#140](https://github.com/socrata-cookbooks/java/pull/140)** - Adds set_default attribute to toggle setting JDK as default -- **[#141](https://github.com/socrata-cookbooks/java/pull/141)** - set java_home correctly for oracle_rpm +- Create /usr/lib/jvm/default-java on Debian +- allow wrapping cookbook without providing templates +- Adds set_default attribute to toggle setting JDK as default +- set java_home correctly for oracle_rpm ## v1.19.2 -- **[#129](https://github.com/socrata-cookbooks/java/pull/129)** - Upgrade to ChefSpec 3 +- Upgrade to ChefSpec 3 - Rewrite unit tests for better coverage and to work with ChefSpec 3 (various commits) - List Socrata as the maintainer (Socrata took over from Opscode in December 2013) -- **[#133](https://github.com/socrata-cookbooks/java/pull/133)** - Allow jdk_version to be a string or number -- **[#131](https://github.com/socrata-cookbooks/java/pull/131)** - Fix JDK install on Windows -- **[Fix openjdk_packages on Arch Linux](https://github.com/socrata-cookbooks/java/commit/677bee7b9bf08988596d40ac65e75984a86bda99)** +- Allow jdk_version to be a string or number +- Fix JDK install on Windows +- Fix openjdk_packages on Arch Linux +- ## v1.19.0 Refactor the cookbook to better support wrapper cookbooks and other cookbook authoring patterns. -- **[#123](https://github.com/socrata-cookbooks/java/pull/123)** - Update documentation & add warning for issue 122 -- **[#124](https://github.com/socrata-cookbooks/java/pull/124)** - Refactor default recipe to better enable wrapper cookbooks -- **[#125](https://github.com/socrata-cookbooks/java/pull/125)** - Removes the attribute to purge deprecated packages -- **[#127](https://github.com/socrata-cookbooks/java/pull/127)** - Add safety check if attributes are unset -- **[Adds tests for directly using openjdk and oracle recipes](https://github.com/socrata-cookbooks/java/commit/794df596959d65a1a6d5f6c52688bffd8de6bff4)** -- **[Adds recipes to README](https://github.com/socrata-cookbooks/java/commit/76d52114bb9df084174d43fed143123b1cdbae16)** -- **[The Opscode CCLA is no longer required](https://github.com/socrata-cookbooks/java/commit/ce4ac25caa8383f185c25c4e32cafef8c0453376)** -- **[Adds tests for openjdk-7 and oracle-7](https://github.com/socrata-cookbooks/java/commit/9c38af241f68b3198cde4ad6fe2b4cb752062009)** -- **[#119](https://github.com/socrata-cookbooks/java/pull/119)** - Use java_home instead of java_location for update-alternatives -- **[Fix java_home for rhel and fedora](https://github.com/socrata-cookbooks/java/commit/71dadbd1bfe2eab50ff21cdab4ded97877911cc4)** +- Update documentation & add warning for issue 122 +- Refactor default recipe to better enable wrapper cookbooks +- Removes the attribute to purge deprecated packages +- Add safety check if attributes are unset +- Adds tests for directly using openjdk and oracle recipes +- Adds recipes to README +- The Opscode CCLA is no longer required +- Adds tests for openjdk-7 and oracle-7 +- Use java_home instead of java_location for update-alternatives +- Fix java_home for rhel and fedora ## v1.18.0 -- **[#118](https://github.com/socrata-cookbooks/java/pull/118)** - Upgrade to 7u51 -- **[#117](https://github.com/socrata-cookbooks/java/pull/117)** - Suggest windows and aws +- Upgrade to 7u51 +- Suggest windows and aws ## v1.17.6 -- Revert **[COOK-4165](https://tickets.opscode.com/browse/COOK-4165)** - The headers option was only added to remote_file in Chef 11.6.0, meaning this change breaks older clients. +- Revert **[COOK-4165]** - The headers option was only added to remote_file in Chef 11.6.0, meaning this change breaks older clients. ## v1.17.4 -- **[#111](https://github.com/socrata-cookbooks/java/pull/111)** - Fix alternatives for centos +- Fix alternatives for centos -- **[COOK-4165](https://tickets.opscode.com/browse/COOK-4165)** - Replace curl with remote_file with cookie header -- **[#110](https://github.com/socrata-cookbooks/java/pull/110)** - Update openjdk to use the alternatives resource +- Replace curl with remote_file with cookie header +- Update openjdk to use the alternatives resource ## v1.17.2 -- **[COOK-4136](https://tickets.opscode.com/browse/COOK-4136)** - Add md5 parameter to java_ark resource +- Add md5 parameter to java_ark resource ## v1.17.0 -- **[COOK-4114](https://tickets.opscode.com/browse/COOK-4114)** - Test Kitchen no longer works after merging Pull Request #95 for openjdk tests on Debian/Ubuntu -- **[COOK-4124](https://tickets.opscode.com/browse/COOK-4124)** - update-alternatives fails to run -- **[#81](https://github.com/socrata/java/pull/81)** - Ensure local directory hierarchy -- **[#97](https://github.com/socrata/java/pull/97)** - Expose LWRP state attributes -- **[#99](https://github.com/socrata/java/pull/99)** - support for MD5 checksum -- **[#106](https://github.com/socrata/java/pull/106)** - Fixed windows case to prevent bad java_home variable setting -- **[Update checksums to the officially-published ones from Oracle](https://github.com/socrata/java/commit/b9e1df24caeb6e22346d2d415b3b4384f15d4ffd)** -- **[Further test kitchen fixes to use the default recipe](https://github.com/socrata/java/commit/01c0b432705d9cfa6d2dfeaa380983e3f604069f)** +- Test Kitchen no longer works after merging Pull Request #95 for openjdk tests on Debian/Ubuntu +- update-alternatives fails to run +- Ensure local directory hierarchy +- Expose LWRP state attributes support for MD5 checksum +- Fixed windows case to prevent bad java_home variable setting +- Update checksums to the officially-published ones +- Further test kitchen fixes ## v1.16.4 -- **[#103](https://github.com/socrata/java/pull/103)** - set alternatives when using ibm_tar recipe -- **[#104](https://github.com/socrata/java/pull/104)** - Specify windows attributes in attribute files +- set alternatives when using ibm_tar recipe +- Specify windows attributes in attribute files ## v1.16.2 -- **[COOK-3488](https://tickets.opscode.com/browse/COOK-3488)** - set alternatives for ibm jdk -- **[COOK-3764](https://tickets.opscode.com/browse/COOK-3764)** - IBM Java installer needs 'rpm' package on Ubuntu +- set alternatives for ibm jdk +- IBM Java installer needs 'rpm' package on Ubuntu -- **[COOK-3857](https://tickets.opscode.com/browse/COOK-3857)** - do not unescape the java windows url before parsing it -- **[#95](https://github.com/socrata/java/pull/95)** - fixes update-alternatives for openjdk installs -- **[#100](https://github.com/socrata/java/pull/100)** - Use escaped quotes for Windows INSTALLDIR +- do not unescape the java windows url before parsing it +- fixes update-alternatives for openjdk installs +- Use escaped quotes for Windows INSTALLDIR ## v1.16.0 -- **[COOK-3823](https://tickets.opscode.com/browse/COOK-3823)** - Upgrade to JDK 7u45-b18 +- Upgrade to JDK 7u45-b18 ## v1.15.4 @@ -658,44 +665,42 @@ Refactor the cookbook to better support wrapper cookbooks and other cookbook aut ### FIX -- [COOK-3908] - Fixing JAVA_HOME on Ubuntu 10.04 +- Fixing JAVA_HOME on Ubuntu 10.04 ## v1.14.0 -- **[COOK-3704](https://tickets.opscode.com/browse/COOK-3704)** - Fix alternatives when the package is already installed -- **[COOK-3668](https://tickets.opscode.com/browse/COOK-3668)** - Fix a condition that would result in an error executing action `run` on resource 'bash[update-java-alternatives]' -- **[COOK-3569](https://tickets.opscode.com/browse/COOK-3569)** - Fix bad checksum length -- **[COOK-3541](https://tickets.opscode.com/browse/COOK-3541)** - Fix an issue where Java cookbook installs both JDK 6 and JDK 7 when JDK 7 is specified -- **[COOK-3518](https://tickets.opscode.com/browse/COOK-3518)** - Allow Windoes recipe to download from signed S3 url -- **[COOK-2996](https://tickets.opscode.com/browse/COOK-2996)** - Fix a failure on Centos 6.4 and Oracle JDK 7 - -- **[COOK-2793](https://tickets.opscode.com/browse/COOK-2793)** - Improve Windows support +- Fix alternatives when the package is already installed +- Fix a condition that would result in an error executing action `run` on resource 'bash[update-java-alternatives]' +- Fix bad checksum length +- Fix an issue where Java cookbook installs both JDK 6 and JDK 7 when JDK 7 is specified +- Allow Windoes recipe to download from signed S3 url +- Fix a failure on Centos 6.4 and Oracle JDK 7 +- Improve Windows support ## v1.13.0 -- **[COOK-3295](https://tickets.opscode.com/browse/COOK-3295)** - Add default `platform_family` option in Java helper -- **[COOK-3277](https://tickets.opscode.com/browse/COOK-3277)** - Fix support for Fedora - -- **[COOK-3278](https://tickets.opscode.com/browse/COOK-3278)** - Upgrade to Oracle Java 7u25 -- **[COOK-3029](https://tickets.opscode.com/browse/COOK-3029)** - Add Oracle RPM support -- **[COOK-2931](https://tickets.opscode.com/browse/COOK-2931)** - Add support for the platform `xenserver` -- **[COOK-2154](https://tickets.opscode.com/browse/COOK-2154)** - Add SmartOS support +- Add default `platform_family` option in Java helper +- Fix support for Fedora +- Upgrade to Oracle Java 7u25 +- Add Oracle RPM support +- Add support for the platform `xenserver` +- Add SmartOS support ## v1.12.0 -- [COOK-2154]: Add SmartOS support to java::openjdk recipe -- [COOK-3278]: upgrade to Oracle Java 7u25 -- [COOK-2931]: Adding support for the platform 'xenserver' (for installations of java in DOM0) -- [COOK-3277]: java cookbook fails on Fedora +- Add SmartOS support to java::openjdk recipe +- upgrade to Oracle Java 7u25 +- Adding support for the platform 'xenserver' (for installations of java in DOM0) +- java cookbook fails on Fedora ## v1.11.6 -- [COOK-2847]: Java cookbook does not have opensuse support -- [COOK-3142]: Syntax Errors spec/default_spec.rb:4-8 +- Java cookbook does not have opensuse support +- Syntax Errors spec/default_spec.rb:4-8 ## v1.11.4 -- [COOK-2989]: `bash[update-java-alternatives]` resource uses wrong attribute +- `bash[update-java-alternatives]` resource uses wrong attribute ## v1.11.2 @@ -705,96 +710,96 @@ Refactor the cookbook to better support wrapper cookbooks and other cookbook aut This version brings a wealth of tests and (backwards-compatible) refactoring, plus some new features (updated Java, IBM recipe). -- [COOK-2897]: Add ibm recipe to java cookbook -- [COOK-2903]: move java_home resources to their own recipe -- [COOK-2904]: refactor ruby_block "update-java-alternatives" -- [COOK-2905]: use platform_family in java cookbook -- [COOK-2920]: add chefspec to java cookbook -- [COOK-2902]: Refactor java cookbook -- [COOK-2900]: update JDK to JDK 7u21, 6u45 +- Add ibm recipe to java cookbook +- move java_home resources to their own recipe +- refactor ruby_block "update-java-alternatives" +- use platform_family in java cookbook +- add chefspec to java cookbook +- Refactor java cookbook +- update JDK to JDK 7u21, 6u45 ## v1.10.2 -- [COOK-2415] - Fixed deprecation warnings in ark provider and openjdk recipe by using Chef::Mixin::ShellOut instead of Chef::ShellOut +- [2415] - Fixed deprecation warnings in ark provider and openjdk recipe by using Chef::Mixin::ShellOut instead of Chef::ShellOut ## v1.10.0 -- [COOK-2400] - Allow java ark :url to be https -- [COOK-2436] - Upgrade needed for oracle jdk in java cookbook +- Allow java ark :url to be https +- Upgrade needed for oracle jdk in java cookbook ## v1.9.6 -- [COOK-2412] - add support for Oracle Linux +- add support for Oracle Linux ## v1.9.4 -- [COOK-2083] - Run set-env-java-home in Java cookbook only if necessary -- [COOK-2332] - ark provider does not allow for *.tgz tarballs to be used -- [COOK-2345] - Java cookbook fails on CentOS6 (update-java-alternatives) +- Run set-env-java-home in Java cookbook only if necessary +- ark provider does not allow for *.tgz tarballs to be used +- Java cookbook fails on CentOS6 (update-java-alternatives) ## v1.9.2 -- [COOK-2306] - FoodCritic fixes for java cookbook +- FoodCritic fixes for java cookbook ## v1.9.0 -- [COOK-2236] - Update the Oracle Java version in the Java cookbook to release 1.7u11 +- Update the Oracle Java version in the Java cookbook to release 1.7u11 ## v1.8.2 -- [COOK-2205] - Fix for missing /usr/lib/jvm/default-java on Debian +- Fix for missing /usr/lib/jvm/default-java on Debian ## v1.8.0 -- [COOK-2095] - Add windows support +- Add windows support ## v1.7.0 -- [COOK-2001] - improvements for Oracle update-alternatives - - When installing an Oracle JDK it is now registered with a higher priority than OpenJDK. (Related to COOK-1131.) - - When running both the oracle and oracle_i386 recipes, alternatives are now created for both JDKs. - - Alternatives are now created for all binaries listed in version specific attributes. (Related to COOK-1563 and COOK-1635.) - - When installing Oracke JDKs on Ubuntu, create .jinfo files for use with update-java-alternatives. Commands to set/install alternatives now only run if needed. +- improvements for Oracle update-alternatives +- When installing an Oracle JDK it is now registered with a higher priority than OpenJDK. (Related to COOK-1131.) +- When running both the oracle and oracle_i386 recipes, alternatives are now created for both JDKs. +- Alternatives are now created for all binaries listed in version specific attributes. (Related to COOK-1563 and COOK-1635.) +- When installing Oracke JDKs on Ubuntu, create .jinfo files for use with update-java-alternatives. Commands to set/install alternatives now only run if needed. ## v1.6.4 -- [COOK-1930] - fixed typo in attribute for java 5 on i586 +- fixed typo in attribute for java 5 on i586 ## v1.6.2 - whyrun support in `java_ark` LWRP - CHEF-1804 compatibility -- [COOK-1786] - install Java 6u37 and Java 7u9 -- [COOK-1819] - incorrect warning text about `node['java']['oracle']['accept_oracle_download_terms']` +- install Java 6u37 and Java 7u9 +- incorrect warning text about `node['java']['oracle']['accept_oracle_download_terms']` ## v1.6.0 -- [COOK-1218] - Install Oracle JDK from Oracle download directly -- [COOK-1631] - set JAVA_HOME in openjdk recipe -- [COOK-1655] - Install correct architecture on Amazon Linux +- Install Oracle JDK from Oracle download directly +- set JAVA_HOME in openjdk recipe +- Install correct architecture on Amazon Linux ## v1.5.4 -- [COOK-885] update alternatives called on wrong file -- [COOK-1607] use shellout instead of execute resource to update alternatives +update alternatives called on wrong file +use shellout instead of execute resource to update alternatives ## v1.5.2 -- [COOK-1200] - remove sun-java6-jre on Ubuntu before installing Oracle's Java -- [COOK-1260] - fails on Ubuntu 12.04 64bit with openjdk7 -- [COOK-1265] - Oracle Java should symlink the jar command +- remove sun-java6-jre on Ubuntu before installing Oracle's Java +- fails on Ubuntu 12.04 64bit with openjdk7 +- Oracle Java should symlink the jar command ## v1.5.0 -- [COOK-1146] - Oracle now prevents download of JDK via non-browser -- [COOK-1114] - fix File.exists? +- Oracle now prevents download of JDK via non-browser +- fix File.exists? ## v1.4.2 -- [COOK-1051] - fix attributes typo and platform case switch consistency +- fix attributes typo and platform case switch consistency ## v1.4.0 -- [COOK-858] - numerous updates: handle jdk6 and 7, switch from sun to oracle, make openjdk default, add `java_ark` LWRP. -- [COOK-942] - FreeBSD support -- [COOK-520] - ArchLinux support +- numerous updates: handle jdk6 and 7, switch from sun to oracle, make openjdk default, add `java_ark` LWRP. +- [42] - FreeBSD support +- ArchLinux support diff --git a/kitchen.yml b/kitchen.yml index 7b14a831..30ee8389 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -20,7 +20,6 @@ platforms: - name: freebsd-11 - name: freebsd-12 - name: fedora-latest - # - name: opensuse-leap-15 - name: ubuntu-18.04 - name: ubuntu-20.04 @@ -29,26 +28,26 @@ suites: - name: openjdk-11 run_list: - recipe[test::openjdk] - attributes: {version: "11"} + attributes: { version: "11" } verifier: inspec_tests: [test/integration/openjdk] - inputs: {java_version: "11"} + inputs: { java_version: "11" } - name: openjdk-16 run_list: - recipe[test::openjdk] - attributes: {version: "16"} + attributes: { version: "16" } verifier: inspec_tests: [test/integration/openjdk] - inputs: {java_version: "16"} + inputs: { java_version: "16" } - name: openjdk-17 run_list: - recipe[test::openjdk] - attributes: {version: "17"} + attributes: { version: "17" } verifier: inspec_tests: [test/integration/openjdk] - inputs: {java_version: "17"} + inputs: { java_version: "17" } # AdoptOpenJDK # Version 8 @@ -60,7 +59,8 @@ suites: variant: hotspot verifier: inspec_tests: [test/integration/adoptopenjdk] - input_files: [test/integration/adoptopenjdk/inputs/adoptopenjdk-8-hotspot.yml] + input_files: + - test/integration/adoptopenjdk/inputs/adoptopenjdk-8-hotspot.yml - name: adoptopenjdk-8-openj9 run_list: @@ -70,7 +70,8 @@ suites: variant: openj9 verifier: inspec_tests: [test/integration/adoptopenjdk] - input_files: [test/integration/adoptopenjdk/inputs/adoptopenjdk-8-openj9.yml] + input_files: + - test/integration/adoptopenjdk/inputs/adoptopenjdk-8-openj9.yml - name: adoptopenjdk-8-openj9-large-heap run_list: @@ -80,7 +81,8 @@ suites: variant: openj9-large-heap verifier: inspec_tests: [test/integration/adoptopenjdk] - input_files: [test/integration/adoptopenjdk/inputs/adoptopenjdk-8-openj9-large-heap.yml] + input_files: + - test/integration/adoptopenjdk/inputs/adoptopenjdk-8-openj9-large-heap.yml # Version 11 - name: adoptopenjdk-11-hotspot @@ -91,7 +93,8 @@ suites: variant: hotspot verifier: inspec_tests: [test/integration/adoptopenjdk] - input_files: [test/integration/adoptopenjdk/inputs/adoptopenjdk-11-hotspot.yml] + input_files: + - test/integration/adoptopenjdk/inputs/adoptopenjdk-11-hotspot.yml - name: adoptopenjdk-11-openj9 run_list: - recipe[test::adoptopenjdk] @@ -100,7 +103,8 @@ suites: variant: openj9 verifier: inspec_tests: [test/integration/adoptopenjdk] - input_files: [test/integration/adoptopenjdk/inputs/adoptopenjdk-11-openj9.yml] + input_files: + - test/integration/adoptopenjdk/inputs/adoptopenjdk-11-openj9.yml - name: adoptopenjdk-11-openj9-large-heap run_list: - recipe[test::adoptopenjdk] @@ -109,36 +113,41 @@ suites: variant: openj9-large-heap verifier: inspec_tests: [test/integration/adoptopenjdk] - input_files: [test/integration/adoptopenjdk/inputs/adoptopenjdk-11-openj9-large-heap.yml] + input_files: + - test/integration/adoptopenjdk/inputs/adoptopenjdk-11-openj9-large-heap.yml - # Version 14 - - name: adoptopenjdk-14-openj9-large-heap + # Version 17 + - name: adoptopenjdk-17-openj9-large-heap run_list: - recipe[test::adoptopenjdk] attributes: - version: 14 + version: 17 variant: openj9-large-heap verifier: inspec_tests: [test/integration/adoptopenjdk] - input_files: [test/integration/adoptopenjdk/inputs/adoptopenjdk-14-openj9-large-heap.yml] - - name: adoptopenjdk-14-openj9 + input_files: + - test/integration/adoptopenjdk/inputs/adoptopenjdk-17-openj9-large-heap.yml + + - name: adoptopenjdk-17-openj9 run_list: - recipe[test::adoptopenjdk] attributes: - version: 14 + version: 17 variant: openj9 verifier: inspec_tests: [test/integration/adoptopenjdk] - input_files: [test/integration/adoptopenjdk/inputs/adoptopenjdk-14-openj9.yml] - - name: adoptopenjdk-14-hotspot + input_files: + - test/integration/adoptopenjdk/inputs/adoptopenjdk-17-openj9.yml + - name: adoptopenjdk-17-hotspot run_list: - recipe[test::adoptopenjdk] attributes: - version: 14 + version: 17 variant: hotspot verifier: inspec_tests: [test/integration/adoptopenjdk] - input_files: [test/integration/adoptopenjdk/inputs/adoptopenjdk-14-hotspot.yml] + input_files: + - test/integration/adoptopenjdk/inputs/adoptopenjdk-14-hotspot.yml # 11 Removal - name: adoptopenjdk-removal-11-openj9 @@ -149,37 +158,38 @@ suites: variant: openj9 verifier: inspec_tests: [test/integration/remove-adoptopenjdk] - input_files: [test/integration/adoptopenjdk/inputs/adoptopenjdk-11-openj9.yml] + input_files: + - test/integration/adoptopenjdk/inputs/adoptopenjdk-11-openj9.yml # Corretto - name: corretto-8 run_list: - recipe[test::corretto] - attributes: {version: "8"} + attributes: { version: "8" } verifier: inspec_tests: [test/integration/corretto] - inputs: {java_version: "8"} + inputs: { java_version: "8" } - name: corretto-11 run_list: - recipe[test::corretto] - attributes: {version: "11"} + attributes: { version: "11" } verifier: inspec_tests: [test/integration/corretto] - inputs: {java_version: "11"} + inputs: { java_version: "11" } - name: corretto-17 run_list: - recipe[test::corretto] - attributes: {version: "17"} + attributes: { version: "17" } verifier: inspec_tests: [test/integration/corretto] - inputs: {java_version: "17"} + inputs: { java_version: "17" } - name: corretto-18 run_list: - recipe[test::corretto] - attributes: {version: "18"} + attributes: { version: "18" } verifier: inspec_tests: [test/integration/corretto] - inputs: {java_version: "18"} + inputs: { java_version: "18" } # Custom URL tests - name: custom-package-8 @@ -225,4 +235,5 @@ suites: checksum: 6524d85d2ce334c955a4347015567326067ef15fe5f6a805714b25cace256f40 verifier: inspec_tests: [test/integration/custom-package] - input_files: [test/integration/custom-package/inputs/openj9-large-heap-11.yml] + input_files: + [test/integration/custom-package/inputs/openj9-large-heap-11.yml] diff --git a/libraries/adopt_openjdk_helpers.rb b/libraries/adopt_openjdk_helpers.rb deleted file mode 100644 index 3a47eed1..00000000 --- a/libraries/adopt_openjdk_helpers.rb +++ /dev/null @@ -1,102 +0,0 @@ -module Java - module Cookbook - module AdoptOpenJdkHelpers - def sub_dir(url) - uri = URI.parse(url) - # get file basename without extension - basename = uri.path.split('/')[-1].gsub('.tar.gz', '') - - if basename.include?('linuxXL') # compensate for longer name - # Get version number from start of filename - if (basename.scan /\d+/)[0] == '8' - ver = basename.split('_')[5] - "jdk#{ver[0..4]}-#{ver[-3..-1]}" - else - ver = basename.split('_') - "jdk-#{ver[5]}+#{ver[6]}" - end - elsif (basename.scan /\d+/)[0] == '8' - ver = basename.split('_')[4] - "jdk#{ver[0..4]}-#{ver[-3..-1]}" - else - ver = basename.split('_') - "jdk-#{ver[4]}+#{ver[5]}" - end - end - - def default_adopt_openjdk_url(version) - case version - when '8' - { 'hotspot' => 'https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u242b08.tar.gz', - 'openj9' => 'https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08_openj9-0.18.1/OpenJDK8U-jdk_x64_linux_openj9_8u242b08_openj9-0.18.1.tar.gz', - 'openj9-large-heap' => 'https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08_openj9-0.18.1/OpenJDK8U-jdk_x64_linux_openj9_linuxXL_8u242b08_openj9-0.18.1.tar.gz', - } - when '11' - { 'hotspot' => 'https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.6_10.tar.gz', - 'openj9' => 'https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10_openj9-0.18.1/OpenJDK11U-jdk_x64_linux_openj9_11.0.6_10_openj9-0.18.1.tar.gz', - 'openj9-large-heap' => 'https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10_openj9-0.18.1/OpenJDK11U-jdk_x64_linux_openj9_linuxXL_11.0.6_10_openj9-0.18.1.tar.gz', - } - when '13' - { 'hotspot' => 'https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13.0.2%2B8/OpenJDK13U-jdk_x64_linux_hotspot_13.0.2_8.tar.gz', - 'openj9' => 'https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13.0.2%2B8_openj9-0.18.0/OpenJDK13U-jdk_x64_linux_openj9_13.0.2_8_openj9-0.18.0.tar.gz', - 'openj9-large-heap' => 'https://github.com/AdoptOpenJDK/openjdk13-binaries/releases/download/jdk-13.0.2%2B8_openj9-0.18.0/OpenJDK13U-jdk_x64_linux_openj9_linuxXL_13.0.2_8_openj9-0.18.0.tar.gz', - } - when '14' - { - 'hotspot' => 'https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14%2B36/OpenJDK14U-jdk_x64_linux_hotspot_14_36.tar.gz', - 'openj9' => 'https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14%2B36.1_openj9-0.19.0/OpenJDK14U-jdk_x64_linux_openj9_14_36_openj9-0.19.0.tar.gz', - 'openj9-large-heap' => 'https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14%2B36.1_openj9-0.19.0/OpenJDK14U-jdk_x64_linux_openj9_linuxXL_14_36_openj9-0.19.0.tar.gz', - } - else - Chef::Log.fatal('Version specified does not have a URL value set') - end - end - - def default_adopt_openjdk_checksum(version) - case version - when '8' - { 'hotspot' => 'f39b523c724d0e0047d238eb2bb17a9565a60574cf651206c867ee5fc000ab43', - 'openj9' => 'ca785af638b24f9d4df896f5a9f557cc9f1e5fa5e2b1174d6b906e3fd5474c2e', - 'openj9-large-heap' => '6ee788d57f15cc8c326bb3468390d5e353cc1aac1925efa3f2992a93e2520d97', - } - when '11' - { 'hotspot' => '330d19a2eaa07ed02757d7a785a77bab49f5ee710ea03b4ee2fa220ddd0feffc', - 'openj9' => '1530172ee98edd129954fcdca1bf725f7b30c8bfc3cdc381c88de96b7d19e690', - 'openj9-large-heap' => '6524d85d2ce334c955a4347015567326067ef15fe5f6a805714b25cace256f40', - } - when '13' - { 'hotspot' => '9ccc063569f19899fd08e41466f8c4cd4e05058abdb5178fa374cb365dcf5998', - 'openj9' => 'aeecf6d30d0c847db81d07793cf97e5dc44890c29366d7d9f8f9f397f6c52590', - 'openj9-large-heap' => '16751b3951b808c4cb0b77d4df1a16f9bfff5b2dbc59919773e6386114e6d8d5', - } - when '14' - { 'hotspot' => '6c06853332585ab58834d9e8a02774b388e6e062ef6c4084b4f058c67f2e81b5', - 'openj9' => '106b72d565be98834ead5fea9555bd646d488a86fc4ae4dd294a38e97bf77509', - 'openj9-large-heap' => '4ee13d0689ab7a38d6abb7dee974c3b189e36f1911a0cb61c882a38e61cc8b98', - } - else - Chef::Log.fatal('Version specified does not have a checksum value set') - end - end - - def default_adopt_openjdk_bin_cmds(version) - case version - when '8' - { 'hotspot' => ['appletviewer', 'clhsdb', 'extcheck', 'hsdb', 'idlj', 'jar', 'jarsigner', 'java', 'java-rmi.cgi', 'javac', 'javadoc', 'javah', 'javap', 'jcmd', 'jconsole', 'jdb', 'jdeps', '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'], - 'openj9' => ['appletviewer', 'extcheck', 'idlj', 'jar', 'jarsigner', 'java', 'java-rmi.cgi', 'javac', 'javadoc', 'javah', 'javap', 'jcmd', 'jconsole', 'jdb', 'jdeps', 'jdmpview', 'jitserver', 'jjs', 'jmap', 'jps', 'jrunscript', 'jsadebugd', 'jstack', 'jstat', 'keytool', 'native2ascii', 'orbd', 'pack200', 'policytool', 'rmic', 'rmid', 'rmiregistry', 'schemagen', 'serialver', 'servertool', 'tnameserv', 'traceformat', 'unpack200', 'wsgen', 'wsimport', 'xjc'], - 'openj9-large-heap' => ['appletviewer', 'extcheck', 'idlj', 'jar', 'jarsigner', 'java', 'java-rmi.cgi', 'javac', 'javadoc', 'javah', 'javap', 'jcmd', 'jconsole', 'jdb', 'jdeps', 'jdmpview', 'jitserver', 'jjs', 'jmap', 'jps', 'jrunscript', 'jsadebugd', 'jstack', 'jstat', 'keytool', 'native2ascii', 'orbd', 'pack200', 'policytool', 'rmic', 'rmid', 'rmiregistry', 'schemagen', 'serialver', 'servertool', 'tnameserv', 'traceformat', 'unpack200', 'wsgen', 'wsimport', 'xjc'] } - when '11' - { 'hotspot' => %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), - 'openj9' => %w(jar jarsigner java javac javadoc javap jcmd jconsole jdb jdeprscan jdeps jdmpview jextract jimage jitserver jjs jlink jmap jmod jps jrunscript jshell jstack jstat keytool pack200 rmic rmid rmiregistry serialver traceformat unpack200), - 'openj9-large-heap' => %w(jar jarsigner java javac javadoc javap jcmd jconsole jdb jdeprscan jdeps jdmpview jextract jimage jitserver jjs jlink jmap jmod jps jrunscript jshell jstack jstat keytool pack200 rmic rmid rmiregistry serialver traceformat unpack200) } - when '13', '14' - { 'hotspot' => %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), - 'openj9' => %w(jar jarsigner java javac javadoc javap jcmd jconsole jdb jdeprscan jdeps jdmpview jextract jimage jjs jlink jmap jmod jps jrunscript jshell jstack jstat keytool pack200 rmic rmid rmiregistry serialver traceformat unpack200), - 'openj9-large-heap' => %w(jar jarsigner java javac javadoc javap jcmd jconsole jdb jdeprscan jdeps jdmpview jextract jimage jjs jlink jmap jmod jps jrunscript jshell jstack jstat keytool pack200 rmic rmid rmiregistry serialver traceformat unpack200) } - else - Chef::Log.fatal('Version specified does not have a default set of bin_cmds') - end - end - end - end -end diff --git a/libraries/openjdk_helpers.rb b/libraries/openjdk_helpers.rb index 715c5ea7..0ef5a4b3 100644 --- a/libraries/openjdk_helpers.rb +++ b/libraries/openjdk_helpers.rb @@ -5,6 +5,13 @@ def lts %w(11 17) end + # This method relies on the GitHub release artefact URL + # e.g. https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.3%2B7/OpenJDK17U-jdk_aarch64_linux_hotspot_17.0.3_7.tar.gz + def sub_dir(url) + URI.parse(url) + url.split('/')[7].split('_')[0].gsub('%2', '-').downcase + end + def default_openjdk_install_method(version) case node['platform_family'] when 'amazon' @@ -27,14 +34,33 @@ def default_openjdk_install_method(version) end end - def default_openjdk_url(version) + def default_openjdk_url(version, variant = nil) + # Always default to OpenJDK + # If the user passes variant we'll also select that variant's URL case version + when '8' + case variant + when 'semeru' + 'https://github.com/ibmruntimes/semeru8-binaries/releases/download/jdk8u322-b06_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_8u322b06_openj9-0.30.0.tar.gz' + when 'temurin' + 'https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u322-b06/OpenJDK8U-jdk_x64_linux_hotspot_8u322b06.tar.gz' + else + Chef::Log.fatal('Version specified does not have a URL value set') + raise 'Version supplied does not have a download URL set' + end when '9' 'https://download.java.net/java/GA/jdk9/9/binaries/openjdk-9_linux-x64_bin.tar.gz' when '10' 'https://download.java.net/java/GA/jdk10/10/binaries/openjdk-10_linux-x64_bin.tar.gz' when '11' - 'https://download.java.net/java/ga/jdk11/openjdk-11_linux-x64_bin.tar.gz' + case variant + when 'semeru' + 'https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.14.1%2B1_openj9-0.30.1/ibm-semeru-open-jdk_x64_linux_11.0.14.1_1_openj9-0.30.1.tar.gz' + when 'temurin' + 'https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.15_10.tar.gz' + else + 'https://download.java.net/java/ga/jdk11/openjdk-11_linux-x64_bin.tar.gz' + end when '12' 'https://download.java.net/java/GA/jdk12/33/GPL/openjdk-12_linux-x64_bin.tar.gz' when '13' @@ -44,9 +70,32 @@ def default_openjdk_url(version) when '15' 'https://download.java.net/java/GA/jdk15/779bf45e88a44cbd9ea6621d33e33db1/36/GPL/openjdk-15_linux-x64_bin.tar.gz' when '16' - 'https://download.java.net/java/GA/jdk16/7863447f0ab643c585b9bdebf67c69db/36/GPL/openjdk-16_linux-x64_bin.tar.gz' + case variant + when 'semeru' + 'https://github.com/ibmruntimes/semeru16-binaries/releases/download/jdk-16.0.2%2B7_openj9-0.27.1/ibm-semeru-open-jdk_ppc64le_linux_16.0.2_7_openj9-0.27.1.tar.gz' + when 'temurin' + 'https://github.com/adoptium/temurin16-binaries/releases/download/jdk-16.0.2%2B7/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz' + else + 'https://download.java.net/java/GA/jdk16/7863447f0ab643c585b9bdebf67c69db/36/GPL/openjdk-16_linux-x64_bin.tar.gz' + end when '17' - 'https://download.java.net/java/GA/jdk17/0d483333a00540d886896bac774ff48b/35/GPL/openjdk-17_linux-x64_bin.tar.gz' + case variant + when 'semeru' + 'https://github.com/ibmruntimes/semeru17-binaries/releases/download/jdk-17.0.2%2B8_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_17.0.2_8_openj9-0.30.0.tar.gz' + when 'temurin' + 'https://github.com/adoptium/temurin18-binaries/releases/download/jdk-18.0.1%2B10/OpenJDK18U-jdk_x64_linux_hotspot_18.0.1_10.tar.gz' + else + 'https://download.java.net/java/GA/jdk17/0d483333a00540d886896bac774ff48b/35/GPL/openjdk-17_linux-x64_bin.tar.gz' + end + when '18' + case variant + when 'semeru' + 'https://github.com/AdoptOpenJDK/semeru18-binaries/releases/download/jdk-18.0.1%2B10_openj9-0.32.0/ibm-semeru-open-jdk_x64_linux_18.0.1_10_openj9-0.32.0.tar.gz' + when 'temurin' + 'https://github.com/adoptium/temurin18-binaries/releases/download/jdk-18.0.1%2B10/OpenJDK18U-jdk_x64_linux_hotspot_18.0.1_10.tar.gz' + else + 'https://download.java.net/java/GA/jdk18.0.1/3f48cabb83014f9fab465e280ccf630b/10/GPL/openjdk-18.0.1_linux-x64_bin.tar.gz' + end else Chef::Log.fatal('Version specified does not have a URL value set') raise 'Version supplied does not have a download URL set' diff --git a/resources/adoptopenjdk_linux_install.rb b/resources/adoptopenjdk_linux_install.rb index 126652b9..70026542 100644 --- a/resources/adoptopenjdk_linux_install.rb +++ b/resources/adoptopenjdk_linux_install.rb @@ -1,102 +1,45 @@ -provides :adoptopenjdk_linux_install -unified_mode true -include Java::Cookbook::AdoptOpenJdkHelpers - -property :variant, String, - equal_to: %w(hotspot openj9 openj9-large-heap), - default: 'openj9', - description: 'Install flavour' - -property :url, String, - default: lazy { default_adopt_openjdk_url(version)[variant] }, - description: 'The URL to download from' - -property :checksum, String, - regex: /^[0-9a-f]{32}$|^[a-zA-Z0-9]{40,64}$/, - default: lazy { default_adopt_openjdk_checksum(version)[variant] }, - description: 'The checksum for the downloaded file' - -property :java_home, String, - default: lazy { "/usr/lib/jvm/java-#{version}-adoptopenjdk-#{variant}/#{sub_dir(url)}" }, - description: 'Set to override the java_home' - -property :bin_cmds, Array, - default: lazy { default_adopt_openjdk_bin_cmds(version)[variant] }, - description: 'A list of bin_cmds based on the version and variant' - -use 'partial/_common' -use 'partial/_linux' -use 'partial/_java_home' - -action :install do - extract_dir = new_resource.java_home.split('/')[0..-2].join('/') - parent_dir = new_resource.java_home.split('/')[0..-3].join('/') - tarball_name = new_resource.url.split('/').last - - directory parent_dir do - owner new_resource.java_home_owner - group new_resource.java_home_group - mode new_resource.java_home_mode - recursive true - end - - remote_file "#{Chef::Config[:file_cache_path]}/#{tarball_name}" do - source new_resource.url - checksum new_resource.checksum - retries new_resource.retries - retry_delay new_resource.retry_delay - mode '644' - end - - archive_file "#{Chef::Config[:file_cache_path]}/#{tarball_name}" do - destination extract_dir - end - - template "/usr/lib/jvm/.java-#{new_resource.version}-adoptopenjdk-#{new_resource.variant}.jinfo" do - cookbook 'java' - source 'jinfo.erb' - owner new_resource.java_home_owner - group new_resource.java_home_group - variables( - priority: new_resource.alternatives_priority, - bin_cmds: new_resource.bin_cmds, - name: extract_dir.split('/').last, - app_dir: new_resource.java_home - ) - only_if { platform_family?('debian') } - end - - java_alternatives 'set-java-alternatives' do - java_location new_resource.java_home - bin_cmds new_resource.bin_cmds - priority new_resource.alternatives_priority - default new_resource.default - reset_alternatives new_resource.reset_alternatives - action :set - end - - node.default['java']['java_home'] = new_resource.java_home - - append_if_no_line 'Java Home' do - path '/etc/profile.d/java.sh' - line "export JAVA_HOME=#{new_resource.java_home}" - end -end - -action :remove do - extract_dir = new_resource.java_home.split('/')[0..-2].join('/') - - java_alternatives 'unset-java-alternatives' do - java_location new_resource.java_home - bin_cmds new_resource.bin_cmds - only_if { ::File.exist?(extract_dir) } - action :unset - end - - directory "AdoptOpenJDK removal of #{extract_dir}" do - path extract_dir - recursive true - only_if { ::File.exist?(extract_dir) } - action :delete - end -end +# provides :adoptopenjdk_linux_install +# unified_mode true +# include Java::Cookbook::OpenJdkHelpers + +# property :variant, String, +# equal_to: %w(hotspot openj9 openj9-large-heap), +# default: 'openj9', +# description: 'Install flavour' + +# property :url, String, +# default: lazy { default_openjdk_url(version, variant) }, +# description: 'The URL to download from' + +# property :checksum, String, +# regex: /^[0-9a-f]{32}$|^[a-zA-Z0-9]{40,64}$/, +# default: lazy { default_openjdk_checksum(version, variant) }, +# description: 'The checksum for the downloaded file' + +# property :java_home, String, +# default: lazy { "/usr/lib/jvm/java-#{version}-adoptopenjdk-#{variant}/#{sub_dir(url)}" }, +# description: 'Set to override the java_home' + +# property :bin_cmds, Array, +# default: lazy { default_openjdk_bin_cmds(version, variant) }, +# description: 'A list of bin_cmds based on the version and variant' + +# use 'partial/_common' +# use 'partial/_linux' +# use 'partial/_java_home' + +# action :install do +# template "/usr/lib/jvm/.java-#{new_resource.version}-adoptopenjdk-#{new_resource.variant}.jinfo" do +# cookbook 'java' +# source 'jinfo.erb' +# owner new_resource.java_home_owner +# group new_resource.java_home_group +# variables( +# priority: new_resource.alternatives_priority, +# bin_cmds: new_resource.bin_cmds, +# name: extract_dir.split('/').last, +# app_dir: new_resource.java_home +# ) +# only_if { platform_family?('debian') } +# end +# end diff --git a/resources/openjdk_source_install.rb b/resources/openjdk_source_install.rb index f999712e..dc119967 100644 --- a/resources/openjdk_source_install.rb +++ b/resources/openjdk_source_install.rb @@ -6,8 +6,13 @@ name_property: true, description: 'Java version to install' +property :variant, String, + equal_to: %w(opendjdk semeru temurin), + default: 'openjdk', + description: 'Install flavour' + property :url, String, - default: lazy { default_openjdk_url(version) }, + default: lazy { default_openjdk_url(version, variant) }, description: 'The URL to download from' property :checksum, String, @@ -61,6 +66,11 @@ reset_alternatives new_resource.reset_alternatives action :set end + + append_if_no_line 'Java Home' do + path '/etc/profile.d/java.sh' + line "export JAVA_HOME=#{new_resource.java_home}" + end end action :remove do diff --git a/spec/libraries/adopt_openjdk_helpers_spec.rb b/spec/libraries/adopt_openjdk_helpers_spec.rb deleted file mode 100644 index e4a0e9b0..00000000 --- a/spec/libraries/adopt_openjdk_helpers_spec.rb +++ /dev/null @@ -1,159 +0,0 @@ -require 'spec_helper' - -RSpec.describe Java::Cookbook::AdoptOpenJdkHelpers do - class DummyClass < Chef::Node - include Java::Cookbook::AdoptOpenJdkHelpers - end - - subject { DummyClass.new } - - describe '#sub_dir' do - before do - allow(subject).to receive(:[]).with('url').and_return(url) - end - - context 'AdoptOpenJDK 8 Hotspot' do - let(:url) { 'https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u242b08.tar.gz' } - - it 'returns the correct folder name' do - expect(subject.sub_dir(url)).to eq 'jdk8u242-b08' - end - end - - context 'OpenJDK 8 OpenJ9' do - let(:url) { 'https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08_openj9-0.18.1/OpenJDK8U-jdk_x64_linux_openj9_8u242b08_openj9-0.18.1.tar.gz' } - - it 'returns the correct folder name' do - expect(subject.sub_dir(url)).to eq 'jdk8u242-b08' - end - end - - context 'OpenJKDK 8 LargeHeap' do - let(:url) { 'https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08_openj9-0.18.1/OpenJDK8U-jdk_x64_linux_openj9_linuxXL_8u242b08_openj9-0.18.1.tar.gz' } - - it 'returns the correct folder name' do - expect(subject.sub_dir(url)).to eq 'jdk8u242-b08' - end - end - - context 'AdoptOpenJDK 11 Hotspot' do - let(:url) { 'https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.6_10.tar.gz' } - - it 'returns the correct folder name' do - expect(subject.sub_dir(url)).to eq 'jdk-11.0.6+10' - end - end - - context 'AdoptOpenJDK 11 OpenJ9' do - let(:url) { 'https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10_openj9-0.18.1/OpenJDK11U-jdk_x64_linux_openj9_11.0.6_10_openj9-0.18.1.tar.gz' } - - it 'returns the correct folder name' do - expect(subject.sub_dir(url)).to eq 'jdk-11.0.6+10' - end - end - - context 'AdoptOpenJDK 11 LargeHeap' do - let(:url) { 'https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10_openj9-0.18.1/OpenJDK11U-jdk_x64_linux_openj9_linuxXL_11.0.6_10_openj9-0.18.1.tar.gz' } - - it 'returns the correct folder name' do - expect(subject.sub_dir(url)).to eq 'jdk-11.0.6+10' - end - end - - context 'AdoptOpenJDK 14 Hotspot' do - let(:url) { 'https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14%2B36/OpenJDK14U-jdk_x64_linux_hotspot_14_36.tar.gz' } - - it 'returns the correct folder name' do - expect(subject.sub_dir(url)).to eq 'jdk-14+36' - end - end - - context 'AdoptOpenJDK 14 LargeHeap' do - let(:url) { 'https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14%2B36.1_openj9-0.19.0/OpenJDK14U-jdk_x64_linux_openj9_linuxXL_14_36_openj9-0.19.0.tar.gz' } - - it 'returns the correct folder name' do - expect(subject.sub_dir(url)).to eq 'jdk-14+36' - end - end - - context 'Custom URL: AdoptOpenJDK 8 Hotspot' do - let(:url) { 'https://some.custom.url/path/to/OpenJDK8U-jdk_x64_linux_hotspot_8u242b08.tar.gz' } - - it 'returns the correct folder name' do - expect(subject.sub_dir(url)).to eq 'jdk8u242-b08' - end - end - - context 'Custom URL: OpenJDK 8 OpenJ9' do - let(:url) { 'https://some.custom.url/path/to/OpenJDK8U-jdk_x64_linux_openj9_8u242b08_openj9-0.18.1.tar.gz' } - - it 'returns the correct folder name' do - expect(subject.sub_dir(url)).to eq 'jdk8u242-b08' - end - end - - context 'Custom URL: OpenJKDK 8 LargeHeap' do - let(:url) { 'https://some.custom.url/path/to/OpenJDK8U-jdk_x64_linux_openj9_linuxXL_8u242b08_openj9-0.18.1.tar.gz' } - - it 'returns the correct folder name' do - expect(subject.sub_dir(url)).to eq 'jdk8u242-b08' - end - end - - context 'Custom URL: AdoptOpenJDK 11 Hotspot' do - let(:url) { 'https://some.custom.url/path/to/OpenJDK11U-jdk_x64_linux_hotspot_11.0.6_10.tar.gz' } - - it 'returns the correct folder name' do - expect(subject.sub_dir(url)).to eq 'jdk-11.0.6+10' - end - end - - context 'Custom URL: AdoptOpenJDK 11 OpenJ9' do - let(:url) { 'https://some.custom.url/path/to/OpenJDK11U-jdk_x64_linux_openj9_11.0.6_10_openj9-0.18.1.tar.gz' } - - it 'returns the correct folder name' do - expect(subject.sub_dir(url)).to eq 'jdk-11.0.6+10' - end - end - - context 'Custom URL: AdoptOpenJDK 11 LargeHeap' do - let(:url) { 'https://some.custom.url/path/to/OpenJDK11U-jdk_x64_linux_openj9_linuxXL_11.0.6_10_openj9-0.18.1.tar.gz' } - - it 'returns the correct folder name' do - expect(subject.sub_dir(url)).to eq 'jdk-11.0.6+10' - end - end - - context 'Malformed URL' do - let(:url) { 'a\bad/path/\to\/some.tar.gz' } - - it 'throws an error' do - expect { subject.sub_dir(url) }.to raise_error(URI::InvalidURIError) - end - end - end - - describe '#default_adopt_openjdk_url' do - before do - allow(subject).to receive(:[]).with('version').and_return(version) - end - - context 'AdoptOpenJDK 11 LargeHeap' do - let(:version) { '11' } - let(:variant) { 'openj9-large-heap' } - - it 'returns the correct URL' do - expect(subject.default_adopt_openjdk_url(version)[variant]).to eq 'https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10_openj9-0.18.1/OpenJDK11U-jdk_x64_linux_openj9_linuxXL_11.0.6_10_openj9-0.18.1.tar.gz' - end - end - - context 'AdoptOpenJDK 11 OpenJ9' do - let(:version) { '11' } - let(:variant) { 'openj9' } - - it 'returns the correct URL' do - expect(subject.default_adopt_openjdk_url(version)[variant]).to eq 'https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10_openj9-0.18.1/OpenJDK11U-jdk_x64_linux_openj9_11.0.6_10_openj9-0.18.1.tar.gz' - end - end - end -end diff --git a/spec/libraries/adopt_openjdk_macos_helpers_spec.rb b/spec/libraries/adopt_openjdk_macos_helpers_spec.rb deleted file mode 100644 index 6f98ecd5..00000000 --- a/spec/libraries/adopt_openjdk_macos_helpers_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -require 'spec_helper' - -RSpec.describe Java::Cookbook::AdoptOpenJdkMacOsHelpers do - class DummyClass < Chef::Node - include Java::Cookbook::AdoptOpenJdkMacOsHelpers - end - - subject { DummyClass.new } - - describe '#macos_java_home' do - before do - allow(subject).to receive(:[]).with('version').and_return(version) - end - - context 'adoptopenjdk14' do - let(:version) { 'adoptopenjdk14' } - - it 'returns the correct folder' do - expect(subject.macos_java_home(version)).to eq '/Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home' - end - end - - context 'adoptopenjdk14-openj9-jre' do - let(:version) { 'adoptopenjdk14-openj9-jre' } - - it 'returns the correct folder' do - expect(subject.macos_java_home(version)).to eq '/Library/Java/JavaVirtualMachines/adoptopenjdk-14-openj9.jre/Contents/Home' - end - end - - context 'adoptopenjdk14-openj9-jre-large' do - let(:version) { 'adoptopenjdk14-openj9-jre-large' } - - it 'returns the correct folder' do - expect(subject.macos_java_home(version)).to eq '/Library/Java/JavaVirtualMachines/adoptopenjdk-14-openj9.jre/Contents/Home' - end - end - - context 'adoptopenjdk14-openj9-large' do - let(:version) { 'adoptopenjdk14-openj9-large' } - - it 'returns the correct folder' do - expect(subject.macos_java_home(version)).to eq '/Library/Java/JavaVirtualMachines/adoptopenjdk-14-openj9.jdk/Contents/Home' - end - end - end -end diff --git a/spec/libraries/openjdk_helpers_spec.rb b/spec/libraries/openjdk_helpers_spec.rb index 56c12c47..f57d4724 100644 --- a/spec/libraries/openjdk_helpers_spec.rb +++ b/spec/libraries/openjdk_helpers_spec.rb @@ -27,7 +27,7 @@ class DummyClass < Chef::Node end context 'Invalid OpenJDK version' do - let(:version) { '18' } + let(:version) { '18.2' } it 'should raise an error' do expect { subject.default_openjdk_url(version) } diff --git a/spec/libraries/semeru_helpers_spec.rb b/spec/libraries/semeru_helpers_spec.rb new file mode 100644 index 00000000..8910a555 --- /dev/null +++ b/spec/libraries/semeru_helpers_spec.rb @@ -0,0 +1,73 @@ +require 'spec_helper' + +RSpec.describe Java::Cookbook::OpenJdkHelpers do + class DummyClass < Chef::Node + include Java::Cookbook::OpenJdkHelpers + end + + subject { DummyClass.new } + + describe '#sub_dir' do + before do + allow(subject).to receive(:[]).with('url').and_return(url) + end + + context 'OpenJDK Semeru 8' do + let(:url) { 'https://github.com/ibmruntimes/semeru8-binaries/releases/download/jdk8u322-b06_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_8u322b06_openj9-0.30.0.tar.gz' } + + it 'returns the correct folder name' do + expect(subject.sub_dir(url)).to eq 'jdk8u322-b06' + end + end + + context 'Malformed URL' do + let(:url) { 'a\bad/path/\to\/some.tar.gz' } + + it 'throws an error' do + expect { subject.sub_dir(url) }.to raise_error(URI::InvalidURIError) + end + end + end + + describe '#defaul_openjdk_url' do + before do + allow(subject).to receive(:[]).with('version').and_return(version) + end + + context 'Semeru 8' do + let(:version) { '8' } + let(:variant) { 'semeru' } + + it 'returns the correct URL' do + expect(subject.default_openjdk_url(version, variant)).to eq 'https://github.com/ibmruntimes/semeru8-binaries/releases/download/jdk8u322-b06_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_8u322b06_openj9-0.30.0.tar.gz' + end + end + + context 'Semeru 11' do + let(:version) { '11' } + let(:variant) { 'semeru' } + + it 'returns the correct URL' do + expect(subject.default_openjdk_url(version, variant)).to eq 'https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.14.1%2B1_openj9-0.30.1/ibm-semeru-open-jdk_x64_linux_11.0.14.1_1_openj9-0.30.1.tar.gz' + end + end + + context 'Semeru 16' do + let(:version) { '16' } + let(:variant) { 'semeru' } + + it 'returns the correct URL' do + expect(subject.default_openjdk_url(version, variant)).to eq 'https://github.com/ibmruntimes/semeru16-binaries/releases/download/jdk-16.0.2%2B7_openj9-0.27.1/ibm-semeru-open-jdk_ppc64le_linux_16.0.2_7_openj9-0.27.1.tar.gz' + end + end + + context 'Semeru 17' do + let(:version) { '17' } + let(:variant) { 'semeru' } + + it 'returns the correct URL' do + expect(subject.default_openjdk_url(version, variant)).to eq 'https://github.com/ibmruntimes/semeru17-binaries/releases/download/jdk-17.0.2%2B8_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_17.0.2_8_openj9-0.30.0.tar.gz' + end + end + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5906593e..ee2b6646 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,6 @@ require 'chefspec' require 'chefspec/berkshelf' -require_relative '../libraries/adopt_openjdk_helpers' require_relative '../libraries/adopt_openjdk_macos_helpers' require_relative '../libraries/certificate_helpers' require_relative '../libraries/corretto_helpers' diff --git a/test/fixtures/cookbooks/test/recipes/adoptopenjdk.rb b/test/fixtures/cookbooks/test/recipes/adoptopenjdk.rb deleted file mode 100644 index 2c89076f..00000000 --- a/test/fixtures/cookbooks/test/recipes/adoptopenjdk.rb +++ /dev/null @@ -1,14 +0,0 @@ -apt_update - -version = node['version'] -variant = node['variant'] - -adoptopenjdk_install version do - variant variant -end - -cookbook_file '/tmp/UnlimitedSupportJCETest.jar' do - source 'UnlimitedSupportJCETest.jar' -end - -include_recipe 'test::java_cert' diff --git a/test/fixtures/cookbooks/test/recipes/openjdk.rb b/test/fixtures/cookbooks/test/recipes/openjdk.rb index 97ce6d41..6fea755a 100644 --- a/test/fixtures/cookbooks/test/recipes/openjdk.rb +++ b/test/fixtures/cookbooks/test/recipes/openjdk.rb @@ -1,3 +1,8 @@ -openjdk_install node['version'] +openjdk_install node['version'] do + variant node['variant'] if node['variant'] +end + +# openjdk || semeru || temurin +# openjdk OpenJ9 || hotspot include_recipe 'test::java_cert' From 88364c1fbedae54a6c9df2d839df19a163975fed Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:47:03 +0100 Subject: [PATCH 106/188] Update changelog for 12.0.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index baad3e85..f9c10f03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 12.0.0 - *2023-09-29* ## 11.2.2 - *2023-09-28* From 10f0ada82e03006f6686edd0642673e3f506a1ef Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:47:04 +0100 Subject: [PATCH 107/188] Update metadata for 12.0.0 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 8fd5609e..23e6f2d9 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '11.2.2' +version '12.0.0' supports 'debian' supports 'ubuntu' From a90b93662fec8bd0c63e20478740ef3288e018a9 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:47:07 +0100 Subject: [PATCH 108/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9c10f03..32ead74a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 12.0.0 - *2023-09-29* ## 11.2.2 - *2023-09-28* From 9defc0ee41cf131d6105ce98b5698fdb6131cb51 Mon Sep 17 00:00:00 2001 From: Isaac Boehman Date: Fri, 29 Sep 2023 22:48:06 -0400 Subject: [PATCH 109/188] fix: typo, 'opendjdk' should be 'openjdk' (#702) --- CHANGELOG.md | 2 ++ resources/openjdk_source_install.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32ead74a..91c57cde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +- fix OpenJDK variant typo + ## 12.0.0 - *2023-09-29* ## 11.2.2 - *2023-09-28* diff --git a/resources/openjdk_source_install.rb b/resources/openjdk_source_install.rb index dc119967..d27cf20c 100644 --- a/resources/openjdk_source_install.rb +++ b/resources/openjdk_source_install.rb @@ -7,7 +7,7 @@ description: 'Java version to install' property :variant, String, - equal_to: %w(opendjdk semeru temurin), + equal_to: %w(openjdk semeru temurin), default: 'openjdk', description: 'Install flavour' From 95bd040b3f23c793d0119e3be0f061e5ff36c567 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Sat, 30 Sep 2023 03:48:10 +0100 Subject: [PATCH 110/188] Update changelog for 12.0.1 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91c57cde..ca455fee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 12.0.1 - *2023-09-30* - fix OpenJDK variant typo From fbbaa10db56c631cf233a02b2f13ff151d785365 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Sat, 30 Sep 2023 03:48:10 +0100 Subject: [PATCH 111/188] Update metadata for 12.0.1 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 23e6f2d9..8b95f751 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '12.0.0' +version '12.0.1' supports 'debian' supports 'ubuntu' From 59139c30238b300c8fa3a0a0c9cc57024fac1247 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Sat, 30 Sep 2023 03:48:14 +0100 Subject: [PATCH 112/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca455fee..f70d0e55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 12.0.1 - *2023-09-30* - fix OpenJDK variant typo From 24041aa64bd3a47c1956152365c970280f806ce5 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Tue, 3 Oct 2023 08:09:18 +0100 Subject: [PATCH 113/188] Revert CHANGELOG to 11.2.2 (#703) --- CHANGELOG.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f70d0e55..baad3e85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,6 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased -## 12.0.1 - *2023-09-30* - -- fix OpenJDK variant typo - -## 12.0.0 - *2023-09-29* - ## 11.2.2 - *2023-09-28* ## 11.2.1 - *2023-09-12* From 4c08dfd08cfb5f8c8ded66116fa984eb01c49b60 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Wed, 1 Nov 2023 12:41:32 +0000 Subject: [PATCH 114/188] Workflows (#706) * Remove markdown links CI action * Rename test-kitchen.yml - Rename to ci.yml to match all other repositories - Update shared workflows - Update checkout action Signed-off-by: Dan Webb --------- Signed-off-by: Dan Webb --- .../workflows/{test-kitchen.yml => ci.yml} | 6 +++--- .github/workflows/md-links.yml | 19 ------------------- 2 files changed, 3 insertions(+), 22 deletions(-) rename .github/workflows/{test-kitchen.yml => ci.yml} (92%) delete mode 100644 .github/workflows/md-links.yml diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/ci.yml similarity index 92% rename from .github/workflows/test-kitchen.yml rename to .github/workflows/ci.yml index 29cdac56..b414de12 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ name: "Test" jobs: lint-unit: - uses: sous-chefs/.github/.github/workflows/lint-unit.yml@2.0.6 + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@3.0.0 permissions: actions: write checks: write @@ -55,7 +55,7 @@ jobs: fail-fast: false steps: - name: Check out code - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@v4 - name: Install Chef uses: actionshub/chef-install@2.0.4 - name: Dokken @@ -72,7 +72,7 @@ jobs: runs-on: macos-latest steps: - name: Check out code - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + uses: actions/checkout@v4 - name: Install Chef uses: actionshub/chef-install@2.0.4 - name: Kitchen Converge diff --git a/.github/workflows/md-links.yml b/.github/workflows/md-links.yml deleted file mode 100644 index abdae233..00000000 --- a/.github/workflows/md-links.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: md-links - -"on": - pull_request: - push: - branches: [main] - -jobs: - md-links: - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 - - name: markdown-link-check - uses: gaurav-nelson/github-action-markdown-link-check@1.0.15 - with: - use-verbose-mode: "yes" - folder-path: "documentation" From 16c73bbbe1e15d023af5fc0982b902cdaf7712dd Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 1 Nov 2023 14:23:27 +0000 Subject: [PATCH 115/188] Standardise files with files in sous-chefs/repo-management (#707) Signed-off-by: kitchen-porter --- CHANGELOG.md | 2 ++ renovate.json | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index baad3e85..39cec7d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +Standardise files with files in sous-chefs/repo-management + ## 11.2.2 - *2023-09-28* ## 11.2.1 - *2023-09-12* diff --git a/renovate.json b/renovate.json index 7e7a8bad..a0b29c85 100644 --- a/renovate.json +++ b/renovate.json @@ -1,9 +1,10 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["config:base"], - "packageRules": [{ + "packageRules": [ + { "groupName": "Actions", - "matchUpdateTypes": ["patch", "pin", "digest"], + "matchUpdateTypes": ["minor", "patch", "pin"], "automerge": true, "addLabels": ["Release: Patch", "Skip: Announcements"] }, From cf0d6f61650fcb739f95d5625d566778e850490e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytautas=20Stankevi=C4=8Dius?= Date: Tue, 16 Jan 2024 11:34:54 +0200 Subject: [PATCH 116/188] [GH-711] Fix openjdk_pkg_install to obey pkg_version property for all pkg_names (#712) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://github.com/sous-chefs/java/issues/711 Signed-off-by: Vytautas Stankevičius --- CHANGELOG.md | 2 +- resources/openjdk_pkg_install.rb | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39cec7d4..a6bed755 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased -Standardise files with files in sous-chefs/repo-management +- Fix `openjdk_pkg_install` to obey `pkg_version` property for all `pkg_names` ## 11.2.2 - *2023-09-28* diff --git a/resources/openjdk_pkg_install.rb b/resources/openjdk_pkg_install.rb index 7e2f7725..8c191320 100644 --- a/resources/openjdk_pkg_install.rb +++ b/resources/openjdk_pkg_install.rb @@ -31,8 +31,15 @@ end end + pkg_version = + if new_resource.pkg_version && new_resource.pkg_names.is_a?(String) + version new_resource.pkg_version + elsif new_resource.pkg_version && new_resource.pkg_names.is_a?(Array) + Array.new(new_resource.pkg_names.size, new_resource.pkg_version) + end + package new_resource.pkg_names do - version new_resource.pkg_version if new_resource.pkg_version + version pkg_version if pkg_version end node.default['java']['java_home'] = new_resource.java_home From 1a264b0053cd414c3b6751a6bb5d4a93a9548ed9 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 16 Jan 2024 09:34:59 +0000 Subject: [PATCH 117/188] Update changelog for 12.0.2 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6bed755..0d3f3351 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 12.0.2 - *2024-01-16* - Fix `openjdk_pkg_install` to obey `pkg_version` property for all `pkg_names` From 1825684ba15b45c2a713ed552200ed451b03bf56 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 16 Jan 2024 09:34:59 +0000 Subject: [PATCH 118/188] Update metadata for 12.0.2 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 8b95f751..52c408e1 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '12.0.1' +version '12.0.2' supports 'debian' supports 'ubuntu' From 5036bc7404bfd32057a0942ebe1bab1e35a38156 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 16 Jan 2024 09:35:03 +0000 Subject: [PATCH 119/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d3f3351..e57bf2c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 12.0.2 - *2024-01-16* - Fix `openjdk_pkg_install` to obey `pkg_version` property for all `pkg_names` From bb543e4183e530a34bbfbe2c2b30cdb8d2a12f9b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 16 Jan 2024 09:37:52 +0000 Subject: [PATCH 120/188] chore(deps): update actions/stale action to v9 (#710) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 4bb59c62..d4dae8fc 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -8,7 +8,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v8 + - uses: actions/stale@v9 with: repo-token: ${{ secrets.GITHUB_TOKEN }} close-issue-message: > From 7f69dab4390ee20277db3761edc484a43a43f797 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 16 Jan 2024 09:37:56 +0000 Subject: [PATCH 121/188] Update changelog for 12.0.3 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e57bf2c4..43e17ca5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 12.0.3 - *2024-01-16* ## 12.0.2 - *2024-01-16* From 56474a6e7d7745b3c3e6314fdc45a077edcfcdcf Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 16 Jan 2024 09:37:57 +0000 Subject: [PATCH 122/188] Update metadata for 12.0.3 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 52c408e1..5f92a6c8 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '12.0.2' +version '12.0.3' supports 'debian' supports 'ubuntu' From 8722a2f7e1270542fa5df10820340afe40232829 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 16 Jan 2024 09:38:00 +0000 Subject: [PATCH 123/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43e17ca5..abd574a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 12.0.3 - *2024-01-16* ## 12.0.2 - *2024-01-16* From 0a77e81da4441e640e949748d1d68dae8a7c28cd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 3 May 2024 14:25:21 -0500 Subject: [PATCH 124/188] chore(deps): update actions to v3 (#714) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b414de12..17996742 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,9 +57,9 @@ jobs: - name: Check out code uses: actions/checkout@v4 - name: Install Chef - uses: actionshub/chef-install@2.0.4 + uses: actionshub/chef-install@3.0.0 - name: Dokken - uses: actionshub/test-kitchen@2.1.0 + uses: actionshub/test-kitchen@3.0.0 env: CHEF_LICENSE: accept-no-persist KITCHEN_LOCAL_YAML: kitchen.dokken.yml @@ -74,9 +74,9 @@ jobs: - name: Check out code uses: actions/checkout@v4 - name: Install Chef - uses: actionshub/chef-install@2.0.4 + uses: actionshub/chef-install@3.0.0 - name: Kitchen Converge - uses: actionshub/test-kitchen@2.1.0 + uses: actionshub/test-kitchen@3.0.0 env: CHEF_LICENSE: accept-no-persist KITCHEN_LOCAL_YAML: kitchen.macos.yml @@ -93,7 +93,7 @@ jobs: # Magic line for github actions to persist the change echo "JAVA_HOME=${JAVA_HOME}" >> $GITHUB_ENV - name: Kitchen Verify - uses: actionshub/test-kitchen@2.1.0 + uses: actionshub/test-kitchen@3.0.0 env: CHEF_LICENSE: accept-no-persist KITCHEN_LOCAL_YAML: kitchen.macos.yml From caa7647be1eadcd3032ea940599701ee75fd5e95 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Fri, 3 May 2024 20:25:26 +0100 Subject: [PATCH 125/188] Update changelog for 12.0.4 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abd574a3..f53cbdb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 12.0.4 - *2024-05-03* ## 12.0.3 - *2024-01-16* From a924871a543cc73854bc28dc047393f8fea6c886 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Fri, 3 May 2024 20:25:27 +0100 Subject: [PATCH 126/188] Update metadata for 12.0.4 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 5f92a6c8..f0c5d9ca 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '12.0.3' +version '12.0.4' supports 'debian' supports 'ubuntu' From 62605821cb4ed23208ad4a04d466dbef440752a0 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Fri, 3 May 2024 20:25:30 +0100 Subject: [PATCH 127/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f53cbdb3..390e8efc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 12.0.4 - *2024-05-03* ## 12.0.3 - *2024-01-16* From 4ff6450cc6b8d29d4d752cd43933af57c77557de Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 3 May 2024 14:26:08 -0500 Subject: [PATCH 128/188] chore(deps): update sous-chefs/.github action to v3.1.1 (#713) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17996742..1fd3faee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ name: "Test" jobs: lint-unit: - uses: sous-chefs/.github/.github/workflows/lint-unit.yml@3.0.0 + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@3.1.1 permissions: actions: write checks: write From 2742fee9a78849dac73081d6a18a6e994e24c882 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Fri, 3 May 2024 20:26:12 +0100 Subject: [PATCH 129/188] Update changelog for 12.0.5 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 390e8efc..a0f9f23b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 12.0.5 - *2024-05-03* ## 12.0.4 - *2024-05-03* From b27be4bd0273008d1a35a4215058b33276057f19 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Fri, 3 May 2024 20:26:13 +0100 Subject: [PATCH 130/188] Update metadata for 12.0.5 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index f0c5d9ca..16f3e2e1 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '12.0.4' +version '12.0.5' supports 'debian' supports 'ubuntu' From 26b51fc20af58cf58bdff0211991913612033ca9 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Fri, 3 May 2024 20:26:16 +0100 Subject: [PATCH 131/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0f9f23b..fbac21d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 12.0.5 - *2024-05-03* ## 12.0.4 - *2024-05-03* From 6f2bcdd3ddfb8a18f2e8eb3fcb92cfbd894ad53d Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 22 May 2024 10:14:49 +0100 Subject: [PATCH 132/188] Standardise files with files in sous-chefs/repo-management (#716) Signed-off-by: kitchen-porter --- .envrc | 1 + CHANGELOG.md | 2 ++ CONTRIBUTING.md | 2 +- TESTING.md | 2 +- kitchen.dokken.yml | 29 ++--------------------------- kitchen.global.yml | 6 +----- 6 files changed, 8 insertions(+), 34 deletions(-) diff --git a/.envrc b/.envrc index 6ed589ea..484ad266 100644 --- a/.envrc +++ b/.envrc @@ -1 +1,2 @@ use chefworkstation +export KITCHEN_GLOBAL_YAML=kitchen.global.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index fbac21d5..6a43e5b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +Standardise files with files in sous-chefs/repo-management + ## 12.0.5 - *2024-05-03* ## 12.0.4 - *2024-05-03* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a946aea1..c76e180f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ # Contributing Please refer to -[https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD) +[https://github.com/chef-cookbooks/community_cookbook_documentation/blob/main/CONTRIBUTING.MD](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/main/CONTRIBUTING.MD) diff --git a/TESTING.md b/TESTING.md index 920e381f..5a7d0019 100644 --- a/TESTING.md +++ b/TESTING.md @@ -1,3 +1,3 @@ # Testing -Please refer to [the community cookbook documentation on testing](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/TESTING.MD). +Please refer to [the community cookbook documentation on testing](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/main/TESTING.MD). diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index 47eff95d..1dfe62c8 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -22,11 +22,6 @@ platforms: image: dokken/amazonlinux-2023 pid_one_command: /usr/lib/systemd/systemd - - name: centos-7 - driver: - image: dokken/centos-7 - pid_one_command: /usr/lib/systemd/systemd - - name: centos-stream-8 driver: image: dokken/centos-stream-8 @@ -37,16 +32,6 @@ platforms: image: dokken/centos-stream-9 pid_one_command: /usr/lib/systemd/systemd - - name: debian-9 - driver: - image: dokken/debian-9 - pid_one_command: /bin/systemd - - - name: debian-10 - driver: - image: dokken/debian-10 - pid_one_command: /bin/systemd - - name: debian-11 driver: image: dokken/debian-11 @@ -67,11 +52,6 @@ platforms: image: dokken/opensuse-leap-15 pid_one_command: /usr/lib/systemd/systemd - - name: oraclelinux-7 - driver: - image: dokken/oraclelinux-7 - pid_one_command: /usr/lib/systemd/systemd - - name: oraclelinux-8 driver: image: dokken/oraclelinux-8 @@ -92,11 +72,6 @@ platforms: image: dokken/rockylinux-9 pid_one_command: /usr/lib/systemd/systemd - - name: ubuntu-18.04 - driver: - image: dokken/ubuntu-18.04 - pid_one_command: /bin/systemd - - name: ubuntu-20.04 driver: image: dokken/ubuntu-20.04 @@ -107,7 +82,7 @@ platforms: image: dokken/ubuntu-22.04 pid_one_command: /bin/systemd - - name: ubuntu-23.04 + - name: ubuntu-24.04 driver: - image: dokken/ubuntu-23.04 + image: dokken/ubuntu-24.04 pid_one_command: /bin/systemd diff --git a/kitchen.global.yml b/kitchen.global.yml index a382fcd0..3967ff51 100644 --- a/kitchen.global.yml +++ b/kitchen.global.yml @@ -18,16 +18,12 @@ platforms: - name: almalinux-8 - name: almalinux-9 - name: amazonlinux-2023 - - name: centos-7 - name: centos-stream-8 - name: centos-stream-9 - - name: debian-9 - - name: debian-10 - name: debian-11 - name: debian-12 - name: fedora-latest - name: opensuse-leap-15 - - name: oraclelinux-7 - name: oraclelinux-8 - name: oraclelinux-9 - name: rockylinux-8 @@ -35,4 +31,4 @@ platforms: - name: ubuntu-18.04 - name: ubuntu-20.04 - name: ubuntu-22.04 - - name: ubuntu-23.04 + - name: ubuntu-24.04 From edd90c39ef42f6d7b1f266936534d4c12a38608f Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Thu, 23 May 2024 22:27:26 +0100 Subject: [PATCH 133/188] Standardise files with files in sous-chefs/repo-management (#717) Signed-off-by: kitchen-porter --- CHANGELOG.md | 2 ++ kitchen.global.yml | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a43e5b4..d33243fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ This file is used to list changes made in each version of the Java cookbook. Standardise files with files in sous-chefs/repo-management +Standardise files with files in sous-chefs/repo-management + ## 12.0.5 - *2024-05-03* ## 12.0.4 - *2024-05-03* diff --git a/kitchen.global.yml b/kitchen.global.yml index 3967ff51..4396f11e 100644 --- a/kitchen.global.yml +++ b/kitchen.global.yml @@ -28,7 +28,6 @@ platforms: - name: oraclelinux-9 - name: rockylinux-8 - name: rockylinux-9 - - name: ubuntu-18.04 - name: ubuntu-20.04 - name: ubuntu-22.04 - name: ubuntu-24.04 From d9533a57b02dcfde3e5021804955f23d77096584 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 16 Jul 2024 01:30:45 +0800 Subject: [PATCH 134/188] Automated PR: Standardising Files (#718) * Standardise files with files in sous-chefs/repo-management Signed-off-by: kitchen-porter * Update openjdk_install.md --------- Signed-off-by: kitchen-porter Co-authored-by: Corey Hemminger --- CHANGELOG.md | 2 ++ documentation/resources/openjdk_install.md | 26 +++++++++++----------- kitchen.dokken.yml | 5 ----- kitchen.global.yml | 1 - 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d33243fa..8ab09cfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ Standardise files with files in sous-chefs/repo-management Standardise files with files in sous-chefs/repo-management +Standardise files with files in sous-chefs/repo-management + ## 12.0.5 - *2024-05-03* ## 12.0.4 - *2024-05-03* diff --git a/documentation/resources/openjdk_install.md b/documentation/resources/openjdk_install.md index 1ca8903f..afe02fcb 100644 --- a/documentation/resources/openjdk_install.md +++ b/documentation/resources/openjdk_install.md @@ -14,19 +14,19 @@ Introduced: v8.0.0 | Name | Type | Default | Description | Allowed values | | --------------------- | --------------- | ------- | --------------------------------------------------- | ------------------ | -| version | String | | Java version to install | -| url | String | | The URL to download from | -| checksum | String | | The checksum for the downloaded file | -| java_home | String | | Set to override the java_home | -| java_home_mode | Integer, String | | The permission for the Java home directory | -| java_home_owner | String | | Owner of the Java Home | -| java_home_group | String | | Group for the Java Home | -| default | Boolean | | Whether to set this as the defalut Java | -| bin_cmds | Array | | A list of bin_cmds based on the version and variant | -| alternatives_priority | Integer | | Alternatives priority to set for this Java | -| reset_alternatives | Boolean | | Whether to reset alternatives before setting | -| pkg_names | Array | | List of packages to install | -| pkg_version | String | | Package version to install | +| version | String | | Java version to install | | +| url | String | | The URL to download from | | +| checksum | String | | The checksum for the downloaded file | | +| java_home | String | | Set to override the java_home | | +| java_home_mode | Integer, String | | The permission for the Java home directory | | +| java_home_owner | String | | Owner of the Java Home | | +| java_home_group | String | | Group for the Java Home | | +| default | Boolean | | Whether to set this as the defalut Java | | +| bin_cmds | Array | | A list of bin_cmds based on the version and variant | | +| alternatives_priority | Integer | | Alternatives priority to set for this Java | | +| reset_alternatives | Boolean | | Whether to reset alternatives before setting | | +| pkg_names | Array | | List of packages to install | | +| pkg_version | String | | Package version to install | | | install_type | String | | Installation type | `package` `source` | ## Examples diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index 1dfe62c8..6ead9e8e 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -22,11 +22,6 @@ platforms: image: dokken/amazonlinux-2023 pid_one_command: /usr/lib/systemd/systemd - - name: centos-stream-8 - driver: - image: dokken/centos-stream-8 - pid_one_command: /usr/lib/systemd/systemd - - name: centos-stream-9 driver: image: dokken/centos-stream-9 diff --git a/kitchen.global.yml b/kitchen.global.yml index 4396f11e..1740e461 100644 --- a/kitchen.global.yml +++ b/kitchen.global.yml @@ -18,7 +18,6 @@ platforms: - name: almalinux-8 - name: almalinux-9 - name: amazonlinux-2023 - - name: centos-stream-8 - name: centos-stream-9 - name: debian-11 - name: debian-12 From b1797f450d075205fcf53f830ad08824425f9c8b Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 16 Jul 2024 01:30:51 +0800 Subject: [PATCH 135/188] Update changelog for 12.0.6 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ab09cfa..27ed33de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 12.0.6 - *2024-07-15* Standardise files with files in sous-chefs/repo-management From 9bfeef05e2a2918d2e8116c6ddac6c99672d181f Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 16 Jul 2024 01:30:52 +0800 Subject: [PATCH 136/188] Update metadata for 12.0.6 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 16f3e2e1..d2a9b475 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '12.0.5' +version '12.0.6' supports 'debian' supports 'ubuntu' From 1c8147d0790efd58b86ed512e19beff6bb93b29f Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 16 Jul 2024 01:30:55 +0800 Subject: [PATCH 137/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27ed33de..e53b2ac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 12.0.6 - *2024-07-15* Standardise files with files in sous-chefs/repo-management From 2c4e04d53c85d5e87278a2330e965f51df8169b4 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 19 Nov 2024 02:29:45 +0800 Subject: [PATCH 138/188] Automated PR: Standardising Files (#719) * Standardise files with files in sous-chefs/repo-management Signed-off-by: kitchen-porter * Standardise files with files in sous-chefs/repo-management Signed-off-by: kitchen-porter --------- Signed-off-by: kitchen-porter --- .markdownlint-cli2.yaml | 2 ++ CHANGELOG.md | 4 ++++ kitchen.dokken.yml | 10 ++++++++++ 3 files changed, 16 insertions(+) diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml index 6fa8e776..0196ac7b 100644 --- a/.markdownlint-cli2.yaml +++ b/.markdownlint-cli2.yaml @@ -3,3 +3,5 @@ config: line-length: false # MD013 no-duplicate-heading: false # MD024 reference-links-images: false # MD052 +ignores: + - .github/copilot-instructions.md diff --git a/CHANGELOG.md b/CHANGELOG.md index e53b2ac7..66f029f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +Standardise files with files in sous-chefs/repo-management + +Standardise files with files in sous-chefs/repo-management + ## 12.0.6 - *2024-07-15* Standardise files with files in sous-chefs/repo-management diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index 6ead9e8e..998bb20c 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -17,6 +17,11 @@ platforms: image: dokken/almalinux-9 pid_one_command: /usr/lib/systemd/systemd + - name: almalinux-10 + driver: + image: dokken/almalinux-10 + pid_one_command: /usr/lib/systemd/systemd + - name: amazonlinux-2023 driver: image: dokken/amazonlinux-2023 @@ -27,6 +32,11 @@ platforms: image: dokken/centos-stream-9 pid_one_command: /usr/lib/systemd/systemd + - name: centos-stream-10 + driver: + image: dokken/centos-stream-10 + pid_one_command: /usr/lib/systemd/systemd + - name: debian-11 driver: image: dokken/debian-11 From 9c3c1bb9450c577e4babb318cd3b3d1a59f7a288 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 19 Nov 2024 02:29:49 +0800 Subject: [PATCH 139/188] Update changelog for 12.0.7 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66f029f6..5336a137 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 12.0.7 - *2024-11-18* Standardise files with files in sous-chefs/repo-management From 7214b0208f4667afadbcfd131a558b59de21d511 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 19 Nov 2024 02:29:50 +0800 Subject: [PATCH 140/188] Update metadata for 12.0.7 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index d2a9b475..f0a5e8dc 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '12.0.6' +version '12.0.7' supports 'debian' supports 'ubuntu' From 2989ee626303b1d48b175936171f9c6a16012287 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Tue, 19 Nov 2024 02:29:53 +0800 Subject: [PATCH 141/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5336a137..c50f0ff6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 12.0.7 - *2024-11-18* Standardise files with files in sous-chefs/repo-management From 5bfb37c0f162b8ce8bd8d9f56e3c721b7755283d Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Tue, 3 Dec 2024 13:11:42 -0800 Subject: [PATCH 142/188] Add support for OpenJDK versions 19, 20, 21 and 22 (#715) * Add support for OpenJDK versions 19, 20, 21 and 22 * Remove the commented-out adoptopenjdk_linux_install resource. * chore(deps): update sous-chefs/.github action to v3.1.0 * chore(deps): update actionshub/chef-install action to v3 * Doc fixes * Cleanup changelog * Update platforms * Remove AdoptOpenJDK * Remove MacOS suite --------- Signed-off-by: Lance Albertson Signed-off-by: Dan Webb Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Dan Webb --- .github/workflows/ci.yml | 70 +-- .rubocop.yml | 2 + CHANGELOG.md | 450 ++---------------- README.md | 1 - .../resources/adoptopenjdk_install.md | 58 --- .../resources/adoptopenjdk_linux_install.md | 53 --- .../resources/adoptopenjdk_macos_install.md | 65 --- kitchen.macos.local.yml | 8 +- kitchen.macos.yml | 11 +- kitchen.yml | 168 +------ libraries/adopt_openjdk_macos_helpers.rb | 19 - libraries/openjdk_helpers.rb | 2 +- resources/adoptopenjdk_install.rb | 80 ---- resources/adoptopenjdk_linux_install.rb | 45 -- resources/adoptopenjdk_macos_install.rb | 71 --- spec/spec_helper.rb | 1 - .../cookbooks/test/recipes/custom_package.rb | 7 - .../recipes/remove-adoptopenjdk-11-openj9.rb | 8 - .../controls/verify_adoptopenjdk.rb | 78 --- .../inputs/adoptopenjdk-11-hotspot.yml | 4 - .../adoptopenjdk-11-openj9-large-heap.yml | 4 - .../inputs/adoptopenjdk-11-openj9.yml | 4 - .../inputs/adoptopenjdk-14-hotspot.yml | 4 - .../inputs/adoptopenjdk-14-macos.yml | 4 - .../adoptopenjdk-14-openj9-large-heap.yml | 4 - .../inputs/adoptopenjdk-14-openj9.yml | 4 - .../inputs/adoptopenjdk-8-hotspot.yml | 4 - .../adoptopenjdk-8-openj9-large-heap.yml | 4 - .../inputs/adoptopenjdk-8-openj9.yml | 4 - test/integration/adoptopenjdk/inspec.yml | 7 - .../controls/verify_adoptopenjdk-removal.rb | 35 -- .../remove-adoptopenjdk/inspec.yml | 7 - 32 files changed, 97 insertions(+), 1189 deletions(-) create mode 100644 .rubocop.yml delete mode 100644 documentation/resources/adoptopenjdk_install.md delete mode 100644 documentation/resources/adoptopenjdk_linux_install.md delete mode 100644 documentation/resources/adoptopenjdk_macos_install.md delete mode 100644 libraries/adopt_openjdk_macos_helpers.rb delete mode 100644 resources/adoptopenjdk_install.rb delete mode 100644 resources/adoptopenjdk_linux_install.rb delete mode 100644 resources/adoptopenjdk_macos_install.rb delete mode 100644 test/fixtures/cookbooks/test/recipes/custom_package.rb delete mode 100644 test/fixtures/cookbooks/test/recipes/remove-adoptopenjdk-11-openj9.rb delete mode 100644 test/integration/adoptopenjdk/controls/verify_adoptopenjdk.rb delete mode 100644 test/integration/adoptopenjdk/inputs/adoptopenjdk-11-hotspot.yml delete mode 100644 test/integration/adoptopenjdk/inputs/adoptopenjdk-11-openj9-large-heap.yml delete mode 100644 test/integration/adoptopenjdk/inputs/adoptopenjdk-11-openj9.yml delete mode 100644 test/integration/adoptopenjdk/inputs/adoptopenjdk-14-hotspot.yml delete mode 100644 test/integration/adoptopenjdk/inputs/adoptopenjdk-14-macos.yml delete mode 100644 test/integration/adoptopenjdk/inputs/adoptopenjdk-14-openj9-large-heap.yml delete mode 100644 test/integration/adoptopenjdk/inputs/adoptopenjdk-14-openj9.yml delete mode 100644 test/integration/adoptopenjdk/inputs/adoptopenjdk-8-hotspot.yml delete mode 100644 test/integration/adoptopenjdk/inputs/adoptopenjdk-8-openj9-large-heap.yml delete mode 100644 test/integration/adoptopenjdk/inputs/adoptopenjdk-8-openj9.yml delete mode 100644 test/integration/adoptopenjdk/inspec.yml delete mode 100644 test/integration/remove-adoptopenjdk/controls/verify_adoptopenjdk-removal.rb delete mode 100644 test/integration/remove-adoptopenjdk/inspec.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fd3faee..3d03247f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,36 +22,25 @@ jobs: strategy: matrix: os: - - almalinux-8 - - amazonlinux-2 - - debian-10 + - amazonlinux-2023 + - debian-12 - debian-11 - - centos-7 - - centos-stream-8 - - ubuntu-1804 - - ubuntu-2004 - - ubuntu-2204 + - rockylinux-9 - rockylinux-8 + - ubuntu-2204 + - ubuntu-2004 suite: - - openjdk-11 + # - openjdk-11 # Debian doesn't have an 11 package - openjdk-16 - openjdk-17 - - adoptopenjdk-8-openj9 - - adoptopenjdk-11-hotspot - - adoptopenjdk-11-openj9 - - adoptopenjdk-11-openj9-large-heap - - adoptopenjdk-14-hotspot - - adoptopenjdk-14-openj9 - - adoptopenjdk-14-openj9-large-heap - - adoptopenjdk-removal-11-openj9 + # - temurin-8-hotspot + # - temurin-11-hotspot + # - semeru-11-openj9 + # - semeru-17-openj9 - corretto-8 - corretto-11 - corretto-17 - corretto-18 - - custom-package-8 - - custom-package-11 - - custom-package-11-openj9 - - custom-package-11-openj9-large-heap fail-fast: false steps: - name: Check out code @@ -67,45 +56,8 @@ jobs: suite: ${{ matrix.suite }} os: ${{ matrix.os }} - integration-macos: - needs: "lint-unit" - runs-on: macos-latest - steps: - - name: Check out code - uses: actions/checkout@v4 - - name: Install Chef - uses: actionshub/chef-install@3.0.0 - - name: Kitchen Converge - uses: actionshub/test-kitchen@3.0.0 - env: - CHEF_LICENSE: accept-no-persist - KITCHEN_LOCAL_YAML: kitchen.macos.yml - TERM: xterm-256color - with: - suite: adoptopenjdk-14 - os: macos - action: converge - - name: Source Profile for JAVA_HOME - run: | - source /etc/profile - echo "sourced profile for JAVA_HOME" - echo "New JAVA home after Chef run is: ${JAVA_HOME}" - # Magic line for github actions to persist the change - echo "JAVA_HOME=${JAVA_HOME}" >> $GITHUB_ENV - - name: Kitchen Verify - uses: actionshub/test-kitchen@3.0.0 - env: - CHEF_LICENSE: accept-no-persist - KITCHEN_LOCAL_YAML: kitchen.macos.yml - TERM: xterm-256color - with: - suite: adoptopenjdk-14 - os: macos - action: verify - final: runs-on: ubuntu-latest - needs: [integration, integration-macos] + needs: [integration] steps: - run: echo ${{needs.integration.outputs}} - - run: echo ${{needs.integration-macos.outputs}} diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 00000000..61883002 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,2 @@ +require: + - cookstyle diff --git a/CHANGELOG.md b/CHANGELOG.md index c50f0ff6..ef8067e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,83 +4,32 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased -## 12.0.7 - *2024-11-18* +- Add support for OpenJDK versions 19, 20, 21 and 22 +- Remove commented out `adoptopenjdk_linux_install` resource +- CI: chore(deps): update sous-chefs/.github action to v3.1.0 +- CI: chore(deps): update actionshub/chef-install action to v3 +- Update platforms +- Replace AdoptOpenJDK with Eclipse Temurin and IBM Semeru -Standardise files with files in sous-chefs/repo-management +## 12.0.7 - *2024-11-18* -Standardise files with files in sous-chefs/repo-management +- Standardise files with files in sous-chefs/repo-management ## 12.0.6 - *2024-07-15* -Standardise files with files in sous-chefs/repo-management - -Standardise files with files in sous-chefs/repo-management - -Standardise files with files in sous-chefs/repo-management - -## 12.0.5 - *2024-05-03* - -## 12.0.4 - *2024-05-03* - -## 12.0.3 - *2024-01-16* +- Standardise files with files in sous-chefs/repo-management ## 12.0.2 - *2024-01-16* - Fix `openjdk_pkg_install` to obey `pkg_version` property for all `pkg_names` -## 11.2.2 - *2023-09-28* - -## 11.2.1 - *2023-09-12* - ## 11.2.0 - *2023-09-12* -## 11.1.14 - *2023-09-04* - -## 11.1.13 - *2023-07-10* - -## 11.1.12 - *2023-05-16* - -## 11.1.11 - *2023-04-17* - -Standardise files with files in sous-chefs/repo-management - -## 11.1.10 - *2023-04-07* - -Standardise files with files in sous-chefs/repo-management - -## 11.1.9 - *2023-04-01* - -Standardise files with files in sous-chefs/repo-management - -## 11.1.8 - *2023-04-01* - -Standardise files with files in sous-chefs/repo-management - -## 11.1.7 - *2023-04-01* - -Standardise files with files in sous-chefs/repo-management - -## 11.1.6 - *2023-03-02* - -Standardise files with files in sous-chefs/repo-management - -## 11.1.5 - *2023-02-20* - -Standardise files with files in sous-chefs/repo-management - -## 11.1.4 - *2023-02-15* - -Standardise files with files in sous-chefs/repo-management - -## 11.1.3 - *2023-02-14* - -Standardise files with files in sous-chefs/repo-management - -## 11.1.2 - *2023-02-14* +- Standardise files with files in sous-chefs/repo-management -## 11.1.1 - *2022-12-08* +## 11.1.0 - *2023-04-17* -Standardise files with files in sous-chefs/repo-management +- Standardise files with files in sous-chefs/repo-management ## 11.1.0 - *2022-04-26* @@ -88,39 +37,16 @@ Standardise files with files in sous-chefs/repo-management - Add Corretto 17 and 18 - Change the defualt download URL for Corretto to the versioned resources URL, rather than latest. -## 11.0.2 - *2022-04-20* - -- Standardise files with files in sous-chefs/repo-management - -## 11.0.1 - *2022-02-16* - -- Elevate permissions for reuable workflow - ## 11.0.0 - *2022-02-16* - Require Chef 16 for resource partials - Add resource partials for: MacOS, Linux, Java Home and Common as these are used in a multiple places -## 10.2.2 - *2022-02-14* - -- Standardise files with files in sous-chefs/repo-management - -## 10.2.1 - *2022-02-02* - -- Standardise files with files in sous-chefs/repo-management - ## 10.2.0 - *2022-01-26* - Remove tap_full option as this is no longer supported and there is no replacement - -## 10.1.2 - *2022-01-26* - - Remove delivery and move to calling RSpec directly via a reusable workflow -## 10.1.1 - *2021-10-19* - -Standardise files with files in sous-chefs/repo-management - ## 10.1.0 - *2021-10-06* - Revert worklfow split out @@ -131,37 +57,19 @@ Standardise files with files in sous-chefs/repo-management - Remove testing for end of life OpenJDK suites - Primarily support OpenJDK LTS versions 11, 17 - Drop support for OpenJDK package installs for non-LTS versions - - These packages are still possible to install though they will now default to a source install - Direct Amazon users to Amazon Corretto instead of installing OpenJDK -- Drop package install support for Java 8. Most supported operating systems no longer support OpenJDK 8 - - To install OpenJDK 8, a 'source' install from an internal mirror is now recommended - -## 10.0.1 - *2021-09-21* - -- Split out workflows to allow standardfiles to control markdown, yaml and delivery -- Adds a "Final" workflow to set a known pass/failure hook - - This allows us to have Terraform set the Final workflow as a required check +- Drop package install support for Java 8 ## 10.0.0 - *2021-09-02* - Remove recipes to stop confusing users -## 9.0.1 - *2021-08-30* - -- Standardise files with files in sous-chefs/repo-management - ## 9.0.0 - *2021-06-04* -- Remove Corretto checksum code defualts as this changes reguarly, - and is not provide in the SHA256 format via an API +- Remove Corretto checksum code defaults as this changes regularly, and is not provided in the SHA256 format via an API - Set unified_mode to true for Chef 17 support - Bump the minimum Chef version to 15.3 for unified_mode support -## 8.6.1 - *2021-06-01* - ## 8.6.0 - *2021-01-22* - Added Amazon Corretto 15 support to `corretto_install` @@ -170,56 +78,33 @@ Standardise files with files in sous-chefs/repo-management ## 8.5.0 - *2020-12-03* -- resolved cookstyle error: spec/spec_helper.rb:4:18 convention: `Style/RedundantFileExtensionInRequire` -- resolved cookstyle error: spec/spec_helper.rb:5:18 convention: `Style/RedundantFileExtensionInRequire` -- resolved cookstyle error: spec/spec_helper.rb:6:18 convention: `Style/RedundantFileExtensionInRequire` -- resolved cookstyle error: spec/spec_helper.rb:7:18 convention: `Style/RedundantFileExtensionInRequire` - If installation issues with `openjdk_install` resource (fixes #645) - Remove testing of Amazon Linux 1 - Use fedora-latest -## 8.4.0 (2020-09-09) +## 8.4.0 - *2020-09-09* - Add `starttls` property to `java_certificate` resource to allow fetching certificates from non HTTPS endpoints -## 8.3.2 (2020-08-20) +## 8.3.2 - *2020-08-20* - Add aarch64 installation candidate for Corretto -## 8.3.1 (2020-08-06) +## 8.3.1 - *2020-08-06* - Extract correct JAVA_HOME from custom URLs -## 8.3.0 (2020-06-18) +## 8.3.0 - *2020-06-18* - Restore compatibility with Chef Infra Client < 16 - Update Fedora releases in the Kitchen configs -## 8.2.1 (2020-06-02) +## 8.2.0 - *2020-06-02* - resolved cookstyle error: resources/adoptopenjdk_install.rb:1:1 warning: `ChefDeprecations/ResourceUsesOnlyResourceName` -- resolved cookstyle error: resources/adoptopenjdk_linux_install.rb:1:1 warning: `ChefDeprecations/ResourceUsesOnlyResourceName` -- resolved cookstyle error: resources/adoptopenjdk_macos_install.rb:1:1 warning: `ChefDeprecations/ResourceUsesOnlyResourceName` -- resolved cookstyle error: resources/corretto_install.rb:1:1 warning: `ChefDeprecations/ResourceUsesOnlyResourceName` -- resolved cookstyle error: resources/openjdk_install.rb:1:1 warning: `ChefDeprecations/ResourceUsesOnlyResourceName` -- resolved cookstyle error: resources/openjdk_pkg_install.rb:1:1 warning: `ChefDeprecations/ResourceUsesOnlyResourceName` -- resolved cookstyle error: resources/openjdk_source_install.rb:1:1 warning: `ChefDeprecations/ResourceUsesOnlyResourceName` - -## 8.2.0 (2020-05-22) - -- Fixed java_certificate resource :remove bugs preventing removal - -## 8.1.2 (2020-04-20) +- Remove testing of Ubuntu 14.04, support at this point is no longer guaranteed -- Add OpenJDK source install resource -- Add documentation for openjdk_source_install -- Default the openjdk_install resource to install using the package manager by default - -## 8.1.1 (2020-04-19) - -- Fix JAVA_HOME for `adoptopenjdk_linux_install` resource - -## 8.1.0 (2020-04-19) +## 8.1.0 - *2020-04-19* - Added `openjdk_pkg_install` resource - Added documentation for openjdk_pkg_install @@ -232,11 +117,7 @@ Standardise files with files in sous-chefs/repo-management - Resolved cookstyle error: resources/alternatives.rb:75:11 refactor: `ChefCorrectness/ChefApplicationFatal` - Resolved cookstyle error: resources/jce.rb:51:6 refactor: `ChefStyle/UnnecessaryOSCheck` -## 8.0.1 (2020-03-30) - -- Added documentation in documentation/resources for `adoptopenjdk_install`, `alternatives`, `certificate`, `corretto_install`, `jce`, `openjdk_install` - -## 8.0.0 (2020-03-30) +## 8.0.0 - *2020-03-30* - Added `openjdk_install` resource & documentation - Removed openjdk, corretto, default_java_symlink, ibm & ibm_tar, notify & oracle recipes @@ -244,7 +125,7 @@ Standardise files with files in sous-chefs/repo-management - Temporarily removed support for Windows - Split out helpers for each provider into their own namespace and file -## 7.0.0 (2020-03-05) +## 7.0.0 - *2020-03-05* - Refactored and sped up unit tests. - Added `adoptopenjdk_install` resource & documentation @@ -253,11 +134,11 @@ Standardise files with files in sous-chefs/repo-management - Increased the minimum Chef requirement to Chef 15 to use the archive resource. - Removed AdoptOpenJDK 10 testing -## 6.0.0 (2020-03-02) +## 6.0.0 - *2020-03-02* - The resource alias `java_ark` has been deprecated in favour of `java_oracle_install` -## 5.0.0 (2020-02-21) +## 5.0.0 - *2020-02-21* - Fixed java_certificate regex where it checks if cert exists in cacert file. - Make Homebrew Cask name an attribute to allow for other options (ex: adoptopenjdk) @@ -271,22 +152,22 @@ Standardise files with files in sous-chefs/repo-management - Removes openjdk-direct for Debian 8 - Removes oracle variants from test configurations -## 4.3.0 (2019-08-04) +## 4.3.0 - *2019-08-04* - Upgrade Amazon Corretto to the latest versions: 8.222.10.1 and 11.0.4.11.1 - Upgrade circleci orb to version 2 and add yamllint and markdown lint -## 4.2.0 - (2019-07-15) +## 4.2.0 - *2019-07-15* - Fix for issue 538 - Added "download_path" node attribute defaulting to file_cache_path - Replaced all hardcoded instances of file_cache_path with the node attribute -## 4.1.0 - (2019-05-08) +## 4.1.0 - *2019-05-08* - Added new install flavor "corretto" for Amazon's Corretto distribution of OpenJDK -## 4.0.0 - (2019-04-19) +## 4.0.0 - *2019-04-19* - Added new install flavor "adoptopenjdk" for AdoptOpenJDK's distribution of Java - The certificate resource now uses the Java version to determine the default cacerts location @@ -298,27 +179,27 @@ Standardise files with files in sous-chefs/repo-management - Fixed oracle download link for JDK 8 (update to 8u202 from 8u201) - fixed specs for windows -## 3.2.0 - (2019-01-24) +## 3.2.0 - *2019-01-24* - Add support OpenJDK 11 - Fixed oracle download link again -## 3.1.2 - (2018-12-11) +## 3.1.2 - *2018-12-11* - Set java home on macosx using /usr/libexec/java_home - Find command should have ./ for path to search, works for nix and mac - Make `java_certificate` work with SNI endpoints -## 3.1.1 - (2018-11-09) +## 3.1.1 - *2018-11-09* - Fix jce installation linux - Allow overwrite `returns` property of windows_packages -## 3.1.0 - (2018-10-18) +## 3.1.0 - *2018-10-18* - Add support for JDK 11 -## 3.0.0 - (2018-10-18) +## 3.0.0 - *2018-10-18* - Fix broken JCE with JRE installations - make cert alias matching case insensitive as `keytool` always returns results downcases @@ -327,17 +208,17 @@ Standardise files with files in sous-chefs/repo-management - fixed `recipes/openjdk` when `node['java']['jdk_version']` by casting it to a string - Updated Oracle Java links to 8u191 -## 2.2.1 - (2018-09-29) +## 2.2.1 - *2018-09-29* - Allows for additional Oracle (post 9) jdk download file naming, including '10.0.2'. '18.9', '11' -## 2.2.0 - (2018-07-19) +## 2.2.0 - *2018-07-19* - Updated Oracle Java links to 8u181 - Fixed incorrect kitchen setup runlists that preventing local testing - Resolve undefined certout errors -## 2.1.0 - (2018-05-25) +## 2.1.0 - *2018-05-25* - Added Java 10 JCE attributes to default attrs - Update oracle recipeM to not perform a switch on java major version and instead use the version provided in attributes. This allows end users to include new Java versions without the cookbook requiring an update each time a major version gets released @@ -346,11 +227,11 @@ Standardise files with files in sous-chefs/repo-management - Fix JCE installation on Windows - Avoid EmptyWindowsCommand error on Windows -## v2.0.1 - (2018-05-02) +## v2.0.1 - *2018-05-02* - Fix java_certificate and java_oracle_install to work on FIPS enabled systems -## v2.0.0 - (2018-05-02) +## v2.0.0 - *2018-05-02* - Converted alternatives, ark, and certificate LWRP/HWRPs to custom resources with improved logging and convergence notification. - Renamed the java_ark resource to java_oracle_install, which better represents what it does. The existing name will continue to function @@ -363,147 +244,6 @@ Standardise files with files in sous-chefs/repo-management - Moved the warning code for downloading directly from Oracle into the resource to prevent another resource showing as converged - Updated the metadata to resolve failures to parse chef_version on older chef-client releases. - Added installation of tar directly to the ark resource when uncompression .tar.gz files. This prevents installation in the recipe that occurred even if tar wasn't needed. -- Deprecated the java::purge recipe which purged old Sun Java packages which were distributed in distro repos before the Oracle acquisition of Sun. Migration away from these packages occurred many years ago and this recipe will be removed in the next major release of this cookbook. -- Updated the metadata license string to an SPDX compliant string to resolve Foodcritic warnings. -- Removed Chef 10 compatibility code in the Windows recipe that resulted in Foodcritic warnings. -- Removed logic to support paths on Debian < 7 and Ubuntu < 12.04 as these are both EOL. -- Removed duplicate logging in the resources. -- Converted integration tests from bats to InSpec. -- Moved template files out of the default directory as -- Corrected deprecation warnings in the ChefSpecs. -- Moved all Kitchen testing logic to the test_java cookbook and eliminated the need for the apt & free_bsd bash cookbooks in testing -- Don't try to create Chef's cache directory in the certificate resource. -- Disabled certificate integration tests since we're not currently running the certificate resource in Test Kitchen. -- Removed testing of Oracle JDK 6/7 since Oracle no longer allows directly downloading these releases. -- Added kitchen-dokken based testing - -## v1.50.0 - (05/24/2017) - -- Oracle downloads changed again. Only Oracle 8 is able to be downloaded automatically. Please host your own copy internally to avoid issues such as this. -- Add Log warning if download url contains oracle.com - -## v1.49.0 - (04/21/2017) - -- potential 'curl' resource cloning #415 -- Oracle 8u131 -- Add ChefSpec matchers for java_certificate resource -- Remove unnecessary apt update - -## v1.48.0 - (03/31/2017) - -- Update Oracle Java links from 101 to 121 -- Remove convergence report -- Remove Fedora 24 testing -- Fix test cookbook license -- Update platforms in the specs -- Remove testing on EOL platforms - -## v1.47.0 - (01/30/2017) - -- Fix typo in method name (#397) -- Remove useless ruby_block[set-env-java-home] -- Update README: using java::notify -- Add forgotten "do" to README - -## v1.46.0 - (01/09/2017) - -- fix jce installation on windows #386 - -## v1.45.0 - (12/27/2016) - -- Update to resolve latest rubocop rules - -## v1.44.0 - (12/27/2016) - -- Unpublished due to newer rubocop rules in travis -- Added zlinux defaults - -## v1.43.0 - (12/6/2016) - -- Switch recursive chown from executing on the jdk parent directory to executing on the jdk directory itself. -- Added proxy support to curl -- add java_certificate LWRP from java-libraries cookbook - java-libraries now depricated. -- (Windows) support removal of obsolete JREs via optional attribute -- (Windows) Can download from s3 only using an IAM profile -- (Windows) aws session token for windows java download - -## v1.42.0 - (8/8/2016) - -- Use openjdk ppa for all ubuntu versions to allow for older/newer jdks to be installed. Fixes #368 -- update oracle java 8u101 - Use sha256 hash (seems to help with downloading each converge) -- Mac default converge fails since notify is not included by homebrew -- Remove chef 14(!) depreciation warning in tests -- Resolve chef-12 related warning - -## v1.41.0 - (7/15/2016) - -- Feature: Add new resource for cookbooks to subscribe to, see README -- Use a remote_file resource for JCE download instead of curl in an execute block. -- Since v1.40.4 Travis deploys cookbook to supermarket - expect more frequent, smaller releases. - -## v1.40.4 - (7/12/2016) - -- Automated deploy, no cookbook changes. - -## v1.40.3 - (7/12/2016) - -- Attempt to have travis publish this. -- Mac depends on homebrew. -- Fixed typo in platform family spelling for OS X -- fix openjdk version logic for freebsd -- Enable Ark provider to handle URI with get parameters - -## v1.40.1 - (7/8/2016) - -- Fixed: JAVA_HOME not set on systems with restrictive umask #359 - -## v1.40 - (6/29/2016) - -- Travis build green -- Add Windows JCE support -- Changes to prevent re-execution of resource creating file '/etc/profile.d/jdk.sh' -- Fix JDK checksum -- Update ibm_jdk.installer.properties.erb for IBM JDK 1.8 -- Install OpenJDK from distribution if Ubuntu version >= 15.10 -- Fixes #342 - Tar is included in macosx and homebrews package is gnutar which causes this to fail -- Add 12.04 to jdk8 test suite -- Add source and issues urls to supermarket -- Distinguishing the Java version for installing on the Mac OS X -- Doc and cruft cleanup - -## v1.39 - (1/14/2016) - -- Travis debugging only, no code changes. - -## v1.38 - (1/13/2016) - -- (Win) Fix for Java install failing on Windows (introduced in #315) -- Travis fixes/badge - -## v1.37 - (11/9/2015) - -- (Win) Attirbute for specifying the install directory for the public jre #315 - -## v1.36 - (9/3/2015) - -- Oracle JDK 1.8.0_65 -- Add Ubuntu ppa (allows OpenJDK 8) -- Added ChefSpec matchers #284 -- Fix compile error using Chef::Application.fatal #279 -- #222 Provide possibility to set ark download timeout -- Openjdk6 does not exist in deb 8.2 -- Change to create java home dir even if top level doesn't exist(Eg mkdir_p instead of mkdir) -- Fix berks url and remove apt -- Documentation and dependency updates - -## v1.35 - (8/4/2015) - -- Use bento boxes and remove EOL distros from testing suite. -- Update to latest JDKs. Note Oracle JDK7 is now EOL. -- Alternatives improvements -- Fixes #155 to allow install of OpenJDK 1.8 -- Fixes #257 Changed switches for the jdk 8 exe installer on windows -- Make sure tar package installed for java_ark - Add support for Mac OS X "mac_os_x" via homebrew. - Update metadata.rb to contain source and issue information for supermarket and chef-repo convenience @@ -511,14 +251,14 @@ Standardise files with files in sous-chefs/repo-management - Kitchen CI test with 12.04 fails due to hostname unable to be set. -## v1.31 - (2/3/2015) +## v1.31 - *2/3/2015* - Update to latest JDKs for 7 and 8\. JDK7 will be EOL April 2015 - Fix up Travis support. - Add ability to install JCE policy files for oracle JDK #228 - Change connect timeout to 30 seconds -## v1.29.0 - (11/14/2014) +## v1.29.0 - *11/14/2014* - Ensure dirs, links, and jinfo files are owned correctly - Update to Oracle JDK 8u25 @@ -528,23 +268,23 @@ Standardise files with files in sous-chefs/repo-management - Adding ISSUES.md for guidance on creating new issues for the Java cookbook. - Fix IBM unit tests. -## v1.28.0 - (9/6/2014) +## v1.28.0 - *9/6/2014* - Allow setting of group to extracted java files. - Add -no-same-owner parameter to tar extract to avoid issues when the chef cache dir is on an NFS mounted drive. - In the ark provider, it doesn't compare the MD5 sum with the right value which causes Java cookbook always download tarball from oracle server -## v1.27.0 - (8/22/2014) +## v1.27.0 - *8/22/2014* - Update Oracle JDK8 to version 8u20 -## v1.26.0 - (8/16/2014) +## v1.26.0 - *8/16/2014* - Allow pinning of package versions for openjdk - Update Oracle JDK7 to version 7u67 - Support specific version and name for Oracle RPM -## v1.25.0 - (8/1/2014) +## v1.25.0 - *8/1/2014* - Resource ark -> attribute bin_cmds default value - Add option to put JAVA_HOME in /etc/environment @@ -557,7 +297,7 @@ Standardise files with files in sous-chefs/repo-management - rspec cleanup - Adding ubuntu-14.04 to test suite -## v1.24.0 - (7/25/2014) +## v1.24.0 - *7/25/2014* New Cookbook maintainer! **[Agile Orbit](http://agileorbit.com)** @@ -569,10 +309,10 @@ New Cookbook maintainer! **[Agile Orbit](http://agileorbit.com)** - default: don't fail when using java 8 on windows - Support for Server JRE - Updated README for accepting oracle terms --Remove VirtualBox specific box_urls +- Remove VirtualBox specific box_urls - List AgileOrbit as the maintainer (AgileOrbit took over from Socrata in July 2014) -## v1.23.0 - (7/25/2014) +## v1.23.0 - *7/25/2014* - Tagged but never published to community cookbooks. All changes rolled into 1.24.0 @@ -585,104 +325,14 @@ New Cookbook maintainer! **[Agile Orbit](http://agileorbit.com)** ## v1.21.2 -- Update Oracle accept-license-terms cookie format +[COOK-4210] - remove unneeded run_command to prevent zombie processes ## v1.21.0 -- Symlink /usr/lib/jvm/default-java for both OpenJDK and Oracle -- Remove /var/lib/alternatives/#{cmd} before calling alternatives (Hopefully fixes sporadic issues when setting alternatives) -- Make default_java_symlink conditional on set_default attribute +- Update Oracle accept-license-terms cookie format ## v1.20.0 -- Create /usr/lib/jvm/default-java on Debian -- allow wrapping cookbook without providing templates -- Adds set_default attribute to toggle setting JDK as default -- set java_home correctly for oracle_rpm - -## v1.19.2 - -- Upgrade to ChefSpec 3 -- Rewrite unit tests for better coverage and to work with ChefSpec 3 (various commits) -- List Socrata as the maintainer (Socrata took over from Opscode in December 2013) -- Allow jdk_version to be a string or number -- Fix JDK install on Windows -- Fix openjdk_packages on Arch Linux -- - -## v1.19.0 - -Refactor the cookbook to better support wrapper cookbooks and other cookbook authoring patterns. - -- Update documentation & add warning for issue 122 -- Refactor default recipe to better enable wrapper cookbooks -- Removes the attribute to purge deprecated packages -- Add safety check if attributes are unset -- Adds tests for directly using openjdk and oracle recipes -- Adds recipes to README -- The Opscode CCLA is no longer required -- Adds tests for openjdk-7 and oracle-7 -- Use java_home instead of java_location for update-alternatives -- Fix java_home for rhel and fedora - -## v1.18.0 - -- Upgrade to 7u51 -- Suggest windows and aws - -## v1.17.6 - -- Revert **[COOK-4165]** - The headers option was only added to remote_file in Chef 11.6.0, meaning this change breaks older clients. - -## v1.17.4 - -- Fix alternatives for centos - -- Replace curl with remote_file with cookie header -- Update openjdk to use the alternatives resource - -## v1.17.2 - -- Add md5 parameter to java_ark resource - -## v1.17.0 - -- Test Kitchen no longer works after merging Pull Request #95 for openjdk tests on Debian/Ubuntu -- update-alternatives fails to run -- Ensure local directory hierarchy -- Expose LWRP state attributes support for MD5 checksum -- Fixed windows case to prevent bad java_home variable setting -- Update checksums to the officially-published ones -- Further test kitchen fixes - -## v1.16.4 - -- set alternatives when using ibm_tar recipe -- Specify windows attributes in attribute files - -## v1.16.2 - -- set alternatives for ibm jdk -- IBM Java installer needs 'rpm' package on Ubuntu - -- do not unescape the java windows url before parsing it -- fixes update-alternatives for openjdk installs -- Use escaped quotes for Windows INSTALLDIR - -## v1.16.0 - -- Upgrade to JDK 7u45-b18 - -## v1.15.4 - -[COOK-4210] - remove unneeded run_command to prevent zombie processes - -## v1.15.2 - -[CHEF-4210] remove unneeded run_command to prevent zombie processes - -## v1.15.0 - - Fixing version number. Accidently released at 0.15.x instead of 1.15.x ## v0.15.2 diff --git a/README.md b/README.md index cf51517f..1673d7af 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,6 @@ Chef 15.3+ ## Resources - [adoptopenjdk_install](https://github.com/sous-chefs/java/blob/master/documentation/resources/adoptopenjdk_install.md) -- [adoptopenjdk_linux_install](https://github.com/sous-chefs/java/blob/master/documentation/resources/adoptopenjdk_linux_install.md) - [adoptopenjdk_macos_install](https://github.com/sous-chefs/java/blob/master/documentation/resources/adoptopenjdk_macos_install.md) - [alternatives](https://github.com/sous-chefs/java/blob/master/documentation/resources/alternatives.md) - [certificate](https://github.com/sous-chefs/java/blob/master/documentation/resources/certificate.md) diff --git a/documentation/resources/adoptopenjdk_install.md b/documentation/resources/adoptopenjdk_install.md deleted file mode 100644 index 6edee611..00000000 --- a/documentation/resources/adoptopenjdk_install.md +++ /dev/null @@ -1,58 +0,0 @@ -# adoptopenjdk_install - -[back to resource list](https://github.com/sous-chefs/java#resources) - -Introduced: v7.0.0 - -## Actions - -- `:install` -- `:remove` - -## Properties - -| Name | Type | Default | Description | -| --------------------- | ----------------- | ------- | -------------------------------------------------------------- | -| version | String | | Java version to install | -| variant | String | | Install flavour', default: 'openj9 | -| url | String | | The URL to download from | -| checksum | String | | The checksum for the downloaded file | -| java_home | String | | Set to override the java_home | -| java_home_mode | String | | The permission for the Java home directory | -| java_home_owner | String | | Owner of the Java Home | -| java_home_group | String | | Group for the Java Home | -| default | [true, false] | | Whether to set this as the defalut Java | -| bin_cmds | Array | | A list of bin_cmds based on the version and variant | -| alternatives_priority | Integer | | Alternatives priority to set for this Java | -| reset_alternatives | [true, false] | | Whether to reset alternatives before setting | -| tap_url | String, | | The URL of the tap | -| cask_options | String, | | Options to pass to the brew command during installation | -| homebrew_path | String, | | The path to the homebrew binary | -| owner | [String, Integer] | | The owner of the Homebrew installation | - -## Examples - -To install Hotspot AdoptOpenJDK 11 and set it as the default Java: - -```ruby -adoptopenjdk_install '11' -``` - -To install hotspot AdoptOpenJDK 11 and set it as second highest priority: - -```ruby -adoptopenjdk_install '10' do - variant 'hotspot' - alternatives_priority 2 -end -``` - -To install AdoptOpenJDK 11 from a custom tarball: - -```ruby -adoptopenjdk_install '11' do - variant 'hotspot' - url 'http://url.of/path/to/OpenJDK11U-jdk_x64_linux_hotspot_11.0.7_10.tar.gz' - checksum 'asdfasdfasdf' -end -``` diff --git a/documentation/resources/adoptopenjdk_linux_install.md b/documentation/resources/adoptopenjdk_linux_install.md deleted file mode 100644 index 3e20ccbf..00000000 --- a/documentation/resources/adoptopenjdk_linux_install.md +++ /dev/null @@ -1,53 +0,0 @@ - -# adoptopenjdk_linux_install - -[back to resource list](https://github.com/sous-chefs/java#resources) - -Introduced: v8.1.0 - -## Actions - -- `:install` -- `:remove` - -## Properties - -| Name | Type | Default | Description | -| --------------------- | ------------- | ---------------------------------------------------------------------- | ----------------------------------------------------- | -| variant | String | `openj9` | Install flavour | -| url | String | `default_adopt_openjdk_url(version)[variant]` | The URL to download from | -| checksum | String | `default_adopt_openjdk_checksum(version)[variant]` | The checksum for the downloaded file | -| java_home | String | `/usr/lib/jvm/java-#{version}-adoptopenjdk-#{variant}/#{sub_dir(url)}` | Set to override the java_home | -| java_home_mode | String | | Owner of the Java Home | -| java_home_group | String | `node['root_group']` | Group for the Java Home | -| default | [true, false] | `true` | Whether to set this as the defalut Java | -| bin_cmds | Array | `default_adopt_openjdk_bin_cmds(version)[variant]` | A list of `bin_cmds` based on the version and variant | -| alternatives_priority | Integer | `1` | Alternatives priority to set for this Java | -| reset_alternatives | [true, false] | `true` | Whether to reset alternatives before setting | - -## Examples - -To install Hotspot AdoptOpenJDK 11 and set it as the default Java: - -```ruby -adoptopenjdk_linux_install1 '11' -``` - -To install hotspot AdoptOpenJDK 11 and set it as second highest priority: - -```ruby -adoptopenjdk_linux_install1 '10' do - variant 'hotspot' - alternatives_priority 2 -end -``` - -To install AdoptOpenJDK 11 from a custom tarball: - -```ruby -adoptopenjdk_install '11' do - variant 'hotspot' - url 'http://url.of/path/to/OpenJDK11U-jdk_x64_linux_hotspot_11.0.7_10.tar.gz' - checksum 'asdfasdfasdf' -end -``` diff --git a/documentation/resources/adoptopenjdk_macos_install.md b/documentation/resources/adoptopenjdk_macos_install.md deleted file mode 100644 index 9336a334..00000000 --- a/documentation/resources/adoptopenjdk_macos_install.md +++ /dev/null @@ -1,65 +0,0 @@ - -# adoptopenjdk_macos_install - -[back to resource list](https://github.com/sous-chefs/java#resources) - -Introduced: v8.1.0 - -## Actions - -- `:install` -- `:remove` - -## Properties - -| Name | Type | Default | Description | Allowed Values | -| ------------- | ----------------- | -------------------------- | -------------------------------------------------------------- | -| tap_url | String | | The URL of the tap | -| cask_options | String | | Options to pass to the brew command during installation | -| homebrew_path | String | | The path to the homebrew binary | -| owner | [String, Integer] | | The owner of the Homebrew installation | -| java_home | String | `macos_java_home(version)` | MacOS specific JAVA_HOME | -| version | String | `adoptopenjdk14` | | See list below | - -## Allowed Install Versions - -- adoptopenjdk8 -- adoptopenjdk8-openj9 -- adoptopenjdk8-openj9-large -- adoptopenjdk8-jre -- adoptopenjdk8-openj9-jre -- adoptopenjdk8-jre-large -- adoptopenjdk9 -- adoptopenjdk10 -- adoptopenjdk11 -- adoptopenjdk11-openj9 -- adoptopenjdk11-openj9-large -- adoptopenjdk11-jre -- adoptopenjdk11-openj9-jre -- adoptopenjdk11-openj9-jre-large -- adoptopenjdk12 -- adoptopenjdk12-openj9 -- adoptopenjdk12-openj9-large -- adoptopenjdk12-jre -- adoptopenjdk12-openj9-jre -- adoptopenjdk12-openj9-jre-large -- adoptopenjdk13 -- adoptopenjdk13-openj9 -- adoptopenjdk13-openj9-large -- adoptopenjdk13-jre -- adoptopenjdk13-openj9-jre -- adoptopenjdk13-openj9-jre-large -- adoptopenjdk14 -- adoptopenjdk14-openj9 -- adoptopenjdk14-openj9-large -- adoptopenjdk14-jre -- adoptopenjdk14-openj9-jre -- adoptopenjdk14-openj9-jre-large - -## Examples - -To install Hotspot AdoptOpenJDK 11 and set it as the default Java: - -```ruby -adoptopenjdk_macos_install 'adoptopenjdk14-jre' -``` diff --git a/kitchen.macos.local.yml b/kitchen.macos.local.yml index 9de6bec9..071b95cd 100644 --- a/kitchen.macos.local.yml +++ b/kitchen.macos.local.yml @@ -13,13 +13,13 @@ platforms: gui: false suites: - - name: adoptopenjdk-14 + - name: default run_list: - recipe[homebrew] - - recipe[test::adoptopenjdk] + - recipe[test::openjdk] attributes: version: 14 variant: openj9 verifier: - inspec_tests: [test/integration/adoptopenjdk] - input_files: [test/integration/adoptopenjdk/inputs/adoptopenjdk-14-macos.yml] + inspec_tests: [test/integration/openjdk] + input_files: [test/integration/openjdk/inputs/openjdk-14-macos.yml] diff --git a/kitchen.macos.yml b/kitchen.macos.yml index 2fc17f27..0b6a7052 100644 --- a/kitchen.macos.yml +++ b/kitchen.macos.yml @@ -20,12 +20,11 @@ platforms: gui: false suites: - - name: adoptopenjdk-14 + - name: default run_list: - - recipe[test::adoptopenjdk] + - recipe[test::openjdk] attributes: - version: 14 - variant: openj9 + version: 17 verifier: - inspec_tests: [test/integration/adoptopenjdk] - input_files: [test/integration/adoptopenjdk/inputs/adoptopenjdk-14-macos.yml] + inspec_tests: [test/integration/openjdk] + inputs: { java_version: "17" } diff --git a/kitchen.yml b/kitchen.yml index 30ee8389..b8771bba 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -11,16 +11,14 @@ verifier: name: inspec platforms: - - name: amazonlinux-2 - - name: centos-7 - - name: centos-8 - - name: debian-9 - - name: debian-10 + - name: amazonlinux-2023 + - name: debian-12 - name: debian-11 - - name: freebsd-11 - - name: freebsd-12 + - name: freebsd-13 - name: fedora-latest - - name: ubuntu-18.04 + - name: rockylinux-9 + - name: rockylinux-8 + - name: ubuntu-22.04 - name: ubuntu-20.04 suites: @@ -49,117 +47,46 @@ suites: inspec_tests: [test/integration/openjdk] inputs: { java_version: "17" } - # AdoptOpenJDK - # Version 8 - - name: adoptopenjdk-8-hotspot + # Temurin/Semeru + - name: temurin-8-hotspot run_list: - - recipe[test::adoptopenjdk] + - recipe[test::openjdk] attributes: version: 8 variant: hotspot verifier: - inspec_tests: [test/integration/adoptopenjdk] - input_files: - - test/integration/adoptopenjdk/inputs/adoptopenjdk-8-hotspot.yml - - - name: adoptopenjdk-8-openj9 - run_list: - - recipe[test::adoptopenjdk] - attributes: - version: 8 - variant: openj9 - verifier: - inspec_tests: [test/integration/adoptopenjdk] - input_files: - - test/integration/adoptopenjdk/inputs/adoptopenjdk-8-openj9.yml - - - name: adoptopenjdk-8-openj9-large-heap - run_list: - - recipe[test::adoptopenjdk] - attributes: - version: 8 - variant: openj9-large-heap - verifier: - inspec_tests: [test/integration/adoptopenjdk] - input_files: - - test/integration/adoptopenjdk/inputs/adoptopenjdk-8-openj9-large-heap.yml + inspec_tests: [test/integration/openjdk] + inputs: { java_version: "8" } - # Version 11 - - name: adoptopenjdk-11-hotspot + - name: temurin-11-hotspot run_list: - - recipe[test::adoptopenjdk] + - recipe[test::openjdk] attributes: version: 11 variant: hotspot verifier: - inspec_tests: [test/integration/adoptopenjdk] - input_files: - - test/integration/adoptopenjdk/inputs/adoptopenjdk-11-hotspot.yml - - name: adoptopenjdk-11-openj9 + inspec_tests: [test/integration/openjdk] + inputs: { java_version: "11" } + + - name: semeru-11-openj9 run_list: - - recipe[test::adoptopenjdk] + - recipe[test::openjdk] attributes: version: 11 variant: openj9 verifier: - inspec_tests: [test/integration/adoptopenjdk] - input_files: - - test/integration/adoptopenjdk/inputs/adoptopenjdk-11-openj9.yml - - name: adoptopenjdk-11-openj9-large-heap - run_list: - - recipe[test::adoptopenjdk] - attributes: - version: 11 - variant: openj9-large-heap - verifier: - inspec_tests: [test/integration/adoptopenjdk] - input_files: - - test/integration/adoptopenjdk/inputs/adoptopenjdk-11-openj9-large-heap.yml - - # Version 17 - - name: adoptopenjdk-17-openj9-large-heap - run_list: - - recipe[test::adoptopenjdk] - attributes: - version: 17 - variant: openj9-large-heap - verifier: - inspec_tests: [test/integration/adoptopenjdk] - input_files: - - test/integration/adoptopenjdk/inputs/adoptopenjdk-17-openj9-large-heap.yml + inspec_tests: [test/integration/openjdk] + inputs: { java_version: "11" } - - name: adoptopenjdk-17-openj9 - run_list: - - recipe[test::adoptopenjdk] - attributes: - version: 17 - variant: openj9 - verifier: - inspec_tests: [test/integration/adoptopenjdk] - input_files: - - test/integration/adoptopenjdk/inputs/adoptopenjdk-17-openj9.yml - - name: adoptopenjdk-17-hotspot + - name: semeru-17-openj9 run_list: - - recipe[test::adoptopenjdk] + - recipe[test::openjdk] attributes: version: 17 - variant: hotspot - verifier: - inspec_tests: [test/integration/adoptopenjdk] - input_files: - - test/integration/adoptopenjdk/inputs/adoptopenjdk-14-hotspot.yml - - # 11 Removal - - name: adoptopenjdk-removal-11-openj9 - run_list: - - recipe[test::remove-adoptopenjdk-11-openj9] - attributes: - version: 11 variant: openj9 verifier: - inspec_tests: [test/integration/remove-adoptopenjdk] - input_files: - - test/integration/adoptopenjdk/inputs/adoptopenjdk-11-openj9.yml + inspec_tests: [test/integration/openjdk] + inputs: { java_version: "17" } # Corretto - name: corretto-8 @@ -190,50 +117,3 @@ suites: verifier: inspec_tests: [test/integration/corretto] inputs: { java_version: "18" } - - # Custom URL tests - - name: custom-package-8 - run_list: - - recipe[test::custom_package] - attributes: - version: 8 - variant: hotspot - url: http://ftp.osuosl.org/pub/osl/sous-chefs/OpenJDK8U-jdk_x64_linux_hotspot_8u232b09.tar.gz - checksum: 7b7884f2eb2ba2d47f4c0bf3bb1a2a95b73a3a7734bd47ebf9798483a7bcc423 - verifier: - inspec_tests: [test/integration/custom-package] - input_files: [test/integration/custom-package/inputs/hotspot-8.yml] - - name: custom-package-11 - run_list: - - recipe[test::custom_package] - attributes: - version: 11 - variant: hotspot - url: http://ftp.osuosl.org/pub/osl/sous-chefs/OpenJDK11U-jdk_x64_linux_hotspot_11.0.6_10.tar.gz - checksum: 330d19a2eaa07ed02757d7a785a77bab49f5ee710ea03b4ee2fa220ddd0feffc - verifier: - inspec_tests: [test/integration/custom-package] - input_files: [test/integration/custom-package/inputs/hotspot-11.yml] - - name: custom-package-11-openj9 - run_list: - - recipe[test::custom_package] - attributes: - version: 11 - variant: openj9 - url: http://ftp.osuosl.org/pub/osl/sous-chefs/OpenJDK11U-jdk_x64_linux_openj9_11.0.6_10_openj9-0.18.1.tar.gz - checksum: 1530172ee98edd129954fcdca1bf725f7b30c8bfc3cdc381c88de96b7d19e690 - verifier: - inspec_tests: [test/integration/custom-package] - input_files: [test/integration/custom-package/inputs/openj9-11.yml] - - name: custom-package-11-openj9-large-heap - run_list: - - recipe[test::custom_package] - attributes: - version: 11 - variant: openj9-large-heap - url: http://ftp.osuosl.org/pub/osl/sous-chefs/OpenJDK11U-jdk_x64_linux_openj9_linuxXL_11.0.6_10_openj9-0.18.1.tar.gz - checksum: 6524d85d2ce334c955a4347015567326067ef15fe5f6a805714b25cace256f40 - verifier: - inspec_tests: [test/integration/custom-package] - input_files: - [test/integration/custom-package/inputs/openj9-large-heap-11.yml] diff --git a/libraries/adopt_openjdk_macos_helpers.rb b/libraries/adopt_openjdk_macos_helpers.rb deleted file mode 100644 index 3680c9ce..00000000 --- a/libraries/adopt_openjdk_macos_helpers.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Java - module Cookbook - module AdoptOpenJdkMacOsHelpers - def macos_java_home(version) - if version.include? 'jre' - ending = '.jre' - version.gsub!('-jre', '') - else - ending = '.jdk' - end - - version.gsub!('jdk', 'jdk-') - version.slice!('-large') - - "/Library/Java/JavaVirtualMachines/#{version}#{ending}/Contents/Home" - end - end - end -end diff --git a/libraries/openjdk_helpers.rb b/libraries/openjdk_helpers.rb index 0ef5a4b3..362e1d52 100644 --- a/libraries/openjdk_helpers.rb +++ b/libraries/openjdk_helpers.rb @@ -140,7 +140,7 @@ def default_openjdk_bin_cmds(version) %w(appletviewer idlj jaotc jar jarsigner java javac javadoc javap jcmd jconsole jdb jdeprscan jdeps jhsdb jimage jinfo jjs jlink jmap jmod jps jrunscript jshell jstack jstat jstatd keytool orbd pack200 rmic rmid rmiregistry schemagen serialver servertool tnameserv unpack200 wsgen wsimport xjc) when '11' %w(jaotc jar jarsigner java javac javadoc javap jcmd jconsole jdb jdeprscan jdeps jhsdb jimage jinfo jjs jlink jmap jmod jps jrunscript jshell jstack jstat jstatd keytool pack200 rmic rmid rmiregistry serialver unpack200) - when '12', '13', '14', '15', '16', '17', 'latest' + when '12', '13', '14', '15', '16', '17', '19', '20', '21', '22', 'latest' %w(jaotc jarsigner javac javap jconsole jdeprscan jfr jimage jjs jmap jps jshell jstat keytool rmic rmiregistry unpack200 jar java javadoc jcmd jdb jdeps jhsdb jinfo jlink jmod jrunscript jstack jstatd pack200 rmid serialver) else Chef::Log.fatal('Version specified does not have a default set of bin_cmds') diff --git a/resources/adoptopenjdk_install.rb b/resources/adoptopenjdk_install.rb deleted file mode 100644 index 45743a19..00000000 --- a/resources/adoptopenjdk_install.rb +++ /dev/null @@ -1,80 +0,0 @@ -provides :adoptopenjdk_install -unified_mode true - -property :variant, - String, - description: 'Install flavour', default: 'openj9' - -property :url, - String, - description: 'The URL to download from' - -property :checksum, - String, - description: 'The checksum for the downloaded file' - -property :java_home, - String, - description: 'Set to override the java_home' - -property :bin_cmds, - Array, - description: 'A list of bin_cmds based on the version and variant' - -use 'partial/_common' -use 'partial/_linux' -use 'partial/_java_home' -use 'partial/_macos' - -action :install do - case node['platform_family'] - when 'mac_os_x' - variant = if new_resource.variant.include? 'openj9' - '' - else - "-#{new_resource.variant}" - end - - adoptopenjdk_macos_install 'homebrew' do - tap_url new_resource.tap_url - cask_options new_resource.cask_options - homebrew_path new_resource.homebrew_path - owner new_resource.owner - version "adoptopenjdk#{new_resource.version}#{variant}" - end - when 'windows' - log 'not yet implemented' - else - adoptopenjdk_linux_install new_resource.version do - variant new_resource.variant - url new_resource.url - checksum new_resource.checksum - java_home new_resource.java_home - java_home_mode new_resource.java_home_mode - java_home_group new_resource.java_home_group - end - end -end - -action :remove do - case node['platform_family'] - when 'mac_os_x' - adoptopenjdk_macos_install 'homebrew' do - tap_url new_resource.tap_url - cask_options new_resource.cask_options - homebrew_path new_resource.homebrew_path - owner new_resource.owner - action :remove - end - when 'windows' - log 'not yet implemented' - else - adoptopenjdk_linux_install 'linux' do - version new_resource.version unless new_resource.version.nil? - variant new_resource.variant unless new_resource.variant.nil? - java_home new_resource.java_home unless new_resource.java_home.nil? - bin_cmds new_resource.bin_cmds unless new_resource.bin_cmds.nil? - action :remove - end - end -end diff --git a/resources/adoptopenjdk_linux_install.rb b/resources/adoptopenjdk_linux_install.rb deleted file mode 100644 index 70026542..00000000 --- a/resources/adoptopenjdk_linux_install.rb +++ /dev/null @@ -1,45 +0,0 @@ -# provides :adoptopenjdk_linux_install -# unified_mode true -# include Java::Cookbook::OpenJdkHelpers - -# property :variant, String, -# equal_to: %w(hotspot openj9 openj9-large-heap), -# default: 'openj9', -# description: 'Install flavour' - -# property :url, String, -# default: lazy { default_openjdk_url(version, variant) }, -# description: 'The URL to download from' - -# property :checksum, String, -# regex: /^[0-9a-f]{32}$|^[a-zA-Z0-9]{40,64}$/, -# default: lazy { default_openjdk_checksum(version, variant) }, -# description: 'The checksum for the downloaded file' - -# property :java_home, String, -# default: lazy { "/usr/lib/jvm/java-#{version}-adoptopenjdk-#{variant}/#{sub_dir(url)}" }, -# description: 'Set to override the java_home' - -# property :bin_cmds, Array, -# default: lazy { default_openjdk_bin_cmds(version, variant) }, -# description: 'A list of bin_cmds based on the version and variant' - -# use 'partial/_common' -# use 'partial/_linux' -# use 'partial/_java_home' - -# action :install do -# template "/usr/lib/jvm/.java-#{new_resource.version}-adoptopenjdk-#{new_resource.variant}.jinfo" do -# cookbook 'java' -# source 'jinfo.erb' -# owner new_resource.java_home_owner -# group new_resource.java_home_group -# variables( -# priority: new_resource.alternatives_priority, -# bin_cmds: new_resource.bin_cmds, -# name: extract_dir.split('/').last, -# app_dir: new_resource.java_home -# ) -# only_if { platform_family?('debian') } -# end -# end diff --git a/resources/adoptopenjdk_macos_install.rb b/resources/adoptopenjdk_macos_install.rb deleted file mode 100644 index 92fd6c7e..00000000 --- a/resources/adoptopenjdk_macos_install.rb +++ /dev/null @@ -1,71 +0,0 @@ -provides :adoptopenjdk_macos_install -unified_mode true -include Java::Cookbook::AdoptOpenJdkMacOsHelpers - -use 'partial/_macos' - -property :java_home, String, - default: lazy { macos_java_home(version) }, - description: 'MacOS specific JAVA_HOME' - -property :version, String, - default: 'adoptopenjdk14', - equal_to: %w( - adoptopenjdk8 adoptopenjdk8-openj9 adoptopenjdk8-openj9-large - adoptopenjdk8-jre adoptopenjdk8-openj9-jre adoptopenjdk8-jre-large - adoptopenjdk9 adoptopenjdk10 - adoptopenjdk11 adoptopenjdk11-openj9 adoptopenjdk11-openj9-large - adoptopenjdk11-jre adoptopenjdk11-openj9-jre adoptopenjdk11-openj9-jre-large - adoptopenjdk12 adoptopenjdk12-openj9 adoptopenjdk12-openj9-large - adoptopenjdk12-jre adoptopenjdk12-openj9-jre adoptopenjdk12-openj9-jre-large - adoptopenjdk13 adoptopenjdk13-openj9 adoptopenjdk13-openj9-large - adoptopenjdk13-jre adoptopenjdk13-openj9-jre adoptopenjdk13-openj9-jre-large - adoptopenjdk14 adoptopenjdk14-openj9 adoptopenjdk14-openj9-large - adoptopenjdk14-jre adoptopenjdk14-openj9-jre adoptopenjdk14-openj9-jre-large - ) - -action :install do - homebrew_tap 'AdoptOpenJDK/openjdk' do - homebrew_path new_resource.homebrew_path - owner new_resource.owner - url new_resource.tap_url - action :tap - end - - homebrew_cask "AdoptOpenJDK/openjdk/#{new_resource.version}" do - homebrew_path new_resource.homebrew_path - install_cask true - options new_resource.cask_options - owner new_resource.owner - action :install - end - - # Bash system wide environment variables - append_if_no_line 'Java Home' do - path '/etc/profile' - line "export JAVA_HOME=#{new_resource.java_home}" - end - - # Zsh system wide environment variables - append_if_no_line 'Java Home' do - path '/etc/zshrc' - line "export JAVA_HOME=#{new_resource.java_home}" - end - - node.default['java']['java_home'] = new_resource.java_home -end - -action :remove do - homebrew_tap 'AdoptOpenJDK/openjdk' do - homebrew_path new_resource.homebrew_path - owner new_resource.owner - action :untap - end - - homebrew_cask "adoptopenjdk#{new_resource.version}" do - homebrew_path new_resource.homebrew_path - options new_resource.cask_options - owner new_resource.owner - action :remove - end -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ee2b6646..317bf1fa 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,6 @@ require 'chefspec' require 'chefspec/berkshelf' -require_relative '../libraries/adopt_openjdk_macos_helpers' require_relative '../libraries/certificate_helpers' require_relative '../libraries/corretto_helpers' require_relative '../libraries/openjdk_helpers' diff --git a/test/fixtures/cookbooks/test/recipes/custom_package.rb b/test/fixtures/cookbooks/test/recipes/custom_package.rb deleted file mode 100644 index 4b59004e..00000000 --- a/test/fixtures/cookbooks/test/recipes/custom_package.rb +++ /dev/null @@ -1,7 +0,0 @@ -adoptopenjdk_install node['version'] do - variant node['variant'] - url node['url'] - checksum node['checksum'] - default true - alternatives_priority 1 -end diff --git a/test/fixtures/cookbooks/test/recipes/remove-adoptopenjdk-11-openj9.rb b/test/fixtures/cookbooks/test/recipes/remove-adoptopenjdk-11-openj9.rb deleted file mode 100644 index 02857f5b..00000000 --- a/test/fixtures/cookbooks/test/recipes/remove-adoptopenjdk-11-openj9.rb +++ /dev/null @@ -1,8 +0,0 @@ -apt_update - -include_recipe 'test::adoptopenjdk' - -adoptopenjdk_install '11' do - variant 'openj9' - action :remove -end diff --git a/test/integration/adoptopenjdk/controls/verify_adoptopenjdk.rb b/test/integration/adoptopenjdk/controls/verify_adoptopenjdk.rb deleted file mode 100644 index 2ae80294..00000000 --- a/test/integration/adoptopenjdk/controls/verify_adoptopenjdk.rb +++ /dev/null @@ -1,78 +0,0 @@ -variant = input('variant', description: 'Variant being used: openj9, openj9-large-heap, or hotspot') -java_version = input('java_version', description: 'Which version of java should be installed') -certificate_sha256_checksum = input('certificate_sha256_checksum', - value: '64:F3:3B:A7:EF:C3:5C:6B:2D:ED:95:0B:CB:4E:96:3B:12:97:B8:62:BA:1A:8E:30:13:B0:B0:59:77:12:31:EA', - description: 'The SHA256 checksum of the certificate' -) -parent_install_dir = input('parent_install_dir', - value: "java-#{java_version.to_i > 8 ? java_version.to_i : java_version.split('.')[1]}-adoptopenjdk-#{variant}", - description: 'The parent of the Java home') -keystore_location = input('keystore_location', - value: nil, - description: 'Where the java keystore is located' -) -keystore_password = input('keystore_password', - value: 'changeit', - description: 'Password to the Java keystore') - -control 'check-java-version' do - impact 1.0 - title 'Verify java version' - desc 'Verify the correct version of java is installed' - - describe command('java -version 2>&1') do - its('stdout') { should match /AdoptOpenJDK/ } unless java_version.to_i == 1 - its('stdout') { should match Regexp.new(java_version.to_s) } - end -end - -if os.linux? - control 'check-java-alternatives' do - impact 1.0 - title 'Verify alternatives for java' - desc 'Verify alternatives for java are set to the correct version' - - %w(jar jarsigner java javac).each do |cmd| - describe command("update-alternatives --display #{cmd}") do - its('stdout') { should match parent_install_dir.to_s } - end - end - end -end - -control 'check-jce' do - impact 1.0 - title 'Verify JCE is Unlimitied' - desc 'Verify JCE unlimited support and string' - - describe command('java -jar /tmp/UnlimitedSupportJCETest.jar') do - its('stdout') { should match /isUnlimitedSupported=TRUE/ } - its('stdout') { should match /strength: 2147483647/ } - end -end - -control 'check-certificate' do - impact 1.0 - title 'Verify Java keystore contains the certificate' - desc 'Verify Java keystore exists and contains the certificate' - - unless certificate_sha256_checksum.nil? || certificate_sha256_checksum.empty? - cmd = "keytool -list -v -keystore #{keystore_location}" - cmd.concat(" -storepass #{keystore_password}") unless keystore_password.nil? - describe command("#{cmd} | grep SHA256:") do - its('stdout') { should match certificate_sha256_checksum } - end - end -end - -if os.darwin? - control 'JAVA_HOME' do - impact 0.1 - title 'Verify the JAVA_HOME is set correctly' - desc 'Verify that JAVA_HOME is set correctly and to the correct version in the bash profile' - - describe file('/etc/profile') do - its('content') { should match /JAVA_HOME/ } - end - end -end diff --git a/test/integration/adoptopenjdk/inputs/adoptopenjdk-11-hotspot.yml b/test/integration/adoptopenjdk/inputs/adoptopenjdk-11-hotspot.yml deleted file mode 100644 index aca4299e..00000000 --- a/test/integration/adoptopenjdk/inputs/adoptopenjdk-11-hotspot.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -java_version: 11.0.6 -variant: "hotspot" -keystore_location: '/usr/lib/jvm/java-11-adoptopenjdk-hotspot/jdk-11.0.6+10/lib/security/cacerts' diff --git a/test/integration/adoptopenjdk/inputs/adoptopenjdk-11-openj9-large-heap.yml b/test/integration/adoptopenjdk/inputs/adoptopenjdk-11-openj9-large-heap.yml deleted file mode 100644 index ceb92c0b..00000000 --- a/test/integration/adoptopenjdk/inputs/adoptopenjdk-11-openj9-large-heap.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -java_version: 11.0.6 -variant: "openj9-large-heap" -keystore_location: '/usr/lib/jvm/java-11-adoptopenjdk-openj9-large-heap/jdk-11.0.6+10/lib/security/cacerts' diff --git a/test/integration/adoptopenjdk/inputs/adoptopenjdk-11-openj9.yml b/test/integration/adoptopenjdk/inputs/adoptopenjdk-11-openj9.yml deleted file mode 100644 index 51f0e887..00000000 --- a/test/integration/adoptopenjdk/inputs/adoptopenjdk-11-openj9.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -java_version: 11.0.6 -variant: "openj9" -keystore_location: '/usr/lib/jvm/java-11-adoptopenjdk-openj9/jdk-11.0.6+10/lib/security/cacerts' diff --git a/test/integration/adoptopenjdk/inputs/adoptopenjdk-14-hotspot.yml b/test/integration/adoptopenjdk/inputs/adoptopenjdk-14-hotspot.yml deleted file mode 100644 index 7be7f985..00000000 --- a/test/integration/adoptopenjdk/inputs/adoptopenjdk-14-hotspot.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -java_version: 14 -variant: "hotspot" -keystore_location: '/usr/lib/jvm/java-14-adoptopenjdk-hotspot/jdk-14+36/lib/security/cacerts' diff --git a/test/integration/adoptopenjdk/inputs/adoptopenjdk-14-macos.yml b/test/integration/adoptopenjdk/inputs/adoptopenjdk-14-macos.yml deleted file mode 100644 index 315dca34..00000000 --- a/test/integration/adoptopenjdk/inputs/adoptopenjdk-14-macos.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -java_version: '14' -variant: "openj9" -keystore_location: '/Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home/lib/security/cacerts' diff --git a/test/integration/adoptopenjdk/inputs/adoptopenjdk-14-openj9-large-heap.yml b/test/integration/adoptopenjdk/inputs/adoptopenjdk-14-openj9-large-heap.yml deleted file mode 100644 index 3cc4019b..00000000 --- a/test/integration/adoptopenjdk/inputs/adoptopenjdk-14-openj9-large-heap.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -java_version: 14 -variant: "openj9-large-heap" -keystore_location: '/usr/lib/jvm/java-14-adoptopenjdk-openj9-large-heap/jdk-14+36/lib/security/cacerts' diff --git a/test/integration/adoptopenjdk/inputs/adoptopenjdk-14-openj9.yml b/test/integration/adoptopenjdk/inputs/adoptopenjdk-14-openj9.yml deleted file mode 100644 index 06f74fe2..00000000 --- a/test/integration/adoptopenjdk/inputs/adoptopenjdk-14-openj9.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -java_version: 14 -variant: "openj9" -keystore_location: '/usr/lib/jvm/java-14-adoptopenjdk-openj9/jdk-14+36/lib/security/cacerts' diff --git a/test/integration/adoptopenjdk/inputs/adoptopenjdk-8-hotspot.yml b/test/integration/adoptopenjdk/inputs/adoptopenjdk-8-hotspot.yml deleted file mode 100644 index ed5cfa28..00000000 --- a/test/integration/adoptopenjdk/inputs/adoptopenjdk-8-hotspot.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -java_version: 1.8.0 -variant: "hotspot" -keystore_location: '/usr/lib/jvm/java-8-adoptopenjdk-hotspot/jdk8u242-b08/jre/lib/security/cacerts' diff --git a/test/integration/adoptopenjdk/inputs/adoptopenjdk-8-openj9-large-heap.yml b/test/integration/adoptopenjdk/inputs/adoptopenjdk-8-openj9-large-heap.yml deleted file mode 100644 index e6ebc7c7..00000000 --- a/test/integration/adoptopenjdk/inputs/adoptopenjdk-8-openj9-large-heap.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -java_version: 1.8.0 -variant: "openj9-large-heap" -keystore_location: '/usr/lib/jvm/java-8-adoptopenjdk-openj9-large-heap/jdk8u242-b08/jre/lib/security/cacerts' diff --git a/test/integration/adoptopenjdk/inputs/adoptopenjdk-8-openj9.yml b/test/integration/adoptopenjdk/inputs/adoptopenjdk-8-openj9.yml deleted file mode 100644 index f7c4ccf6..00000000 --- a/test/integration/adoptopenjdk/inputs/adoptopenjdk-8-openj9.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -java_version: 1.8.0 -variant: "openj9" -keystore_location: '/usr/lib/jvm/java-8-adoptopenjdk-openj9/jdk8u242-b08/jre/lib/security/cacerts' diff --git a/test/integration/adoptopenjdk/inspec.yml b/test/integration/adoptopenjdk/inspec.yml deleted file mode 100644 index 69dff34a..00000000 --- a/test/integration/adoptopenjdk/inspec.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -name: adoptopenjdk -title: AdoptOpenJDK tests -license: Public domain -copyright: None -summary: Verify installation of AdoptOpenJDK -version: 0.0.1 diff --git a/test/integration/remove-adoptopenjdk/controls/verify_adoptopenjdk-removal.rb b/test/integration/remove-adoptopenjdk/controls/verify_adoptopenjdk-removal.rb deleted file mode 100644 index 73ec00a7..00000000 --- a/test/integration/remove-adoptopenjdk/controls/verify_adoptopenjdk-removal.rb +++ /dev/null @@ -1,35 +0,0 @@ -variant = input('variant', value: 'openj9', description: 'Variant being used: openj9, openj9-large-heap, or hotspot') -alternative_bin_cmds = input('alternative_bin_cmds', - value: %w(jar java keytool), - description: 'List of bin commands that should be included in alternatives') -java_version = input('java_version', - value: '1.8.0', - description: 'Which version of java should be installed') -java_home = input('java_home', - value: "/usr/lib/jvm/java-#{java_version.to_i > 8 ? java_version.to_i : java_version.split('.')[1]}-adoptopenjdk-#{variant}", - description: 'Path to the Java home directory') - -control 'check-removal-java-directory' do - impact 1.0 - title 'Verify java directory has been removed' - desc 'Verify java directory has been removed' - - describe directory(java_home) do - it { should_not exist } - end -end - -control 'check-java-alternatives-removal' do - impact 1.0 - title 'Verify alternatives for java are removed' - desc 'Verify alternatives for java are removed' - - # NOTE: platform_family?('rhel') is not working for amazon-linux - if os.family == 'redhat' - alternative_bin_cmds.each do |cmd| - describe command("update-alternatives --display #{cmd}") do - its('stdout') { should_not match "#{java_home}/bin/#{cmd}" } - end - end - end -end diff --git a/test/integration/remove-adoptopenjdk/inspec.yml b/test/integration/remove-adoptopenjdk/inspec.yml deleted file mode 100644 index 22d8d373..00000000 --- a/test/integration/remove-adoptopenjdk/inspec.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -name: remove-adoptopenjdk -title: AdoptOpenJDK removal tests -license: Public domain -copyright: None -summary: Verify removal of AdoptOpenJDK -version: 0.0.1 From 09c09f19b20ca6341a3a7169b2abdfdca2520f94 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 4 Dec 2024 05:11:47 +0800 Subject: [PATCH 143/188] Update changelog for 12.1.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef8067e4..af16abc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 12.1.0 - *2024-12-03* - Add support for OpenJDK versions 19, 20, 21 and 22 - Remove commented out `adoptopenjdk_linux_install` resource From 4be0f233ed78ded6cbc0ab7ad901d237242c42f3 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 4 Dec 2024 05:11:47 +0800 Subject: [PATCH 144/188] Update metadata for 12.1.0 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index f0a5e8dc..53afdc63 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '12.0.7' +version '12.1.0' supports 'debian' supports 'ubuntu' From 2d69fe3de2a326fc60f267b1e4b368aba45001ed Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 4 Dec 2024 05:11:51 +0800 Subject: [PATCH 145/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index af16abc7..91bf5840 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 12.1.0 - *2024-12-03* - Add support for OpenJDK versions 19, 20, 21 and 22 From bd9eb9fa64eca470bbf43dcf7aca9d252eb79176 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 10:44:43 -0600 Subject: [PATCH 146/188] chore(deps): update actionshub/chef-install action to v3.0.1 (#721) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d03247f..660823e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: - name: Check out code uses: actions/checkout@v4 - name: Install Chef - uses: actionshub/chef-install@3.0.0 + uses: actionshub/chef-install@3.0.1 - name: Dokken uses: actionshub/test-kitchen@3.0.0 env: From 8a2fb861446a5913b0fb093aaf610e23d668d538 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Fri, 6 Dec 2024 00:44:47 +0800 Subject: [PATCH 147/188] Update changelog for 12.1.1 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91bf5840..b44b5866 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 12.1.1 - *2024-12-05* ## 12.1.0 - *2024-12-03* From 442c4796fc0299bdd48393f958d89f2ad1cf8e19 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Fri, 6 Dec 2024 00:44:48 +0800 Subject: [PATCH 148/188] Update metadata for 12.1.1 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 53afdc63..5ac8b3f3 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '12.1.0' +version '12.1.1' supports 'debian' supports 'ubuntu' From f2e340ace9ef2139b9d5095b9c2ee26d3dbea867 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Fri, 6 Dec 2024 00:44:51 +0800 Subject: [PATCH 149/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b44b5866..1caecfe8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 12.1.1 - *2024-12-05* ## 12.1.0 - *2024-12-03* From 17fa3f1a39038367dcaf259be2cfde5da96be446 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Sun, 13 Jul 2025 21:15:57 +0100 Subject: [PATCH 150/188] Update Temurin support (#722) - Remove Semeru from test matrix - Remove Semeru as it's currently failing. Will re-add at a later stage when it is known to be working - Add Temurin 21 to the matrix --------- Signed-off-by: Dan Webb --- .github/workflows/ci.yml | 14 +- .tool-versions | 1 + CHANGELOG.md | 11 ++ bin/check_java_versions.rb | 96 +++++++++++++ bin/check_temurin_versions.sh | 13 ++ .../resource_temurin_package_install.md | 64 +++++++++ .../resources/openjdk_pkg_install.md | 2 +- .../resources/openjdk_source_install.md | 2 +- kitchen.yml | 43 ++++-- lefthook.yml | 8 ++ libraries/bin_cmd_helpers.rb | 26 ++++ libraries/certificate_helpers.rb | 11 +- libraries/corretto_helpers.rb | 4 - libraries/openjdk_helpers.rb | 133 ++++++++---------- libraries/temurin_helpers.rb | 54 +++++++ resources/alternatives.rb | 82 +++++++++-- resources/certificate.rb | 4 +- resources/openjdk_install.rb | 3 + resources/openjdk_pkg_install.rb | 4 +- resources/openjdk_source_install.rb | 9 +- resources/partial/_openjdk.rb | 4 + resources/temurin_package_install.rb | 114 +++++++++++++++ spec/libraries/certificate_helpers_spec.rb | 29 +--- spec/libraries/corretto_helpers_spec.rb | 65 --------- spec/libraries/openjdk_helpers_spec.rb | 14 ++ spec/libraries/semeru_helpers_spec.rb | 15 +- .../cookbooks/test/recipes/openjdk.rb | 10 +- .../cookbooks/test/recipes/temurin_pkg.rb | 4 + .../openjdk/controls/verify_openjdk.rb | 19 +++ .../temurin/controls/verify_temurin.rb | 57 ++++++++ test/integration/temurin/inspec.yml | 6 + 31 files changed, 684 insertions(+), 237 deletions(-) create mode 100644 .tool-versions create mode 100755 bin/check_java_versions.rb create mode 100755 bin/check_temurin_versions.sh create mode 100644 documentation/resource_temurin_package_install.md create mode 100644 lefthook.yml create mode 100644 libraries/bin_cmd_helpers.rb create mode 100644 libraries/temurin_helpers.rb create mode 100644 resources/partial/_openjdk.rb create mode 100644 resources/temurin_package_install.rb create mode 100644 test/fixtures/cookbooks/test/recipes/temurin_pkg.rb create mode 100644 test/integration/temurin/controls/verify_temurin.rb create mode 100644 test/integration/temurin/inspec.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 660823e3..0d091bb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,17 +30,15 @@ jobs: - ubuntu-2204 - ubuntu-2004 suite: - # - openjdk-11 # Debian doesn't have an 11 package - - openjdk-16 - - openjdk-17 - # - temurin-8-hotspot - # - temurin-11-hotspot - # - semeru-11-openj9 - # - semeru-17-openj9 - - corretto-8 - corretto-11 - corretto-17 - corretto-18 + - temurin-8 + - temurin-11 + - temurin-17 + - temurin-21 + # - semeru-11 + # - semeru-17 fail-fast: false steps: - name: Check out code diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 00000000..58f0386e --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +ruby system diff --git a/CHANGELOG.md b/CHANGELOG.md index 1caecfe8..3e03c615 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +- Add new resource `temurin_package_install` +- Add script to check for Java updates +- Update Temurin Java 8 support +- Update Temurin repositories +- Update bin commands for all OpenJDK versions +- Fix Java alternatives to prevent unnecessary removal and re-addition of alternatives +- Move bin_cmds from Java::Cookbook::OpenJdkHelpers to Java::Cookbook::BinCmdHelpers for reuse outside of OpenJDK +- Fix apt_repository failing to install the GPG in the correct location +- Add Temurin 21 to the test matrix +- Remove Semeru from the test matrix + ## 12.1.1 - *2024-12-05* ## 12.1.0 - *2024-12-03* diff --git a/bin/check_java_versions.rb b/bin/check_java_versions.rb new file mode 100755 index 00000000..bb6336ea --- /dev/null +++ b/bin/check_java_versions.rb @@ -0,0 +1,96 @@ +#!/usr/bin/env ruby + +require 'net/http' +require 'json' +require 'uri' + +TEMURIN_REPOS = { + '11' => 'adoptium/temurin11-binaries', + '17' => 'adoptium/temurin17-binaries', +}.freeze + +SEMERU_REPOS = { + '11' => 'ibmruntimes/semeru11-binaries', + '17' => 'ibmruntimes/semeru17-binaries', +}.freeze + +CORRETTO_REPOS = { + '11' => 'corretto-11', + '17' => 'corretto-17', +}.freeze + +def get_latest_release(repo) + uri = URI("https://api.github.com/repos/#{repo}/releases/latest") + response = Net::HTTP.get_response(uri) + + if response.is_a?(Net::HTTPSuccess) + JSON.parse(response.body) + else + puts "Failed to fetch release info for #{repo}: #{response.code} #{response.message}" + nil + end +end + +def verify_url(url) + uri = URI(url) + response = Net::HTTP.get_response(uri) + + case response + when Net::HTTPRedirection + location = response['location'] + puts " ✓ URL redirects successfully to: #{location}" + true + when Net::HTTPSuccess + puts ' ✓ URL is directly accessible' + true + else + puts " ✗ URL is not accessible: #{response.code} #{response.message}" + false + end +end + +def find_linux_x64_jdk(assets) + assets.find { |asset| asset['name'] =~ /OpenJDK\d+U-jdk_x64_linux_hotspot.*\.tar\.gz$/ } +end + +def check_versions + puts 'Checking Temurin versions...' + puts '-' * 50 + + TEMURIN_REPOS.each do |version, repo| + puts "\nChecking Java #{version}..." + release = get_latest_release(repo) + next unless release + + tag = release['tag_name'] + puts "Latest release: #{tag}" + + asset = find_linux_x64_jdk(release['assets']) + if asset + url = asset['browser_download_url'] + puts "Download URL: #{url}" + if verify_url(url) + puts 'Current version in cookbook needs updating!' if url != current_url_in_cookbook(version) + end + else + puts ' ✗ No Linux x64 JDK found in release assets' + end + end +end + +def current_url_in_cookbook(version) + # Read the current URLs from openjdk_helpers.rb + helpers_file = File.join(File.dirname(__FILE__), '..', 'libraries', 'openjdk_helpers.rb') + content = File.read(helpers_file) + + case version + when '11' + content.match(/temurin.*when '11'\s+'(.+?)'/m)&.[](1) + when '17' + content.match(/temurin.*when '17'\s+'(.+?)'/m)&.[](1) + end +end + +if __FILE__ == $PROGRAM_NAME + check_versions +end diff --git a/bin/check_temurin_versions.sh b/bin/check_temurin_versions.sh new file mode 100755 index 00000000..3532a21f --- /dev/null +++ b/bin/check_temurin_versions.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# # Fetch latest Temurin versions from endoflife.date API +# curl --request GET \ +# --url https://endoflife.date/api/eclipse-temurin.json \ +# --header 'Accept: application/json' | jq '.' + +# Filter for LTS versions only +echo "LTS Versions:" +curl -s --request GET \ + --url https://endoflife.date/api/eclipse-temurin.json \ + --header 'Accept: application/json' | \ + jq -r '.[] | select(.lts == true) | "Java \(.cycle) (LTS) - Latest: \(.latest), EOL: \(.eol)"' diff --git a/documentation/resource_temurin_package_install.md b/documentation/resource_temurin_package_install.md new file mode 100644 index 00000000..6590c519 --- /dev/null +++ b/documentation/resource_temurin_package_install.md @@ -0,0 +1,64 @@ +# temurin_package_install + +Installs Java Temurin (AdoptOpenJDK) packages provided by Adoptium. This resource handles the repository setup and package installation for Temurin JDK packages across various platforms. + +## Actions + +- `:install` - Installs Temurin JDK packages +- `:remove` - Removes Temurin JDK packages + +## Properties + +| Property | Type | Default | Description | +|-----------------------|----------------|----------------------------------------|----------------------------------------------| +| `version` | String | Name Property | Java version to install (e.g. '8', '11', '17') | +| `pkg_name` | String | `temurin-#{version}-jdk` | Package name to install | +| `pkg_version` | String | `nil` | Package version to install | +| `java_home` | String | Platform-specific JAVA_HOME | Path to set as JAVA_HOME | +| `bin_cmds` | Array | Version-specific binary commands | Commands for alternatives | +| `alternatives_priority` | Integer | 1062 | Priority for alternatives system | +| `reset_alternatives` | Boolean | true | Whether to reset alternatives before setting | +| `default` | Boolean | true | Whether to set this as the default Java | + +## Examples + +### Install Temurin JDK 11 + +```ruby +temurin_package_install '11' +``` + +### Install Temurin JDK 17 with custom alternatives priority + +```ruby +temurin_package_install '17' do + alternatives_priority 1100 +end +``` + +### Install specific version with custom package name + +```ruby +temurin_package_install '11' do + pkg_name 'temurin-11-jdk' +end +``` + +## Platform Support + +This resource supports the following platforms: + +- Debian +- Ubuntu +- RHEL/CentOS/Rocky Linux +- Fedora +- Amazon Linux +- OpenSUSE/SLES + +Each platform will have the appropriate Adoptium repository configured automatically. + +## Notes + +- This resource uses the Adoptium API to validate available releases. +- The resource will warn if a requested version is not available as an LTS release. +- For most use cases, you can simply specify the major version number. diff --git a/documentation/resources/openjdk_pkg_install.md b/documentation/resources/openjdk_pkg_install.md index 49045cec..e177b2ed 100644 --- a/documentation/resources/openjdk_pkg_install.md +++ b/documentation/resources/openjdk_pkg_install.md @@ -19,7 +19,7 @@ Introduced: v8.1.0 | pkg_version | String | `nil` | Package version to install | | java_home | String | Based on the version | Set to override the java_home | | default | Boolean | `true` | Whether to set this as the defalut Java | -| bin_cmds | Array | `default_openjdk_bin_cmds(version)` | A list of bin_cmds based on the version and variant | +| bin_cmds | Array | `default_bin_cmds(version)` | A list of bin_cmds based on the version and variant | | alternatives_priority | Integer | `1062` | Alternatives priority to set for this Java | | reset_alternatives | Boolean | `true` | Whether to reset alternatives before setting | diff --git a/documentation/resources/openjdk_source_install.md b/documentation/resources/openjdk_source_install.md index b2ad8b5a..f14824f5 100644 --- a/documentation/resources/openjdk_source_install.md +++ b/documentation/resources/openjdk_source_install.md @@ -22,7 +22,7 @@ Introduced: v8.0.0 | java_home_owner | String | `root` | Owner of the Java Home | | java_home_group | String | `node['root_group']` | Group for the Java Home | | default | Boolean | `true` | Whether to set this as the defalut Java | -| bin_cmds | Array | `default_openjdk_bin_cmds(version)` | A list of bin_cmds based on the version and variant | +| bin_cmds | Array | `default_bin_cmds(version)` | A list of bin_cmds based on the version and variant | | alternatives_priority | Integer | `1` | Alternatives priority to set for this Java | | reset_alternatives | Boolean | `true` | Whether to reset alternatives before setting | diff --git a/kitchen.yml b/kitchen.yml index b8771bba..14ae3f34 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -48,42 +48,61 @@ suites: inputs: { java_version: "17" } # Temurin/Semeru - - name: temurin-8-hotspot + - name: temurin-8 run_list: - - recipe[test::openjdk] + - recipe[test::temurin_pkg] attributes: version: 8 - variant: hotspot verifier: - inspec_tests: [test/integration/openjdk] + inspec_tests: [test/integration/temurin] inputs: { java_version: "8" } - - name: temurin-11-hotspot + - name: temurin-11 run_list: - - recipe[test::openjdk] + - recipe[test::temurin_pkg] attributes: version: 11 - variant: hotspot verifier: - inspec_tests: [test/integration/openjdk] + inspec_tests: + - test/integration/temurin inputs: { java_version: "11" } - - name: semeru-11-openj9 + - name: temurin-17 + run_list: + - recipe[test::temurin_pkg] + attributes: + version: 17 + verifier: + inspec_tests: + - test/integration/temurin + inputs: { java_version: "17" } + + - name: temurin-21 + run_list: + - recipe[test::temurin_pkg] + attributes: + version: 21 + verifier: + inspec_tests: + - test/integration/temurin + inputs: { java_version: "21" } + + - name: semeru-11 run_list: - recipe[test::openjdk] attributes: version: 11 - variant: openj9 + variant: semeru verifier: inspec_tests: [test/integration/openjdk] inputs: { java_version: "11" } - - name: semeru-17-openj9 + - name: semeru-17 run_list: - recipe[test::openjdk] attributes: version: 17 - variant: openj9 + variant: semeru verifier: inspec_tests: [test/integration/openjdk] inputs: { java_version: "17" } diff --git a/lefthook.yml b/lefthook.yml new file mode 100644 index 00000000..bf255f83 --- /dev/null +++ b/lefthook.yml @@ -0,0 +1,8 @@ +pre-commit: + commands: + rubocop: + glob: "*.rb" + run: chef exec rubocop {staged_files} + skip: + - merge + - rebase diff --git a/libraries/bin_cmd_helpers.rb b/libraries/bin_cmd_helpers.rb new file mode 100644 index 00000000..3127b71d --- /dev/null +++ b/libraries/bin_cmd_helpers.rb @@ -0,0 +1,26 @@ +module Java + module Cookbook + module BinCmdHelpers + def default_bin_cmds(version) + case version + when '8' + %w(appletviewer extcheck idlj jar jarsigner java javac javadoc javah javap jcmd jconsole jdb jdeps 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) + when '9' + %w(appletviewer idlj jaotc jar jarsigner java javac javadoc javah javap jcmd jconsole jdb jdeprscan jdeps jhsdb jimage jinfo jjs jlink jmap jmod jps jrunscript jshell jstack jstat jstatd keytool orbd pack200 policytool rmic rmid rmiregistry schemagen serialver servertool tnameserv unpack200 wsgen wsimport xjc) + when '10' + %w(appletviewer idlj jaotc jar jarsigner java javac javadoc javap jcmd jconsole jdb jdeprscan jdeps jhsdb jimage jinfo jjs jlink jmap jmod jps jrunscript jshell jstack jstat jstatd keytool orbd pack200 rmic rmid rmiregistry schemagen serialver servertool tnameserv unpack200 wsgen wsimport xjc) + when '11' + %w(jaotc jar jarsigner java javac javadoc javap jcmd jconsole jdb jdeprscan jdeps jhsdb jimage jinfo jjs jlink jmap jmod jps jrunscript jshell jstack jstat jstatd keytool pack200 rmic rmid rmiregistry serialver unpack200) + when '12', '13', '14', '15', '16' + %w(jaotc jarsigner javac javap jconsole jdeprscan jfr jimage jjs jmap jps jshell jstat keytool rmic rmiregistry unpack200 jar java javadoc jcmd jdb jdeps jhsdb jinfo jlink jmod jrunscript jstack jstatd pack200 rmid serialver) + when '17' + %w(jarsigner javac javap jconsole jdeprscan jfr jimage jjs jmap jps jshell jstat keytool rmic rmiregistry unpack200 jar java javadoc jcmd jdb jdeps jhsdb jinfo jlink jmod jrunscript jstack jstatd pack200 rmid serialver) + when '18', '19', '20', '21', '22', 'latest' + %w(jarsigner javac javap jconsole jdeprscan jfr jimage jjs jmap jps jshell jstat keytool rmic rmiregistry unpack200 jar java javadoc jcmd jdb jdeps jhsdb jinfo jlink jmod jrunscript jstack jstatd pack200 rmid serialver jwebserver) + else + Chef::Log.fatal('Version specified does not have a default set of bin_cmds') + end + end + end + end +end diff --git a/libraries/certificate_helpers.rb b/libraries/certificate_helpers.rb index 6dad63e6..3425fc76 100644 --- a/libraries/certificate_helpers.rb +++ b/libraries/certificate_helpers.rb @@ -5,16 +5,13 @@ def default_truststore_path(version, java_home) if version.to_i > 8 "#{java_home}/lib/security/cacerts" else - "#{java_home}/jre/lib/security/cacerts" + Chef::Log.fatal('Java 8 is no longer supported') + raise 'Java 8 is no longer supported' end end - def keystore_argument(version, cacerts, truststore_path) - if version.to_i > 8 && cacerts - '-cacerts' - else - "-keystore #{truststore_path}" - end + def keystore_argument(cacerts, truststore_path) + cacerts ? '-cacerts' : "-keystore #{truststore_path}" end end end diff --git a/libraries/corretto_helpers.rb b/libraries/corretto_helpers.rb index 350e5f54..0d6a8b38 100644 --- a/libraries/corretto_helpers.rb +++ b/libraries/corretto_helpers.rb @@ -7,8 +7,6 @@ def corretto_arch def default_corretto_bin_cmds(version) case version.to_s - when '8' - %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) when '11' %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) when '15', '17', '18' @@ -20,8 +18,6 @@ def default_corretto_bin_cmds(version) def default_corretto_minor(version) case version - when '8' - '8.332.08.1' when '11' '11.0.15.9.1' when '17' diff --git a/libraries/openjdk_helpers.rb b/libraries/openjdk_helpers.rb index 362e1d52..e07851e5 100644 --- a/libraries/openjdk_helpers.rb +++ b/libraries/openjdk_helpers.rb @@ -34,71 +34,58 @@ def default_openjdk_install_method(version) end end - def default_openjdk_url(version, variant = nil) - # Always default to OpenJDK - # If the user passes variant we'll also select that variant's URL - case version - when '8' - case variant - when 'semeru' - 'https://github.com/ibmruntimes/semeru8-binaries/releases/download/jdk8u322-b06_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_8u322b06_openj9-0.30.0.tar.gz' - when 'temurin' - 'https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u322-b06/OpenJDK8U-jdk_x64_linux_hotspot_8u322b06.tar.gz' + def default_openjdk_url(version, variant = 'openjdk') + case variant.downcase + when 'temurin' + case version + when '11' + 'https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.25%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.25_9.tar.gz' + when '17' + 'https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.13%2B11/OpenJDK17U-jdk_x64_linux_hotspot_17.0.13_11.tar.gz' else Chef::Log.fatal('Version specified does not have a URL value set') raise 'Version supplied does not have a download URL set' end - when '9' - 'https://download.java.net/java/GA/jdk9/9/binaries/openjdk-9_linux-x64_bin.tar.gz' - when '10' - 'https://download.java.net/java/GA/jdk10/10/binaries/openjdk-10_linux-x64_bin.tar.gz' - when '11' - case variant - when 'semeru' + when 'semeru' + case version + when '11' 'https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.14.1%2B1_openj9-0.30.1/ibm-semeru-open-jdk_x64_linux_11.0.14.1_1_openj9-0.30.1.tar.gz' - when 'temurin' - 'https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.15_10.tar.gz' - else - 'https://download.java.net/java/ga/jdk11/openjdk-11_linux-x64_bin.tar.gz' - end - when '12' - 'https://download.java.net/java/GA/jdk12/33/GPL/openjdk-12_linux-x64_bin.tar.gz' - when '13' - 'https://download.java.net/java/GA/jdk13/5b8a42f3905b406298b72d750b6919f6/33/GPL/openjdk-13_linux-x64_bin.tar.gz' - when '14' - 'https://download.java.net/java/GA/jdk14/076bab302c7b4508975440c56f6cc26a/36/GPL/openjdk-14_linux-x64_bin.tar.gz' - when '15' - 'https://download.java.net/java/GA/jdk15/779bf45e88a44cbd9ea6621d33e33db1/36/GPL/openjdk-15_linux-x64_bin.tar.gz' - when '16' - case variant - when 'semeru' + when '16' 'https://github.com/ibmruntimes/semeru16-binaries/releases/download/jdk-16.0.2%2B7_openj9-0.27.1/ibm-semeru-open-jdk_ppc64le_linux_16.0.2_7_openj9-0.27.1.tar.gz' - when 'temurin' - 'https://github.com/adoptium/temurin16-binaries/releases/download/jdk-16.0.2%2B7/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz' - else - 'https://download.java.net/java/GA/jdk16/7863447f0ab643c585b9bdebf67c69db/36/GPL/openjdk-16_linux-x64_bin.tar.gz' - end - when '17' - case variant - when 'semeru' + when '17' 'https://github.com/ibmruntimes/semeru17-binaries/releases/download/jdk-17.0.2%2B8_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_17.0.2_8_openj9-0.30.0.tar.gz' - when 'temurin' - 'https://github.com/adoptium/temurin18-binaries/releases/download/jdk-18.0.1%2B10/OpenJDK18U-jdk_x64_linux_hotspot_18.0.1_10.tar.gz' - else - 'https://download.java.net/java/GA/jdk17/0d483333a00540d886896bac774ff48b/35/GPL/openjdk-17_linux-x64_bin.tar.gz' - end - when '18' - case variant - when 'semeru' + when '18' 'https://github.com/AdoptOpenJDK/semeru18-binaries/releases/download/jdk-18.0.1%2B10_openj9-0.32.0/ibm-semeru-open-jdk_x64_linux_18.0.1_10_openj9-0.32.0.tar.gz' - when 'temurin' - 'https://github.com/adoptium/temurin18-binaries/releases/download/jdk-18.0.1%2B10/OpenJDK18U-jdk_x64_linux_hotspot_18.0.1_10.tar.gz' else - 'https://download.java.net/java/GA/jdk18.0.1/3f48cabb83014f9fab465e280ccf630b/10/GPL/openjdk-18.0.1_linux-x64_bin.tar.gz' + Chef::Log.fatal('Version specified does not have a URL value set') + raise 'Version supplied does not have a download URL set' end else - Chef::Log.fatal('Version specified does not have a URL value set') - raise 'Version supplied does not have a download URL set' + case version + when '9' + 'https://download.java.net/java/GA/jdk9/9/binaries/openjdk-9_linux-x64_bin.tar.gz' + when '10' + 'https://download.java.net/java/GA/jdk10/10/binaries/openjdk-10_linux-x64_bin.tar.gz' + when '11' + 'https://download.java.net/java/ga/jdk11/openjdk-11_linux-x64_bin.tar.gz' + when '12' + 'https://download.java.net/java/GA/jdk12/33/GPL/openjdk-12_linux-x64_bin.tar.gz' + when '13' + 'https://download.java.net/java/GA/jdk13/5b8a42f3905b406298b72d750b6919f6/33/GPL/openjdk-13_linux-x64_bin.tar.gz' + when '14' + 'https://download.java.net/java/GA/jdk14/076bab302c7b4508975440c56f6cc26a/36/GPL/openjdk-14_linux-x64_bin.tar.gz' + when '15' + 'https://download.java.net/java/GA/jdk15/779bf45e88a44cbd9ea6621d33e33db1/36/GPL/openjdk-15_linux-x64_bin.tar.gz' + when '16' + 'https://download.java.net/java/GA/jdk16/7863447f0ab643c585b9bdebf67c69db/36/GPL/openjdk-16_linux-x64_bin.tar.gz' + when '17' + 'https://download.java.net/java/GA/jdk17/0d483333a00540d886896bac774ff48b/35/GPL/openjdk-17_linux-x64_bin.tar.gz' + when '18' + 'https://download.java.net/java/GA/jdk18.0.1/3f48cabb83014f9fab465e280ccf630b/10/GPL/openjdk-18.0.1_linux-x64_bin.tar.gz' + else + Chef::Log.fatal('Version specified does not have a URL value set') + raise 'Version supplied does not have a download URL set' + end end end @@ -128,25 +115,6 @@ def default_openjdk_checksum(version) end end - def default_openjdk_bin_cmds(version) - case version - when '7' - %w(appletviewer apt ControlPanel extcheck idlj jar jarsigner java javac javadoc javafxpackager javah javap javaws jcmd jconsole jcontrol jdb jdeps jhat jinfo jjs jmap jmc jps jrunscript jsadebugd jstack jstat jstatd jvisualvm keytool native2ascii orbd pack200 policytool rmic rmid rmiregistry schemagen serialver servertool tnameserv unpack200 wsgen wsimport xjc) - when '8' - %w(appletviewer apt ControlPanel extcheck idlj jar jarsigner java javac javadoc javafxpackager javah javap javaws jcmd jconsole jcontrol jdb jdeps jhat jinfo jjs jmap jmc jps jrunscript jsadebugd jstack jstat jstatd jvisualvm keytool native2ascii orbd pack200 policytool rmic rmid rmiregistry schemagen serialver servertool tnameserv unpack200 wsgen wsimport xjc) - when '9' - %w(appletviewer idlj jaotc jar jarsigner java javac javadoc javah javap jcmd jconsole jdb jdeprscan jdeps jhsdb jimage jinfo jjs jlink jmap jmod jps jrunscript jshell jstack jstat jstatd keytool orbd pack200 policytool rmic rmid rmiregistry schemagen serialver servertool tnameserv unpack200 wsgen wsimport xjc) - when '10' - %w(appletviewer idlj jaotc jar jarsigner java javac javadoc javap jcmd jconsole jdb jdeprscan jdeps jhsdb jimage jinfo jjs jlink jmap jmod jps jrunscript jshell jstack jstat jstatd keytool orbd pack200 rmic rmid rmiregistry schemagen serialver servertool tnameserv unpack200 wsgen wsimport xjc) - when '11' - %w(jaotc jar jarsigner java javac javadoc javap jcmd jconsole jdb jdeprscan jdeps jhsdb jimage jinfo jjs jlink jmap jmod jps jrunscript jshell jstack jstat jstatd keytool pack200 rmic rmid rmiregistry serialver unpack200) - when '12', '13', '14', '15', '16', '17', '19', '20', '21', '22', 'latest' - %w(jaotc jarsigner javac javap jconsole jdeprscan jfr jimage jjs jmap jps jshell jstat keytool rmic rmiregistry unpack200 jar java javadoc jcmd jdb jdeps jhsdb jinfo jlink jmod jrunscript jstack jstatd pack200 rmid serialver) - else - Chef::Log.fatal('Version specified does not have a default set of bin_cmds') - end - end - def default_openjdk_pkg_names(version) value_for_platform_family( amazon: ["java-1.#{version}.0-openjdk", "java-1.#{version}.0-openjdk-devel"], @@ -160,13 +128,30 @@ def default_openjdk_pkg_names(version) end def default_openjdk_pkg_java_home(version) + # For both standard OpenJDK and Temurin/Semeru variants, use the standard OpenJDK paths + # Temurin and Semeru variants are installed using package managers with standard paths + + # Map architecture to the correct suffix used in Java paths + arch = case node['kernel']['machine'] + when 'x86_64' + 'amd64' + when 'aarch64', 'arm64' + 'arm64' + when 'i386', 'i686' + 'i386' + else + node['kernel']['machine'] + end + + # For Debian-based systems, Temurin and standard OpenJDK use the same path structure + # with architecture-specific suffixes value_for_platform_family( %w(rhel fedora) => version.to_i < 11 ? "/usr/lib/jvm/java-1.#{version}.0" : "/usr/lib/jvm/java-#{version}", amazon: version.to_i < 11 ? "/usr/lib/jvm/java-1.#{version}.0" : "/usr/lib/jvm/jre-#{version}", suse: "/usr/lib#{node['kernel']['machine'] == 'x86_64' ? '64' : nil}/jvm/java-#{version.to_i == 8 ? "1.#{version}.0" : version}", freebsd: "/usr/local/openjdk#{version}", arch: "/usr/lib/jvm/java-#{version}-openjdk", - debian: "/usr/lib/jvm/java-#{version}-openjdk-#{node['kernel']['machine'] == 'x86_64' ? 'amd64' : 'i386'}", + debian: "/usr/lib/jvm/java-#{version}-openjdk-#{arch}", default: '/usr/lib/jvm/default-java' ) end diff --git a/libraries/temurin_helpers.rb b/libraries/temurin_helpers.rb new file mode 100644 index 00000000..87a2e210 --- /dev/null +++ b/libraries/temurin_helpers.rb @@ -0,0 +1,54 @@ +module Java + module Cookbook + module TemurinHelpers + # Fetch available Temurin releases from Adoptium API + def available_temurin_releases + require 'net/http' + require 'json' + require 'uri' + + uri = URI('https://api.adoptium.net/v3/info/available_releases') + response = Net::HTTP.get_response(uri) + + if response.is_a?(Net::HTTPSuccess) + releases = JSON.parse(response.body) + Chef::Log.info("Available Temurin releases: #{releases}") + releases + else + Chef::Log.warn("Failed to fetch Temurin releases: #{response.code} #{response.message}") + {} + end + rescue => e + Chef::Log.warn("Error fetching Temurin releases: #{e.message}") + {} + end + + # Get available LTS versions + def temurin_lts_versions + releases = available_temurin_releases + return [] unless releases.is_a?(Hash) && releases.key?('available_lts_releases') + + releases['available_lts_releases'] + end + + # Get latest LTS version + def temurin_latest_lts + lts = temurin_lts_versions + lts.empty? ? '17' : lts.max.to_s + end + + # Helper to determine if a version is available as LTS + def temurin_version_available?(version) + version = version.to_s + lts = temurin_lts_versions + + return true if lts.include?(version.to_i) + false + end + end + end +end + +# Ensure the helper is included in the recipe DSL +Chef::DSL::Recipe.include Java::Cookbook::TemurinHelpers +Chef::Resource.include Java::Cookbook::TemurinHelpers diff --git a/resources/alternatives.rb b/resources/alternatives.rb index bb5b820a..06f680d7 100644 --- a/resources/alternatives.rb +++ b/resources/alternatives.rb @@ -20,11 +20,36 @@ property :reset_alternatives, [true, false], - default: true, + default: false, description: 'Whether to reset alternatives before setting them' action :set do - if new_resource.bin_cmds + bin_cmds_to_setup = parse_java_alternatives + # Use not_if guard to make resource fully idempotent + set_alternatives(bin_cmds_to_setup) do |cmd, alt_path| + # Skip if the alternative file already exists with our path + alternative_exists = ::File.exist?("/var/lib/alternatives/#{cmd}") && + shell_out("#{alternatives_cmd} --display #{cmd}").stdout.include?(alt_path) + Chef::Log.debug("Alternative for #{cmd} exists with correct path? #{alternative_exists}") + alternative_exists + end +end + +action :unset do + new_resource.bin_cmds.each do |cmd| + converge_by("Remove alternative for #{cmd}") do + shell_out("#{alternatives_cmd} --remove #{cmd} #{new_resource.java_location}/bin/#{cmd}") + end + end +end + +action_class do + def alternatives_cmd + platform_family?('rhel', 'fedora', 'amazon') ? 'alternatives' : 'update-alternatives' + end + + def parse_java_alternatives + bin_cmds_to_setup = [] new_resource.bin_cmds.each do |cmd| bin_path = "/usr/bin/#{cmd}" alt_path = "#{new_resource.java_location}/bin/#{cmd}" @@ -35,24 +60,55 @@ next end - alternative_exists_same_priority = shell_out("#{alternatives_cmd} --display #{cmd} | grep #{alt_path} | grep 'priority #{priority}$'").exitstatus == 0 - alternative_exists = shell_out("#{alternatives_cmd} --display #{cmd} | grep #{alt_path}").exitstatus == 0 - # remove alternative if priority is changed and install it with new priority - if alternative_exists && !alternative_exists_same_priority - converge_by("Removing alternative for #{cmd} with old priority") do - Chef::Log.debug "Removing alternative for #{cmd} with old priority" + # Add this command to the list of commands to process + bin_cmds_to_setup << [cmd, bin_path, alt_path, priority] + end + bin_cmds_to_setup + end + + def set_alternatives(bin_cmds) + bin_cmds.each do |cmd, bin_path, alt_path, priority| + # Use a custom not_if condition if provided as a block + if block_given? && yield(cmd, alt_path) + Chef::Log.debug "Skipping alternative for #{cmd} as it already exists with correct path" + next + end + + # Get the full output of update-alternatives for this command + display_result = shell_out("#{alternatives_cmd} --display #{cmd}") + cmd_output = display_result.stdout + + # Check if the alternative exists at all + alternative_system_exists = display_result.exitstatus == 0 && !cmd_output.empty? + + # Check if our specific path is already configured as an alternative + our_alternative_exists = alternative_system_exists && cmd_output.include?(alt_path) + + # Parse the priority of the existing alternative + existing_priority = nil + if our_alternative_exists + if cmd_output =~ /#{Regexp.escape(alt_path)}.*priority\s+(\d+)/ + existing_priority = Regexp.last_match(1).to_i + end + end + + # Only remove alternative if it exists with a different priority + if our_alternative_exists && existing_priority && existing_priority != priority + converge_by("Removing alternative for #{cmd} with old priority #{existing_priority}") do remove_cmd = shell_out("#{alternatives_cmd} --remove #{cmd} #{alt_path}") - alternative_exists = false unless remove_cmd.exitstatus == 0 raise(%( remove alternative failed )) end end end - # install the alternative if needed - unless alternative_exists + + # Check if the alternative file exists at all + alternative_file_exists = ::File.exist?("/var/lib/alternatives/#{cmd}") + + # Install the alternative if needed + if !our_alternative_exists || !alternative_file_exists converge_by("Add alternative for #{cmd}") do - Chef::Log.debug "Adding alternative for #{cmd}" - if new_resource.reset_alternatives + if new_resource.reset_alternatives && alternative_file_exists shell_out("rm /var/lib/alternatives/#{cmd}") end install_cmd = shell_out("#{alternatives_cmd} --install #{bin_path} #{cmd} #{alt_path} #{priority}") diff --git a/resources/certificate.rb b/resources/certificate.rb index 1c5286fe..62053219 100644 --- a/resources/certificate.rb +++ b/resources/certificate.rb @@ -56,7 +56,7 @@ action :install do require 'openssl' - keystore_argument = keystore_argument(new_resource.java_version, new_resource.cacerts, new_resource.keystore_path) + keystore_argument = keystore_argument(new_resource.cacerts, new_resource.keystore_path) certdata = new_resource.cert_data || fetch_certdata @@ -107,7 +107,7 @@ end action :remove do - keystore_argument = keystore_argument(new_resource.java_version, new_resource.cacerts, new_resource.keystore_path) + keystore_argument = keystore_argument(new_resource.cacerts, new_resource.keystore_path) cmd = Mixlib::ShellOut.new("#{new_resource.java_home}/bin/keytool -list #{keystore_argument} -storepass #{new_resource.keystore_passwd} -v | grep \"#{new_resource.cert_alias}\"") cmd.run_command diff --git a/resources/openjdk_install.rb b/resources/openjdk_install.rb index 137a13b2..07cf0f52 100644 --- a/resources/openjdk_install.rb +++ b/resources/openjdk_install.rb @@ -1,6 +1,7 @@ provides :openjdk_install unified_mode true include Java::Cookbook::OpenJdkHelpers +include Java::Cookbook::BinCmdHelpers property :install_type, String, @@ -22,6 +23,7 @@ property :bin_cmds, Array, + default: lazy { default_bin_cmds(version) }, description: 'A list of bin_cmds based on the version and variant' property :url, @@ -35,6 +37,7 @@ use 'partial/_common' use 'partial/_linux' use 'partial/_java_home' +use 'partial/_openjdk' action :install do if new_resource.install_type == 'package' diff --git a/resources/openjdk_pkg_install.rb b/resources/openjdk_pkg_install.rb index 8c191320..1c88ddd8 100644 --- a/resources/openjdk_pkg_install.rb +++ b/resources/openjdk_pkg_install.rb @@ -1,6 +1,7 @@ provides :openjdk_pkg_install unified_mode true include Java::Cookbook::OpenJdkHelpers +include Java::Cookbook::BinCmdHelpers property :pkg_names, [String, Array], default: lazy { default_openjdk_pkg_names(version) }, @@ -14,7 +15,7 @@ description: 'Set to override the java_home' property :bin_cmds, Array, - default: lazy { default_openjdk_bin_cmds(version) }, + default: lazy { default_bin_cmds(version) }, description: 'A list of bin_cmds based on the version and variant' property :alternatives_priority, Integer, @@ -23,6 +24,7 @@ use 'partial/_common' use 'partial/_linux' +use 'partial/_openjdk' action :install do if platform?('ubuntu') diff --git a/resources/openjdk_source_install.rb b/resources/openjdk_source_install.rb index d27cf20c..f1caca57 100644 --- a/resources/openjdk_source_install.rb +++ b/resources/openjdk_source_install.rb @@ -1,16 +1,12 @@ provides :openjdk_source_install unified_mode true include Java::Cookbook::OpenJdkHelpers +include Java::Cookbook::BinCmdHelpers property :version, String, name_property: true, description: 'Java version to install' -property :variant, String, - equal_to: %w(openjdk semeru temurin), - default: 'openjdk', - description: 'Install flavour' - property :url, String, default: lazy { default_openjdk_url(version, variant) }, description: 'The URL to download from' @@ -25,12 +21,13 @@ description: 'Set to override the java_home' property :bin_cmds, Array, - default: lazy { default_openjdk_bin_cmds(version) }, + default: lazy { default_bin_cmds(version) }, description: 'A list of bin_cmds based on the version and variant' use 'partial/_common' use 'partial/_linux' use 'partial/_java_home' +use 'partial/_openjdk' action :install do extract_dir = new_resource.java_home.split('/')[0..-2].join('/') diff --git a/resources/partial/_openjdk.rb b/resources/partial/_openjdk.rb new file mode 100644 index 00000000..a0c93f3e --- /dev/null +++ b/resources/partial/_openjdk.rb @@ -0,0 +1,4 @@ +property :variant, String, + equal_to: %w(openjdk semeru temurin), + default: 'openjdk', + description: 'Install flavour' diff --git a/resources/temurin_package_install.rb b/resources/temurin_package_install.rb new file mode 100644 index 00000000..9dd5228f --- /dev/null +++ b/resources/temurin_package_install.rb @@ -0,0 +1,114 @@ +provides :temurin_package_install +unified_mode true +include Java::Cookbook::OpenJdkHelpers +include Java::Cookbook::TemurinHelpers +include Java::Cookbook::BinCmdHelpers + +def default_temurin_pkg_name(version) + # Validate version against available releases + unless temurin_version_available?(version) + Chef::Log.warn("Temurin version #{version} might not be available. Available LTS versions: #{temurin_lts_versions.join(', ')}") + end + "temurin-#{version}-jdk" +end + +property :pkg_name, String, + default: lazy { default_temurin_pkg_name(version) }, + description: 'Package name to install' + +property :pkg_version, String, + description: 'Package version to install' + +property :java_home, String, + default: lazy { "/usr/lib/jvm/temurin-#{version}-jdk" }, + description: 'Set to override the java_home' + +property :bin_cmds, Array, + default: lazy { default_bin_cmds(version) }, + description: 'A list of bin_cmds based on the version' + +use 'partial/_common' +use 'partial/_linux' + +action :install do + apt_repository 'adoptium' do + uri 'https://packages.adoptium.net/artifactory/deb' + components ['main'] + distribution lazy { node['lsb']['codename'] || node['debian']['distribution_codename'] } + # TODO: https://github.com/chef/chef/pull/15043 + # key '843C48A565F8F04B' + # keyserver 'keyserver.ubuntu.com' + signed_by false + trusted true + only_if { platform_family?('debian') } + end + + yum_repository 'adoptium' do + description 'Eclipse Adoptium' + baseurl value_for_platform( + 'amazon' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/amazonlinux/2/$basearch' }, + 'centos' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/centos/$releasever/$basearch' }, + 'fedora' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/fedora/$releasever/$basearch' }, + 'opensuse' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/opensuse/$releasever/$basearch' }, + 'oracle' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/oraclelinux/$releasever/$basearch' }, + 'redhat' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/rhel/$releasever/$basearch' }, + 'rocky' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/rocky/8/$basearch' }, + 'suse' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/sles/$releasever/$basearch' } + ) + enabled true + gpgcheck true + gpgkey 'https://packages.adoptium.net/artifactory/api/gpg/key/public' + only_if { platform_family?('rhel', 'fedora', 'amazon', 'rocky', 'suse', 'oraclelinux') } + end + + zypper_repository 'adoptium' do + description 'Eclipse Adoptium' + baseurl 'https://packages.adoptium.net/artifactory/rpm/opensuse/$releasever/$basearch' + gpgcheck true + gpgkey 'https://packages.adoptium.net/artifactory/api/gpg/key/public' + action :create + only_if { platform_family?('suse') } + end + + package new_resource.pkg_name do + version new_resource.pkg_version if new_resource.pkg_version + end + + node.default['java']['java_home'] = new_resource.java_home + + java_alternatives 'set-java-alternatives' do + java_location new_resource.java_home + bin_cmds new_resource.bin_cmds + priority new_resource.alternatives_priority + default new_resource.default + reset_alternatives new_resource.reset_alternatives + end +end + +action :remove do + java_alternatives 'unset-java-alternatives' do + java_location new_resource.java_home + bin_cmds new_resource.bin_cmds + only_if { ::File.exist?(new_resource.java_home) } + action :unset + end + + package new_resource.pkg_name do + action :remove + end + + apt_repository 'adoptium' do + action :remove + only_if { platform_family?('debian') } + end + + yum_repository 'adoptium' do + action :remove + only_if { platform_family?('rhel', 'fedora', 'amazon', 'rocky', 'suse', 'oraclelinux') } + end + + zypper_repository 'adoptium' do + action :remove + only_if { platform_family?('suse') } + end +end diff --git a/spec/libraries/certificate_helpers_spec.rb b/spec/libraries/certificate_helpers_spec.rb index 926f8f3e..59fd240f 100644 --- a/spec/libraries/certificate_helpers_spec.rb +++ b/spec/libraries/certificate_helpers_spec.rb @@ -8,15 +8,6 @@ class DummyClass < Chef::Node subject { DummyClass.new } describe '#default_truststore_path' do - context 'Java 8' do - let(:version) { '8' } - let(:java_home) { '/usr/lib/jvm/corretto-8' } - - it 'returns the correct path' do - expect(subject.default_truststore_path(version, java_home)).to eq('/usr/lib/jvm/corretto-8/jre/lib/security/cacerts') - end - end - context 'Java 9' do let(:version) { '9' } let(:java_home) { '/usr/lib/jvm/corretto-9' } @@ -28,33 +19,21 @@ class DummyClass < Chef::Node end describe '#keystore_argument' do - context 'Java 8 and cacerts' do - let(:version) { '8' } - let(:cacerts) { true } - let(:truststore_path) { '/usr/lib/jvm/corretto-8/jre/lib/security/cacerts' } - - it 'returns the correct argument' do - expect(subject.keystore_argument(version, cacerts, truststore_path)).to eq('-keystore /usr/lib/jvm/corretto-8/jre/lib/security/cacerts') - end - end - - context 'Java 9 and cacerts' do - let(:version) { '9' } + context 'cacerts set ' do let(:cacerts) { true } let(:truststore_path) { '/usr/lib/jvm/corretto-9/jre/lib/security/cacerts' } it 'returns the correct argument' do - expect(subject.keystore_argument(version, cacerts, truststore_path)).to eq('-cacerts') + expect(subject.keystore_argument(cacerts, truststore_path)).to eq('-cacerts') end end - context 'Java 9 and no cacerts' do - let(:version) { '9' } + context 'no cacerts' do let(:cacerts) { false } let(:truststore_path) { '/mycertstore.jks' } it 'returns the correct argument' do - expect(subject.keystore_argument(version, cacerts, truststore_path)).to eq('-keystore /mycertstore.jks') + expect(subject.keystore_argument(cacerts, truststore_path)).to eq('-keystore /mycertstore.jks') end end end diff --git a/spec/libraries/corretto_helpers_spec.rb b/spec/libraries/corretto_helpers_spec.rb index c7239dad..152f7077 100644 --- a/spec/libraries/corretto_helpers_spec.rb +++ b/spec/libraries/corretto_helpers_spec.rb @@ -13,15 +13,6 @@ class DummyClass < Chef::Node allow(subject).to receive(:[]).with('kernel').and_return('machine' => machine) end - context 'Corretto 8 x64' do - let(:version) { '8' } - let(:machine) { 'x86_64' } - - it 'returns the correct URL' do - expect(subject.default_corretto_url(version)).to match /corretto-8.+\.tar.gz/ - end - end - context 'Corretto 11 x64' do let(:version) { '11' } let(:machine) { 'x86_64' } @@ -49,15 +40,6 @@ class DummyClass < Chef::Node end end - context 'Corretto 8 aarch64' do - let(:version) { '8' } - let(:machine) { 'aarch64' } - - it 'returns the correct URL' do - expect(subject.default_corretto_url(version)).to match /corretto-8.+\.tar.gz/ - end - end - context 'Corretto 11 aarch64' do let(:version) { '11' } let(:machine) { 'aarch64' } @@ -91,15 +73,6 @@ class DummyClass < Chef::Node allow(subject).to receive(:[]).with('version').and_return(version) end - context 'Corretto 8' do - let(:version) { '8' } - - it 'returns the correct bin command array' do - expect(subject.default_corretto_bin_cmds(version)).to include 'appletviewer' - expect(subject.default_corretto_bin_cmds(version)).to_not include 'jaotc' - end - end - context 'Corretto 11' do let(:version) { '11' } @@ -133,24 +106,6 @@ class DummyClass < Chef::Node allow(subject).to receive(:[]).with('kernel').and_return('machine' => machine) end - context 'No full_version passed for Corretto 8 x64' do - let(:version) { '8' } - let(:machine) { 'x86_64' } - - it 'returns the default directory value for Corrretto 8 x64' do - expect(subject.corretto_sub_dir(version)).to include '8.332.08.1' - end - end - - context 'No full_version passed for Corretto 8 aarch64' do - let(:version) { '8' } - let(:machine) { 'aarch64' } - - it 'returns the default directory value for Corrretto 8 aarch64' do - expect(subject.corretto_sub_dir(version)).to include '8.332.08.1' - end - end - context 'No full_version passed for Corretto 11 x64' do let(:version) { '11' } let(:machine) { 'x86_64' } @@ -204,26 +159,6 @@ class DummyClass < Chef::Node expect(subject.corretto_sub_dir(version)).to include '18.0.1.10.1' end end - - context 'A full version passed for for Corretto 8 x64' do - let(:version) { '8' } - let(:full_version) { '8.123.45.6' } - let(:machine) { 'x86_64' } - - it 'returns the default directory value for Corrretto 8 x64' do - expect(subject.corretto_sub_dir(version, full_version)).to include '8.123.45.6' - end - end - - context 'A full version passed for for Corretto 8 aarch64' do - let(:version) { '8' } - let(:full_version) { '8.123.45.6' } - let(:machine) { 'aarch64' } - - it 'returns the default directory value for Corrretto 8 aarch64' do - expect(subject.corretto_sub_dir(version, full_version)).to include '8.123.45.6' - end - end end end end diff --git a/spec/libraries/openjdk_helpers_spec.rb b/spec/libraries/openjdk_helpers_spec.rb index f57d4724..e541ffdf 100644 --- a/spec/libraries/openjdk_helpers_spec.rb +++ b/spec/libraries/openjdk_helpers_spec.rb @@ -34,6 +34,20 @@ class DummyClass < Chef::Node .to raise_error('Version supplied does not have a download URL set') end end + + context 'Temurin' do + let(:version) { '17' } + + it 'returns the correct download URL for Temurin' do + expect(subject.default_openjdk_url(version, 'temurin')) + .to eq 'https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.13%2B11/OpenJDK17U-jdk_x64_linux_hotspot_17.0.13_11.tar.gz' + end + + it 'returns the correct download URL for Temurin 11' do + expect(subject.default_openjdk_url('11', 'temurin')) + .to eq 'https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.25%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.25_9.tar.gz' + end + end end describe '#default_openjdk_install_method' do diff --git a/spec/libraries/semeru_helpers_spec.rb b/spec/libraries/semeru_helpers_spec.rb index 8910a555..c608a783 100644 --- a/spec/libraries/semeru_helpers_spec.rb +++ b/spec/libraries/semeru_helpers_spec.rb @@ -12,11 +12,11 @@ class DummyClass < Chef::Node allow(subject).to receive(:[]).with('url').and_return(url) end - context 'OpenJDK Semeru 8' do - let(:url) { 'https://github.com/ibmruntimes/semeru8-binaries/releases/download/jdk8u322-b06_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_8u322b06_openj9-0.30.0.tar.gz' } + context 'OpenJDK Semeru 17' do + let(:url) { 'https://github.com/ibmruntimes/semeru17-binaries/releases/download/jdk-17.0.2%2B8_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_17.0.2_8_openj9-0.30.0.tar.gz' } it 'returns the correct folder name' do - expect(subject.sub_dir(url)).to eq 'jdk8u322-b06' + expect(subject.sub_dir(url)).to eq 'jdk-17.0.2-b8' end end @@ -34,15 +34,6 @@ class DummyClass < Chef::Node allow(subject).to receive(:[]).with('version').and_return(version) end - context 'Semeru 8' do - let(:version) { '8' } - let(:variant) { 'semeru' } - - it 'returns the correct URL' do - expect(subject.default_openjdk_url(version, variant)).to eq 'https://github.com/ibmruntimes/semeru8-binaries/releases/download/jdk8u322-b06_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_8u322b06_openj9-0.30.0.tar.gz' - end - end - context 'Semeru 11' do let(:version) { '11' } let(:variant) { 'semeru' } diff --git a/test/fixtures/cookbooks/test/recipes/openjdk.rb b/test/fixtures/cookbooks/test/recipes/openjdk.rb index 6fea755a..7da43653 100644 --- a/test/fixtures/cookbooks/test/recipes/openjdk.rb +++ b/test/fixtures/cookbooks/test/recipes/openjdk.rb @@ -1,8 +1,6 @@ -openjdk_install node['version'] do +# Test recipe for verifying installation paths +# This focuses only on path verification, avoiding non-idempotent operations + +openjdk_install node['version'].to_s do variant node['variant'] if node['variant'] end - -# openjdk || semeru || temurin -# openjdk OpenJ9 || hotspot - -include_recipe 'test::java_cert' diff --git a/test/fixtures/cookbooks/test/recipes/temurin_pkg.rb b/test/fixtures/cookbooks/test/recipes/temurin_pkg.rb new file mode 100644 index 00000000..a502a752 --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/temurin_pkg.rb @@ -0,0 +1,4 @@ +# This recipe tests the temurin_package_install resource +# It should install temurin java packages based on the version specified + +temurin_package_install node['version'] diff --git a/test/integration/openjdk/controls/verify_openjdk.rb b/test/integration/openjdk/controls/verify_openjdk.rb index a2b6fe08..64e62479 100644 --- a/test/integration/openjdk/controls/verify_openjdk.rb +++ b/test/integration/openjdk/controls/verify_openjdk.rb @@ -7,8 +7,27 @@ describe command('java -version 2>&1') do its('stdout') { should match java_version.to_s } end +end + +control 'Java path is correct' do + impact 1.0 + title 'Path Verification' + desc 'Verifies that keytool and other binaries are accessible in the correct paths using update-alternatives' + + # Get architecture suffix + arch_suffix = command('uname -m').stdout.strip == 'x86_64' ? 'amd64' : 'arm64' describe command('update-alternatives --display jar') do its('stdout') { should match %r{/usr/lib/jvm/java} } end + + describe command('update-alternatives --display java') do + its('stdout') { should match %r{/usr/lib/jvm/java-#{java_version}-openjdk-#{arch_suffix}/bin/java} } + end + + describe command('update-alternatives --display keytool') do + its('stdout') { should match %r{link best version is /usr/lib/jvm/java-#{java_version}-openjdk-#{arch_suffix}/bin/keytool} } + its('stdout') { should match %r{link keytool is /usr/bin/keytool} } + its('stdout') { should match /priority 1/ } + end end diff --git a/test/integration/temurin/controls/verify_temurin.rb b/test/integration/temurin/controls/verify_temurin.rb new file mode 100644 index 00000000..64850472 --- /dev/null +++ b/test/integration/temurin/controls/verify_temurin.rb @@ -0,0 +1,57 @@ +java_version = input('java_version', description: 'Which version of java should be installed') + +control 'Temurin Java is installed & linked correctly' do + impact 1.0 + title 'Installed' + desc 'Temurin Java is installed & linked correctly' + + describe command('java -version 2>&1') do + its('stdout') { should match(java_version.to_s) } + its('stdout') { should match(/Temurin/) } + end +end + +control 'Temurin Java path is correct' do + impact 1.0 + title 'Path Verification' + desc 'Verifies that keytool and other binaries are accessible in the correct paths using update-alternatives' + + # Handle architecture-specific paths + describe command('update-alternatives --display jar') do + its('stdout') { should match %r{/usr/lib/jvm/temurin-#{java_version}-jdk(-[a-z0-9]+)?/bin/jar} } + end + + describe command('update-alternatives --display java') do + its('stdout') { should match %r{/usr/lib/jvm/temurin-#{java_version}-jdk(-[a-z0-9]+)?/bin/java} } + end + + describe command('update-alternatives --display keytool') do + # Check for architecture-specific paths with regex that allows for optional architecture suffix + its('stdout') { should match %r{/usr/lib/jvm/temurin-#{java_version}-jdk(-[a-z0-9]+)?/bin/keytool} } + its('stdout') { should match(/priority/) } + end +end + +control 'Adoptium repository is properly configured' do + impact 1.0 + title 'Repository Configuration' + desc 'Verifies that the Adoptium repository is properly configured' + + # Handle platform detection more robustly + if os.family == 'debian' + describe file('/etc/apt/sources.list.d/adoptium.list') do + it { should exist } + its('content') { should match(/packages.adoptium.net/) } + end + elsif os.family == 'redhat' || os.family == 'fedora' || os.name == 'amazon' + describe file('/etc/yum.repos.d/adoptium.repo') do + it { should exist } + its('content') { should match(/packages.adoptium.net/) } + end + elsif os.family == 'suse' + describe file('/etc/zypp/repos.d/adoptium.repo') do + it { should exist } + its('content') { should match(/packages.adoptium.net/) } + end + end +end diff --git a/test/integration/temurin/inspec.yml b/test/integration/temurin/inspec.yml new file mode 100644 index 00000000..7b558efa --- /dev/null +++ b/test/integration/temurin/inspec.yml @@ -0,0 +1,6 @@ +name: temurin +title: Temurin Java Installation +maintainer: Sous Chefs +copyright: Sous Chefs +license: Apache-2.0 +version: 1.0.0 From 1e1ed94c859da73ebd05dd9591e5431e61140e61 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Sun, 13 Jul 2025 21:16:01 +0100 Subject: [PATCH 151/188] Update changelog for 13.0.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e03c615..74aa4b34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 13.0.0 - *2025-07-13* - Add new resource `temurin_package_install` - Add script to check for Java updates From 6e481b47a3bf30ee443f184228779ab85d71826f Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Sun, 13 Jul 2025 21:16:02 +0100 Subject: [PATCH 152/188] Update metadata for 13.0.0 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 5ac8b3f3..64625e4f 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '12.1.1' +version '13.0.0' supports 'debian' supports 'ubuntu' From 7b7c3d9053c16b97cb033204a45367685f72725b Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Sun, 13 Jul 2025 21:16:05 +0100 Subject: [PATCH 153/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74aa4b34..9030190b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 13.0.0 - *2025-07-13* - Add new resource `temurin_package_install` From c1e613b29ee7e357ff1fc4042725ae6d676f9d20 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Mon, 14 Jul 2025 09:37:23 +0100 Subject: [PATCH 154/188] feat: Add skip_alternatives (@dschlenk) (#727) - Add skip_alternatives for cases when management of alternatives is not desired - Update documentation for resources Signed-off-by: Dan Webb --- CHANGELOG.md | 2 ++ documentation/resources/corretto_install.md | 9 ++++++++- documentation/resources/openjdk_install.md | 5 ++++- .../resources/openjdk_pkg_install.md | 9 ++++++++- .../resources/openjdk_source_install.md | 7 +++++-- .../temurin_package_install.md} | 19 +++++++++++++++++++ resources/corretto_install.rb | 2 +- resources/openjdk_install.rb | 4 ++++ resources/openjdk_pkg_install.rb | 1 + resources/openjdk_source_install.rb | 2 ++ resources/partial/_common.rb | 4 ++++ resources/temurin_package_install.rb | 2 ++ 12 files changed, 60 insertions(+), 6 deletions(-) rename documentation/{resource_temurin_package_install.md => resources/temurin_package_install.md} (70%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9030190b..f2fc8f80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +- add `skip_alternatives` to resources `corretto_install`, `openjdk_install`, `openjdk_pkg_install`, `openjdk_source_install` for cases when management of alternatives is not desired. (@dschlenk) + ## 13.0.0 - *2025-07-13* - Add new resource `temurin_package_install` diff --git a/documentation/resources/corretto_install.md b/documentation/resources/corretto_install.md index 2bf76155..2c078524 100644 --- a/documentation/resources/corretto_install.md +++ b/documentation/resources/corretto_install.md @@ -3,6 +3,8 @@ [back to resource list](https://github.com/sous-chefs/java#resources) +Installs Amazon Corretto Java distribution. This resource handles downloading, extracting and configuring Amazon's Corretto distribution of OpenJDK, including setting up Java home directories and configuring system alternatives. + Introduced: v8.0.0 ## Actions @@ -22,10 +24,11 @@ Introduced: v8.0.0 | java_home_mode | Integer, String | `0755` | The permission for the Java home directory | | java_home_owner | String | `root` | Owner of the Java Home | | java_home_group | String | `node['root_group']` | Group for the Java Home | -| default | Boolean | `true` | Whether to set this as the defalut Java | +| default | Boolean | `true` | Whether to set this as the default Java | | bin_cmds | Array | `default_corretto_bin_cmds(version)` | A list of bin_cmds based on the version and variant | | alternatives_priority | Integer | `1` | Alternatives priority to set for this Java | | reset_alternatives | Boolean | `true` | Whether to reset alternatives before setting | +| skip_alternatives | Boolean | `false` | Skip alternatives installation completely | ## Examples @@ -42,3 +45,7 @@ corretto_install '8' do alternatives_priority 2 end ``` + +## Architecture Support + +This resource supports installation on both x86_64 and ARM64 architectures. Amazon Corretto provides architecture-specific builds and the resource automatically handles the correct paths and downloads for the target platform. diff --git a/documentation/resources/openjdk_install.md b/documentation/resources/openjdk_install.md index afe02fcb..b9185b15 100644 --- a/documentation/resources/openjdk_install.md +++ b/documentation/resources/openjdk_install.md @@ -3,6 +3,8 @@ [back to resource list](https://github.com/sous-chefs/java#resources) +Installs OpenJDK Java via source or package manager. This resource selects the appropriate installation method based on the `install_type` property and handles cross-platform Java installation including alternatives configuration. + Introduced: v8.0.0 ## Actions @@ -21,10 +23,11 @@ Introduced: v8.0.0 | java_home_mode | Integer, String | | The permission for the Java home directory | | | java_home_owner | String | | Owner of the Java Home | | | java_home_group | String | | Group for the Java Home | | -| default | Boolean | | Whether to set this as the defalut Java | | +| default | Boolean | | Whether to set this as the default Java | | | bin_cmds | Array | | A list of bin_cmds based on the version and variant | | | alternatives_priority | Integer | | Alternatives priority to set for this Java | | | reset_alternatives | Boolean | | Whether to reset alternatives before setting | | +| skip_alternatives | Boolean | `false` | Skip alternatives installation completely | | | pkg_names | Array | | List of packages to install | | | pkg_version | String | | Package version to install | | | install_type | String | | Installation type | `package` `source` | diff --git a/documentation/resources/openjdk_pkg_install.md b/documentation/resources/openjdk_pkg_install.md index e177b2ed..9bdeecb3 100644 --- a/documentation/resources/openjdk_pkg_install.md +++ b/documentation/resources/openjdk_pkg_install.md @@ -3,6 +3,8 @@ [back to resource list](https://github.com/sous-chefs/java#resources) +Installs OpenJDK Java packages from the system's package manager. This resource handles platform-specific package installation for OpenJDK across different Linux distributions and versions, and configures the alternatives system appropriately. + Introduced: v8.1.0 ## Actions @@ -18,10 +20,11 @@ Introduced: v8.1.0 | pkg_names | Array | `default_openjdk_pkg_names(version)` | List of packages to install | | pkg_version | String | `nil` | Package version to install | | java_home | String | Based on the version | Set to override the java_home | -| default | Boolean | `true` | Whether to set this as the defalut Java | +| default | Boolean | `true` | Whether to set this as the default Java | | bin_cmds | Array | `default_bin_cmds(version)` | A list of bin_cmds based on the version and variant | | alternatives_priority | Integer | `1062` | Alternatives priority to set for this Java | | reset_alternatives | Boolean | `true` | Whether to reset alternatives before setting | +| skip_alternatives | Boolean | `false` | Skip alternatives installation completely | ## Examples @@ -38,3 +41,7 @@ openjdk_pkg_install '11' do alternatives_priority 2 end ``` + +## Architecture Support + +This resource supports installation on both x86_64 and ARM64 architectures. On ARM64 platforms (like ARM Macs or ARM-based cloud instances), package paths may include architecture-specific suffixes in paths (e.g., `-arm64` or `-aarch64`). diff --git a/documentation/resources/openjdk_source_install.md b/documentation/resources/openjdk_source_install.md index f14824f5..c6d2f11b 100644 --- a/documentation/resources/openjdk_source_install.md +++ b/documentation/resources/openjdk_source_install.md @@ -1,8 +1,10 @@ -# openjdk_install +# openjdk_source_install [back to resource list](https://github.com/sous-chefs/java#resources) +Installs OpenJDK Java from source archives. This resource handles downloading, extracting, and configuring OpenJDK from source tarballs, including setting up the Java home directory and alternatives system entries. + Introduced: v8.0.0 ## Actions @@ -21,10 +23,11 @@ Introduced: v8.0.0 | java_home_mode | Integer, String | `0755` | The permission for the Java home directory | | java_home_owner | String | `root` | Owner of the Java Home | | java_home_group | String | `node['root_group']` | Group for the Java Home | -| default | Boolean | `true` | Whether to set this as the defalut Java | +| default | Boolean | `true` | Whether to set this as the default Java | | bin_cmds | Array | `default_bin_cmds(version)` | A list of bin_cmds based on the version and variant | | alternatives_priority | Integer | `1` | Alternatives priority to set for this Java | | reset_alternatives | Boolean | `true` | Whether to reset alternatives before setting | +| skip_alternatives | Boolean | `false` | Skip alternatives installation completely | ## Examples diff --git a/documentation/resource_temurin_package_install.md b/documentation/resources/temurin_package_install.md similarity index 70% rename from documentation/resource_temurin_package_install.md rename to documentation/resources/temurin_package_install.md index 6590c519..d7330e20 100644 --- a/documentation/resource_temurin_package_install.md +++ b/documentation/resources/temurin_package_install.md @@ -1,7 +1,11 @@ # temurin_package_install +[back to resource list](https://github.com/sous-chefs/java#resources) + Installs Java Temurin (AdoptOpenJDK) packages provided by Adoptium. This resource handles the repository setup and package installation for Temurin JDK packages across various platforms. +Introduced: v12.0.0 + ## Actions - `:install` - Installs Temurin JDK packages @@ -19,6 +23,21 @@ Installs Java Temurin (AdoptOpenJDK) packages provided by Adoptium. This resourc | `alternatives_priority` | Integer | 1062 | Priority for alternatives system | | `reset_alternatives` | Boolean | true | Whether to reset alternatives before setting | | `default` | Boolean | true | Whether to set this as the default Java | +| `skip_alternatives` | Boolean | false | Skip alternatives installation completely | + +## Platform Support + +- Debian/Ubuntu: Uses apt_repository with `signed_by false` and `trusted true` options to bypass GPG signature verification issues +- Amazon Linux/CentOS/RHEL: Uses yum_repository with standard configuration +- SUSE: Uses zypper_repository with standard configuration + +## Architecture Support + +This resource supports installation on both x86_64 and ARM64 architectures. On ARM64 platforms (like ARM Macs or ARM-based cloud instances), the package paths may include architecture-specific suffixes (e.g., `/usr/lib/jvm/temurin-8-jdk-arm64/bin/java`). + +## Notes + +- Due to a bug in Chef's apt_repository resource ([PR #15043](https://github.com/chef/chef/pull/15043)), GPG key verification is disabled by default on Debian-family systems to ensure the repository can be used successfully ## Examples diff --git a/resources/corretto_install.rb b/resources/corretto_install.rb index 245cea2e..8b4a5ac4 100644 --- a/resources/corretto_install.rb +++ b/resources/corretto_install.rb @@ -72,7 +72,7 @@ priority new_resource.alternatives_priority default new_resource.default reset_alternatives new_resource.reset_alternatives - action :set + not_if { new_resource.skip_alternatives } end end diff --git a/resources/openjdk_install.rb b/resources/openjdk_install.rb index 07cf0f52..dc9f3810 100644 --- a/resources/openjdk_install.rb +++ b/resources/openjdk_install.rb @@ -47,6 +47,7 @@ java_home new_resource.java_home default new_resource.default bin_cmds new_resource.bin_cmds + skip_alternatives new_resource.skip_alternatives alternatives_priority new_resource.alternatives_priority reset_alternatives new_resource.reset_alternatives end @@ -59,6 +60,7 @@ java_home_group new_resource.java_home_group default new_resource.default bin_cmds new_resource.bin_cmds + skip_alternatives new_resource.skip_alternatives alternatives_priority new_resource.alternatives_priority reset_alternatives new_resource.reset_alternatives end @@ -75,6 +77,7 @@ java_home new_resource.java_home default new_resource.default bin_cmds new_resource.bin_cmds + skip_alternatives new_resource.skip_alternatives alternatives_priority new_resource.alternatives_priority reset_alternatives new_resource.reset_alternatives action :remove @@ -88,6 +91,7 @@ java_home_group new_resource.java_home_group default new_resource.default bin_cmds new_resource.bin_cmds + skip_alternatives new_resource.skip_alternatives alternatives_priority new_resource.alternatives_priority reset_alternatives new_resource.reset_alternatives action :remove diff --git a/resources/openjdk_pkg_install.rb b/resources/openjdk_pkg_install.rb index 1c88ddd8..233041cd 100644 --- a/resources/openjdk_pkg_install.rb +++ b/resources/openjdk_pkg_install.rb @@ -52,6 +52,7 @@ priority new_resource.alternatives_priority default new_resource.default reset_alternatives new_resource.reset_alternatives + skip_alternatives new_resource.skip_alternatives action :set end end diff --git a/resources/openjdk_source_install.rb b/resources/openjdk_source_install.rb index f1caca57..efec3733 100644 --- a/resources/openjdk_source_install.rb +++ b/resources/openjdk_source_install.rb @@ -61,6 +61,7 @@ priority new_resource.alternatives_priority default new_resource.default reset_alternatives new_resource.reset_alternatives + not_if { new_resource.skip_alternatives } action :set end @@ -77,6 +78,7 @@ java_location new_resource.java_home bin_cmds new_resource.bin_cmds only_if { ::File.exist?(extract_dir) } + not_if { new_resource.skip_alternatives } action :unset end diff --git a/resources/partial/_common.rb b/resources/partial/_common.rb index 1e8f424c..49c93c39 100644 --- a/resources/partial/_common.rb +++ b/resources/partial/_common.rb @@ -1,3 +1,7 @@ property :version, String, name_property: true, description: 'Java version to install' + +property :skip_alternatives, [true, false], + default: false, + description: 'Skip alternatives installation' diff --git a/resources/temurin_package_install.rb b/resources/temurin_package_install.rb index 9dd5228f..e9781bb3 100644 --- a/resources/temurin_package_install.rb +++ b/resources/temurin_package_install.rb @@ -82,6 +82,7 @@ def default_temurin_pkg_name(version) priority new_resource.alternatives_priority default new_resource.default reset_alternatives new_resource.reset_alternatives + not_if { new_resource.skip_alternatives } end end @@ -91,6 +92,7 @@ def default_temurin_pkg_name(version) bin_cmds new_resource.bin_cmds only_if { ::File.exist?(new_resource.java_home) } action :unset + not_if { new_resource.skip_alternatives } end package new_resource.pkg_name do From 166c0369403ec8c49a1fc0c154719a1afb2df244 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 14 Jul 2025 09:37:27 +0100 Subject: [PATCH 155/188] Update changelog for 13.1.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2fc8f80..e0215e16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 13.1.0 - *2025-07-14* - add `skip_alternatives` to resources `corretto_install`, `openjdk_install`, `openjdk_pkg_install`, `openjdk_source_install` for cases when management of alternatives is not desired. (@dschlenk) From 945ed94959398efa8defa02fc7d79c3d73895fda Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 14 Jul 2025 09:37:27 +0100 Subject: [PATCH 156/188] Update metadata for 13.1.0 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 64625e4f..75601340 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '13.0.0' +version '13.1.0' supports 'debian' supports 'ubuntu' From dcc9d279f6e074ed43664479457637570abd7452 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 14 Jul 2025 09:37:31 +0100 Subject: [PATCH 157/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0215e16..e7334aaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 13.1.0 - *2025-07-14* - add `skip_alternatives` to resources `corretto_install`, `openjdk_install`, `openjdk_pkg_install`, `openjdk_source_install` for cases when management of alternatives is not desired. (@dschlenk) From 756441110e504d6f22aadea9ec15cd112ed5fe2c Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 14 Jul 2025 09:38:30 +0100 Subject: [PATCH 158/188] Standardise files with files in sous-chefs/repo-management (#725) Signed-off-by: kitchen-porter Co-authored-by: Dan Webb --- .vscode/extensions.json | 2 +- CHANGELOG.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 51d0ae7a..cf171a37 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,7 +1,7 @@ { "recommendations": [ "chef-software.chef", - "rebornix.ruby", + "Shopify.ruby-lsp", "editorconfig.editorconfig", "DavidAnson.vscode-markdownlint" ] diff --git a/CHANGELOG.md b/CHANGELOG.md index e7334aaa..e656d5cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +Standardise files with files in sous-chefs/repo-management +- Update the recommended Ruby VSCode extensions + ## 13.1.0 - *2025-07-14* - add `skip_alternatives` to resources `corretto_install`, `openjdk_install`, `openjdk_pkg_install`, `openjdk_source_install` for cases when management of alternatives is not desired. (@dschlenk) From 67063e801b4fd861e33801490cd620613b0789cd Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Mon, 14 Jul 2025 10:52:51 +0100 Subject: [PATCH 159/188] skip alternatives patch (#729) * fix missing skip_alternatives Signed-off-by: Dan Webb * Fix missing skip_alternatives Signed-off-by: Dan Webb --------- Signed-off-by: Dan Webb --- CHANGELOG.md | 2 ++ resources/openjdk_pkg_install.rb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e656d5cf..71813621 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,9 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased Standardise files with files in sous-chefs/repo-management + - Update the recommended Ruby VSCode extensions +- Fix missing skip_alternatives property in openjdk_pkg_install ## 13.1.0 - *2025-07-14* diff --git a/resources/openjdk_pkg_install.rb b/resources/openjdk_pkg_install.rb index 233041cd..ca5d3cf9 100644 --- a/resources/openjdk_pkg_install.rb +++ b/resources/openjdk_pkg_install.rb @@ -52,8 +52,7 @@ priority new_resource.alternatives_priority default new_resource.default reset_alternatives new_resource.reset_alternatives - skip_alternatives new_resource.skip_alternatives - action :set + not_if { new_resource.skip_alternatives } end end @@ -62,6 +61,7 @@ java_location new_resource.java_home bin_cmds new_resource.bin_cmds only_if { ::File.exist?(new_resource.java_home) } + not_if { new_resource.skip_alternatives } action :unset end From e18ea1b37294fb0b774d4f1205cc3751ca9bbe0d Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Mon, 14 Jul 2025 10:57:54 +0100 Subject: [PATCH 160/188] Air gap mode and alternative URLs for repository addresses (#730) Signed-off-by: Dan Webb --- CHANGELOG.md | 7 ++++--- documentation/resources/openjdk_pkg_install.md | 1 + documentation/resources/temurin_package_install.md | 7 +++++-- resources/openjdk_pkg_install.rb | 5 ++++- resources/openjdk_source_install.rb | 2 +- resources/temurin_package_install.rb | 9 ++++++--- test/integration/temurin_mirror/inspec.yml | 0 7 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 test/integration/temurin_mirror/inspec.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 71813621..87a0077d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,10 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased -Standardise files with files in sous-chefs/repo-management - -- Update the recommended Ruby VSCode extensions +- Add `repository_uri` property to `temurin_package_install` and `openjdk_pkg_install` resources to support installation from alternative/internal mirrors ([#728](https://github.com/sous-chefs/java/issues/728)) +- Clarify documentation for `url` property in `openjdk_source_install` resource to note it can be used for internal mirrors +- Standardise files with files in sous-chefs/repo-management + Update the recommended Ruby VSCode extensions - Fix missing skip_alternatives property in openjdk_pkg_install ## 13.1.0 - *2025-07-14* diff --git a/documentation/resources/openjdk_pkg_install.md b/documentation/resources/openjdk_pkg_install.md index 9bdeecb3..b135c291 100644 --- a/documentation/resources/openjdk_pkg_install.md +++ b/documentation/resources/openjdk_pkg_install.md @@ -25,6 +25,7 @@ Introduced: v8.1.0 | alternatives_priority | Integer | `1062` | Alternatives priority to set for this Java | | reset_alternatives | Boolean | `true` | Whether to reset alternatives before setting | | skip_alternatives | Boolean | `false` | Skip alternatives installation completely | +| repository_uri | String | `nil` | URI for the repository mirror to use instead of default repository URLs | ## Examples diff --git a/documentation/resources/temurin_package_install.md b/documentation/resources/temurin_package_install.md index d7330e20..82e9779c 100644 --- a/documentation/resources/temurin_package_install.md +++ b/documentation/resources/temurin_package_install.md @@ -24,6 +24,8 @@ Introduced: v12.0.0 | `reset_alternatives` | Boolean | true | Whether to reset alternatives before setting | | `default` | Boolean | true | Whether to set this as the default Java | | `skip_alternatives` | Boolean | false | Skip alternatives installation completely | +| `repository_uri` | String | `nil` | URI for the repository mirror to use instead of default repository URLs | +| air_gap | Boolean | false | Whether to install in air-gap mode | ## Platform Support @@ -63,7 +65,7 @@ temurin_package_install '11' do end ``` -## Platform Support +## Supported Platforms This resource supports the following platforms: @@ -76,8 +78,9 @@ This resource supports the following platforms: Each platform will have the appropriate Adoptium repository configured automatically. -## Notes +## Additional Information - This resource uses the Adoptium API to validate available releases. - The resource will warn if a requested version is not available as an LTS release. - For most use cases, you can simply specify the major version number. +- Air-gap mode disables version checking via the Adoptium API and instead uses the version specified in the `pkg_version` property. diff --git a/resources/openjdk_pkg_install.rb b/resources/openjdk_pkg_install.rb index ca5d3cf9..86449b0b 100644 --- a/resources/openjdk_pkg_install.rb +++ b/resources/openjdk_pkg_install.rb @@ -22,6 +22,9 @@ default: 1062, description: 'Alternatives priority to set for this Java' +property :repository_uri, String, + description: 'URI for the repository mirror (e.g., "https://custom-mirror.example.com/openjdk/ubuntu")' + use 'partial/_common' use 'partial/_linux' use 'partial/_openjdk' @@ -29,7 +32,7 @@ action :install do if platform?('ubuntu') apt_repository 'openjdk-r-ppa' do - uri 'ppa:openjdk-r' + uri new_resource.repository_uri || 'ppa:openjdk-r' end end diff --git a/resources/openjdk_source_install.rb b/resources/openjdk_source_install.rb index efec3733..5eef5e0a 100644 --- a/resources/openjdk_source_install.rb +++ b/resources/openjdk_source_install.rb @@ -9,7 +9,7 @@ property :url, String, default: lazy { default_openjdk_url(version, variant) }, - description: 'The URL to download from' + description: 'The URL to download from. Can be an internal mirror URL (e.g., "https://internal-mirror.example.com/java/openjdk/").' property :checksum, String, regex: /^[0-9a-f]{32}$|^[a-zA-Z0-9]{40,64}$/, diff --git a/resources/temurin_package_install.rb b/resources/temurin_package_install.rb index e9781bb3..0a7b5b43 100644 --- a/resources/temurin_package_install.rb +++ b/resources/temurin_package_install.rb @@ -27,12 +27,15 @@ def default_temurin_pkg_name(version) default: lazy { default_bin_cmds(version) }, description: 'A list of bin_cmds based on the version' +property :repository_uri, String, + description: 'URI for the repository mirror (e.g., "https://custom-mirror.example.com/artifactory/deb")' + use 'partial/_common' use 'partial/_linux' action :install do apt_repository 'adoptium' do - uri 'https://packages.adoptium.net/artifactory/deb' + uri new_resource.repository_uri || 'https://packages.adoptium.net/artifactory/deb' components ['main'] distribution lazy { node['lsb']['codename'] || node['debian']['distribution_codename'] } # TODO: https://github.com/chef/chef/pull/15043 @@ -45,7 +48,7 @@ def default_temurin_pkg_name(version) yum_repository 'adoptium' do description 'Eclipse Adoptium' - baseurl value_for_platform( + baseurl new_resource.repository_uri || value_for_platform( 'amazon' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/amazonlinux/2/$basearch' }, 'centos' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/centos/$releasever/$basearch' }, 'fedora' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/fedora/$releasever/$basearch' }, @@ -63,7 +66,7 @@ def default_temurin_pkg_name(version) zypper_repository 'adoptium' do description 'Eclipse Adoptium' - baseurl 'https://packages.adoptium.net/artifactory/rpm/opensuse/$releasever/$basearch' + baseurl new_resource.repository_uri || 'https://packages.adoptium.net/artifactory/rpm/opensuse/$releasever/$basearch' gpgcheck true gpgkey 'https://packages.adoptium.net/artifactory/api/gpg/key/public' action :create diff --git a/test/integration/temurin_mirror/inspec.yml b/test/integration/temurin_mirror/inspec.yml new file mode 100644 index 00000000..e69de29b From d4d971e6a1c3dceb84e183d1fc07860aae1f620b Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 14 Jul 2025 10:57:58 +0100 Subject: [PATCH 161/188] Update changelog for 13.2.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87a0077d..ea01300b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 13.2.0 - *2025-07-14* - Add `repository_uri` property to `temurin_package_install` and `openjdk_pkg_install` resources to support installation from alternative/internal mirrors ([#728](https://github.com/sous-chefs/java/issues/728)) - Clarify documentation for `url` property in `openjdk_source_install` resource to note it can be used for internal mirrors From abd9c7a89c86149b255c6b8d0d40f4cdf2c4ed27 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 14 Jul 2025 10:57:58 +0100 Subject: [PATCH 162/188] Update metadata for 13.2.0 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 75601340..6bb55d2a 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '13.1.0' +version '13.2.0' supports 'debian' supports 'ubuntu' From bfa53a8708ba5739913c13c02b2a6a28110b1b10 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 14 Jul 2025 10:58:02 +0100 Subject: [PATCH 163/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea01300b..1531855e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 13.2.0 - *2025-07-14* - Add `repository_uri` property to `temurin_package_install` and `openjdk_pkg_install` resources to support installation from alternative/internal mirrors ([#728](https://github.com/sous-chefs/java/issues/728)) From a6bfaa9a1228757e1d507b4734f934eb6dcbf3e0 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Wed, 16 Jul 2025 11:20:29 +0100 Subject: [PATCH 164/188] Remove partial Semeru support (#731) - It looks like the install is provided mainly via a straight package download from GitHub. In this case, this cookbook is not useful in supporting that install method Signed-off-by: Dan Webb --- .github/workflows/ci.yml | 2 - CHANGELOG.md | 2 + bin/check_java_versions.rb | 5 --- kitchen.yml | 22 +-------- libraries/openjdk_helpers.rb | 20 ++------- resources/partial/_openjdk.rb | 2 +- spec/libraries/semeru_helpers_spec.rb | 64 --------------------------- 7 files changed, 7 insertions(+), 110 deletions(-) delete mode 100644 spec/libraries/semeru_helpers_spec.rb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d091bb6..85aecdca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,8 +37,6 @@ jobs: - temurin-11 - temurin-17 - temurin-21 - # - semeru-11 - # - semeru-17 fail-fast: false steps: - name: Check out code diff --git a/CHANGELOG.md b/CHANGELOG.md index 1531855e..1fd4abc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +- Remove Semeru support as there is no clean yum or apt repository for it + ## 13.2.0 - *2025-07-14* - Add `repository_uri` property to `temurin_package_install` and `openjdk_pkg_install` resources to support installation from alternative/internal mirrors ([#728](https://github.com/sous-chefs/java/issues/728)) diff --git a/bin/check_java_versions.rb b/bin/check_java_versions.rb index bb6336ea..d2a778ea 100755 --- a/bin/check_java_versions.rb +++ b/bin/check_java_versions.rb @@ -9,11 +9,6 @@ '17' => 'adoptium/temurin17-binaries', }.freeze -SEMERU_REPOS = { - '11' => 'ibmruntimes/semeru11-binaries', - '17' => 'ibmruntimes/semeru17-binaries', -}.freeze - CORRETTO_REPOS = { '11' => 'corretto-11', '17' => 'corretto-17', diff --git a/kitchen.yml b/kitchen.yml index 14ae3f34..122ee54c 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -47,7 +47,7 @@ suites: inspec_tests: [test/integration/openjdk] inputs: { java_version: "17" } - # Temurin/Semeru + # Temurin - name: temurin-8 run_list: - recipe[test::temurin_pkg] @@ -87,26 +87,6 @@ suites: - test/integration/temurin inputs: { java_version: "21" } - - name: semeru-11 - run_list: - - recipe[test::openjdk] - attributes: - version: 11 - variant: semeru - verifier: - inspec_tests: [test/integration/openjdk] - inputs: { java_version: "11" } - - - name: semeru-17 - run_list: - - recipe[test::openjdk] - attributes: - version: 17 - variant: semeru - verifier: - inspec_tests: [test/integration/openjdk] - inputs: { java_version: "17" } - # Corretto - name: corretto-8 run_list: diff --git a/libraries/openjdk_helpers.rb b/libraries/openjdk_helpers.rb index e07851e5..1cde1059 100644 --- a/libraries/openjdk_helpers.rb +++ b/libraries/openjdk_helpers.rb @@ -46,20 +46,6 @@ def default_openjdk_url(version, variant = 'openjdk') Chef::Log.fatal('Version specified does not have a URL value set') raise 'Version supplied does not have a download URL set' end - when 'semeru' - case version - when '11' - 'https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.14.1%2B1_openj9-0.30.1/ibm-semeru-open-jdk_x64_linux_11.0.14.1_1_openj9-0.30.1.tar.gz' - when '16' - 'https://github.com/ibmruntimes/semeru16-binaries/releases/download/jdk-16.0.2%2B7_openj9-0.27.1/ibm-semeru-open-jdk_ppc64le_linux_16.0.2_7_openj9-0.27.1.tar.gz' - when '17' - 'https://github.com/ibmruntimes/semeru17-binaries/releases/download/jdk-17.0.2%2B8_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_17.0.2_8_openj9-0.30.0.tar.gz' - when '18' - 'https://github.com/AdoptOpenJDK/semeru18-binaries/releases/download/jdk-18.0.1%2B10_openj9-0.32.0/ibm-semeru-open-jdk_x64_linux_18.0.1_10_openj9-0.32.0.tar.gz' - else - Chef::Log.fatal('Version specified does not have a URL value set') - raise 'Version supplied does not have a download URL set' - end else case version when '9' @@ -128,8 +114,8 @@ def default_openjdk_pkg_names(version) end def default_openjdk_pkg_java_home(version) - # For both standard OpenJDK and Temurin/Semeru variants, use the standard OpenJDK paths - # Temurin and Semeru variants are installed using package managers with standard paths + # For both standard OpenJDK and Temurin variants, use the standard OpenJDK paths + # Temurin variant is installed using package managers with standard paths # Map architecture to the correct suffix used in Java paths arch = case node['kernel']['machine'] @@ -143,7 +129,7 @@ def default_openjdk_pkg_java_home(version) node['kernel']['machine'] end - # For Debian-based systems, Temurin and standard OpenJDK use the same path structure + # For Debian-based systems, Temurin variant uses the same path structure # with architecture-specific suffixes value_for_platform_family( %w(rhel fedora) => version.to_i < 11 ? "/usr/lib/jvm/java-1.#{version}.0" : "/usr/lib/jvm/java-#{version}", diff --git a/resources/partial/_openjdk.rb b/resources/partial/_openjdk.rb index a0c93f3e..d51c680b 100644 --- a/resources/partial/_openjdk.rb +++ b/resources/partial/_openjdk.rb @@ -1,4 +1,4 @@ property :variant, String, - equal_to: %w(openjdk semeru temurin), + equal_to: %w(openjdk temurin), default: 'openjdk', description: 'Install flavour' diff --git a/spec/libraries/semeru_helpers_spec.rb b/spec/libraries/semeru_helpers_spec.rb deleted file mode 100644 index c608a783..00000000 --- a/spec/libraries/semeru_helpers_spec.rb +++ /dev/null @@ -1,64 +0,0 @@ -require 'spec_helper' - -RSpec.describe Java::Cookbook::OpenJdkHelpers do - class DummyClass < Chef::Node - include Java::Cookbook::OpenJdkHelpers - end - - subject { DummyClass.new } - - describe '#sub_dir' do - before do - allow(subject).to receive(:[]).with('url').and_return(url) - end - - context 'OpenJDK Semeru 17' do - let(:url) { 'https://github.com/ibmruntimes/semeru17-binaries/releases/download/jdk-17.0.2%2B8_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_17.0.2_8_openj9-0.30.0.tar.gz' } - - it 'returns the correct folder name' do - expect(subject.sub_dir(url)).to eq 'jdk-17.0.2-b8' - end - end - - context 'Malformed URL' do - let(:url) { 'a\bad/path/\to\/some.tar.gz' } - - it 'throws an error' do - expect { subject.sub_dir(url) }.to raise_error(URI::InvalidURIError) - end - end - end - - describe '#defaul_openjdk_url' do - before do - allow(subject).to receive(:[]).with('version').and_return(version) - end - - context 'Semeru 11' do - let(:version) { '11' } - let(:variant) { 'semeru' } - - it 'returns the correct URL' do - expect(subject.default_openjdk_url(version, variant)).to eq 'https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.14.1%2B1_openj9-0.30.1/ibm-semeru-open-jdk_x64_linux_11.0.14.1_1_openj9-0.30.1.tar.gz' - end - end - - context 'Semeru 16' do - let(:version) { '16' } - let(:variant) { 'semeru' } - - it 'returns the correct URL' do - expect(subject.default_openjdk_url(version, variant)).to eq 'https://github.com/ibmruntimes/semeru16-binaries/releases/download/jdk-16.0.2%2B7_openj9-0.27.1/ibm-semeru-open-jdk_ppc64le_linux_16.0.2_7_openj9-0.27.1.tar.gz' - end - end - - context 'Semeru 17' do - let(:version) { '17' } - let(:variant) { 'semeru' } - - it 'returns the correct URL' do - expect(subject.default_openjdk_url(version, variant)).to eq 'https://github.com/ibmruntimes/semeru17-binaries/releases/download/jdk-17.0.2%2B8_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_17.0.2_8_openj9-0.30.0.tar.gz' - end - end - end -end From 87c2de03da3d149595f9eff0a265dc2f02d5beea Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 16 Jul 2025 11:20:34 +0100 Subject: [PATCH 165/188] Update changelog for 14.0.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fd4abc9..a15068d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 14.0.0 - *2025-07-16* - Remove Semeru support as there is no clean yum or apt repository for it From 44206a661125d16d6c2578e197588f917ddfacc3 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 16 Jul 2025 11:20:35 +0100 Subject: [PATCH 166/188] Update metadata for 14.0.0 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 6bb55d2a..9c0051fc 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '13.2.0' +version '14.0.0' supports 'debian' supports 'ubuntu' From a76591ab709045bc49408d19426294aeb2e5c88e Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 16 Jul 2025 11:20:39 +0100 Subject: [PATCH 167/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a15068d7..6b8ff6bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 14.0.0 - *2025-07-16* - Remove Semeru support as there is no clean yum or apt repository for it From cfc3652fd1a3b4e8f04d0cbe82b4f6b77f0e8e08 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 11:04:12 -0700 Subject: [PATCH 168/188] chore(deps): update actions/checkout action to v5 (#732) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85aecdca..243e2a5d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: fail-fast: false steps: - name: Check out code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Install Chef uses: actionshub/chef-install@3.0.1 - name: Dokken From e21839837bc39ddbe9f9484ceadb68e336c29153 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Thu, 4 Sep 2025 19:04:16 +0100 Subject: [PATCH 169/188] Update changelog for 14.0.1 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b8ff6bd..277a4573 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This file is used to list changes made in each version of the Java cookbook. -## Unreleased +## 14.0.1 - *2025-09-04* ## 14.0.0 - *2025-07-16* From 9314de7127987064c82b4ec8002260314e107318 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Thu, 4 Sep 2025 19:04:17 +0100 Subject: [PATCH 170/188] Update metadata for 14.0.1 --- metadata.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.rb b/metadata.rb index 9c0051fc..b491406f 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 16.0' -version '14.0.0' +version '14.0.1' supports 'debian' supports 'ubuntu' From a6bd1a5026c93b77b2bc13a2475f2e00a1b4f854 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Thu, 4 Sep 2025 19:04:21 +0100 Subject: [PATCH 171/188] Set Changelog to ## Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 277a4573..024b9a8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ This file is used to list changes made in each version of the Java cookbook. +## Unreleased + ## 14.0.1 - *2025-09-04* ## 14.0.0 - *2025-07-16* From 8b1c1459f946120c4f0a8fd9781e7b51e6d39f80 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 11:18:07 -0700 Subject: [PATCH 172/188] chore(deps): update actions/stale action to v10 (#735) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index d4dae8fc..d9e5240b 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -8,7 +8,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v9 + - uses: actions/stale@v10 with: repo-token: ${{ secrets.GITHUB_TOKEN }} close-issue-message: > From 93e714c792e882e8b47dba4c08ad266939d3e665 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 10 Sep 2025 09:29:47 -0700 Subject: [PATCH 173/188] chore(deps): update sous-chefs/.github action to v4 (#736) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 243e2a5d..79433322 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ name: "Test" jobs: lint-unit: - uses: sous-chefs/.github/.github/workflows/lint-unit.yml@3.1.1 + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@4.0.0 permissions: actions: write checks: write From b6085cd4feca6bc907382b867163f0ca526dff2e Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Wed, 17 Sep 2025 22:03:24 +0100 Subject: [PATCH 174/188] Standardise files with files in sous-chefs/repo-management (#738) Signed-off-by: kitchen-porter --- CHANGELOG.md | 2 ++ kitchen.dokken.yml | 15 ++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 024b9a8d..16b6910c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +Standardise files with files in sous-chefs/repo-management + ## 14.0.1 - *2025-09-04* ## 14.0.0 - *2025-07-16* diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index 998bb20c..1d8623e0 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -37,16 +37,16 @@ platforms: image: dokken/centos-stream-10 pid_one_command: /usr/lib/systemd/systemd - - name: debian-11 - driver: - image: dokken/debian-11 - pid_one_command: /bin/systemd - - name: debian-12 driver: image: dokken/debian-12 pid_one_command: /bin/systemd + - name: debian-13 + driver: + image: dokken/debian-13 + pid_one_command: /usr/lib/systemd/systemd + - name: fedora-latest driver: image: dokken/fedora-latest @@ -77,6 +77,11 @@ platforms: image: dokken/rockylinux-9 pid_one_command: /usr/lib/systemd/systemd + - name: rockylinux-10 + driver: + image: dokken/rockylinux-10 + pid_one_command: /usr/lib/systemd/systemd + - name: ubuntu-20.04 driver: image: dokken/ubuntu-20.04 From 6dcbf88334f883bec6bb6e6c46f3f66e4b254eed Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Fri, 19 Sep 2025 16:54:25 +0100 Subject: [PATCH 175/188] Standardise files with files in sous-chefs/repo-management (#739) Signed-off-by: kitchen-porter --- .github/copilot-instructions.md | 95 +++++++++++++++++++++++++++++++++ CHANGELOG.md | 2 + 2 files changed, 97 insertions(+) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 00000000..e1084932 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,95 @@ +# Copilot Instructions for Sous Chefs Cookbooks + +## Repository Overview + +**Chef cookbook** for managing software installation and configuration. Part of the Sous Chefs cookbook ecosystem. + +**Key Facts:** Ruby-based, Chef >= 16 required, supports various OS platforms (check metadata.rb, kitchen.yml and .github/workflows/ci.yml for which platforms to specifically test) + +## Project Structure + +**Critical Paths:** +- `recipes/` - Chef recipes for cookbook functionality (if this is a recipe-driven cookbook) +- `resources/` - Custom Chef resources with properties and actions (if this is a resource-driven cookbook) +- `spec/` - ChefSpec unit tests +- `test/integration/` - InSpec integration tests (tests all platforms supported) +- `test/cookbooks/` or `test/fixtures/` - Example cookbooks used during testing that show good examples of custom resource usage +- `attributes/` - Configuration for recipe driven cookbooks (not applicable to resource cookbooks) +- `libraries/` - Library helpers to assist with the cookbook. May contain multiple files depending on complexity of the cookbook. +- `templates/` - ERB templates that may be used in the cookbook +- `files/` - files that may be used in the cookbook +- `metadata.rb`, `Berksfile` - Cookbook metadata and dependencies + +## Build and Test System + +### Environment Setup +**MANDATORY:** Install Chef Workstation first - provides chef, berks, cookstyle, kitchen tools. + +### Essential Commands (strict order) +```bash +berks install # Install dependencies (always first) +cookstyle # Ruby/Chef linting +yamllint . # YAML linting +markdownlint-cli2 '**/*.md' # Markdown linting +chef exec rspec # Unit tests (ChefSpec) +# Integration tests will be done via the ci.yml action. Do not run these. Only check the action logs for issues after CI is done running. +``` + +### Critical Testing Details +- **Kitchen Matrix:** Multiple OS platforms × software versions (check kitchen.yml for specific combinations) +- **Docker Required:** Integration tests use Dokken driver +- **CI Environment:** Set `CHEF_LICENSE=accept-no-persist` +- **Full CI Runtime:** 30+ minutes for complete matrix + +### Common Issues and Solutions +- **Always run `berks install` first** - most failures are dependency-related +- **Docker must be running** for kitchen tests +- **Chef Workstation required** - no workarounds, no alternatives +- **Test data bags needed** (optional for some cookbooks) in `test/integration/data_bags/` for convergence + +## Development Workflow + +### Making Changes +1. Edit recipes/resources/attributes/templates/libraries +2. Update corresponding ChefSpec tests in `spec/` +3. Also update any InSpec tests under test/integration +4. Ensure cookstyle and rspec passes at least. You may run `cookstyle -a` to automatically fix issues if needed. +5. Also always update all documentation found in README.md and any files under documentation/* +6. **Always update CHANGELOG.md** (required by Dangerfile) - Make sure this conforms with the Sous Chefs changelog standards. + +### Pull Request Requirements +- **PR description >10 chars** (Danger enforced) +- **CHANGELOG.md entry** for all code changes +- **Version labels** (major/minor/patch) required +- **All linters must pass** (cookstyle, yamllint, markdownlint) +- **Test updates** needed for code changes >5 lines and parameter changes that affect the code logic + +## Chef Cookbook Patterns + +### Resource Development +- Custom resources in `resources/` with properties and actions +- Include comprehensive ChefSpec tests for all actions +- Follow Chef resource DSL patterns + +### Recipe Conventions +- Use `include_recipe` for modularity +- Handle platforms with `platform_family?` conditionals +- Use encrypted data bags for secrets (passwords, SSL certs) +- Leverage attributes for configuration with defaults + +### Testing Approach +- **ChefSpec (Unit):** Mock dependencies, test recipe logic in `spec/` +- **InSpec (Integration):** Verify actual system state in `test/integration/inspec/` - InSpec files should contain proper inspec.yml and controls directories so that it could be used by other suites more easily. +- One test file per recipe, use standard Chef testing patterns + +## Trust These Instructions + +These instructions are validated for Sous Chefs cookbooks. **Do not search for build instructions** unless information here fails. + +**Error Resolution Checklist:** +1. Verify Chef Workstation installation +2. Confirm `berks install` completed successfully +3. Ensure Docker is running for integration tests +4. Check for missing test data dependencies + +The CI system uses these exact commands - following them matches CI behavior precisely. diff --git a/CHANGELOG.md b/CHANGELOG.md index 16b6910c..af7b6d58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ This file is used to list changes made in each version of the Java cookbook. Standardise files with files in sous-chefs/repo-management +Standardise files with files in sous-chefs/repo-management + ## 14.0.1 - *2025-09-04* ## 14.0.0 - *2025-07-16* From ff7a749685473efe072358e67c85d48c053db6aa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 16 Oct 2025 10:49:34 +0100 Subject: [PATCH 176/188] chore(deps): update sous-chefs/.github action to v5 (#741) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79433322..a1129a2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ name: "Test" jobs: lint-unit: - uses: sous-chefs/.github/.github/workflows/lint-unit.yml@4.0.0 + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@5.0.3 permissions: actions: write checks: write From b77e2a2ffb6cfd3103a5924bc41014a31b6405b2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 14:06:23 +0000 Subject: [PATCH 177/188] chore(deps): update sous-chefs/.github action to v5.0.8 (#744) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1129a2d..5db87b6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ name: "Test" jobs: lint-unit: - uses: sous-chefs/.github/.github/workflows/lint-unit.yml@5.0.3 + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@5.0.8 permissions: actions: write checks: write From 5c3f2817aeb0ec0ea9e6e98f4be2ba8352e76f80 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Wed, 7 Jan 2026 23:03:11 +0000 Subject: [PATCH 178/188] platforms (#748) * fix: Debian suites Signed-off-by: Dan Webb * Switch Debian 11 for 13 Signed-off-by: Dan Webb --------- Signed-off-by: Dan Webb --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 25 ++++++++++++++++++ kitchen.yml | 49 +++++++++++++++++++---------------- 3 files changed, 52 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5db87b6e..00142900 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: os: - amazonlinux-2023 - debian-12 - - debian-11 + - debian-13 - rockylinux-9 - rockylinux-8 - ubuntu-2204 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..6d78aa6b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,25 @@ +--- +name: release + + +"on": + push: + branches: [main] + +permissions: + contents: write + issues: write + pull-requests: write + packages: write + attestations: write + id-token: write + +jobs: + release: + uses: sous-chefs/.github/.github/workflows/release-cookbook.yml@main + secrets: + token: ${{ secrets.PORTER_GITHUB_TOKEN }} + supermarket_user: ${{ secrets.CHEF_SUPERMARKET_USER }} + supermarket_key: ${{ secrets.CHEF_SUPERMARKET_KEY }} + slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }} + slack_channel_id: ${{ secrets.SLACK_CHANNEL_ID }} diff --git a/kitchen.yml b/kitchen.yml index 122ee54c..21f690a0 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -13,7 +13,7 @@ verifier: platforms: - name: amazonlinux-2023 - name: debian-12 - - name: debian-11 + - name: debian-13 - name: freebsd-13 - name: fedora-latest - name: rockylinux-9 @@ -31,14 +31,6 @@ suites: inspec_tests: [test/integration/openjdk] inputs: { java_version: "11" } - - name: openjdk-16 - run_list: - - recipe[test::openjdk] - attributes: { version: "16" } - verifier: - inspec_tests: [test/integration/openjdk] - inputs: { java_version: "16" } - - name: openjdk-17 run_list: - recipe[test::openjdk] @@ -48,23 +40,13 @@ suites: inputs: { java_version: "17" } # Temurin - - name: temurin-8 - run_list: - - recipe[test::temurin_pkg] - attributes: - version: 8 - verifier: - inspec_tests: [test/integration/temurin] - inputs: { java_version: "8" } - - name: temurin-11 run_list: - recipe[test::temurin_pkg] attributes: version: 11 verifier: - inspec_tests: - - test/integration/temurin + inspec_tests: [test/integration/temurin] inputs: { java_version: "11" } - name: temurin-17 @@ -87,6 +69,16 @@ suites: - test/integration/temurin inputs: { java_version: "21" } + - name: temurin-25 + run_list: + - recipe[test::temurin_pkg] + attributes: + version: 25 + verifier: + inspec_tests: + - test/integration/temurin + inputs: { java_version: "25" } + # Corretto - name: corretto-8 run_list: @@ -95,6 +87,7 @@ suites: verifier: inspec_tests: [test/integration/corretto] inputs: { java_version: "8" } + - name: corretto-11 run_list: - recipe[test::corretto] @@ -102,6 +95,7 @@ suites: verifier: inspec_tests: [test/integration/corretto] inputs: { java_version: "11" } + - name: corretto-17 run_list: - recipe[test::corretto] @@ -109,10 +103,19 @@ suites: verifier: inspec_tests: [test/integration/corretto] inputs: { java_version: "17" } - - name: corretto-18 + + - name: corretto-21 + run_list: + - recipe[test::corretto] + attributes: { version: "21" } + verifier: + inspec_tests: [test/integration/corretto] + inputs: { java_version: "21" } + + - name: corretto-25 run_list: - recipe[test::corretto] - attributes: { version: "18" } + attributes: { version: "25" } verifier: inspec_tests: [test/integration/corretto] - inputs: { java_version: "18" } + inputs: { java_version: "25" } From cb768e2efe552e842b99affddcc851ebb08da8d2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 16:33:09 +0000 Subject: [PATCH 179/188] chore(deps): update actions to v6 (#746) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00142900..2ef0c18d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,9 +40,9 @@ jobs: fail-fast: false steps: - name: Check out code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Install Chef - uses: actionshub/chef-install@3.0.1 + uses: actionshub/chef-install@6.0.0 - name: Dokken uses: actionshub/test-kitchen@3.0.0 env: From 5f949dabcb57199550fb00b4af75c3c6328dfd0e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Apr 2026 09:48:56 +0100 Subject: [PATCH 180/188] Update sous-chefs/.github action to v6 (#752) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ef0c18d..cb44831a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ name: "Test" jobs: lint-unit: - uses: sous-chefs/.github/.github/workflows/lint-unit.yml@5.0.8 + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@6.0.0 permissions: actions: write checks: write From 8d7844b5d1889af62574656c7c3e33904a9e75b5 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Tue, 9 Jun 2026 11:18:04 +0100 Subject: [PATCH 181/188] ci: use sous-chefs workflows 8.0.1 (#754) --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb44831a..dd8f9ee8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ name: "Test" jobs: lint-unit: - uses: sous-chefs/.github/.github/workflows/lint-unit.yml@6.0.0 + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@8.0.1 permissions: actions: write checks: write diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6d78aa6b..5096863d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ permissions: jobs: release: - uses: sous-chefs/.github/.github/workflows/release-cookbook.yml@main + uses: sous-chefs/.github/.github/workflows/release-cookbook.yml@8.0.1 secrets: token: ${{ secrets.PORTER_GITHUB_TOKEN }} supermarket_user: ${{ secrets.CHEF_SUPERMARKET_USER }} From f2832484ccedf4b277a03080a7b413b80a1c34d5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2026 12:58:24 +0100 Subject: [PATCH 182/188] Update Actions to v8.0.2 (#755) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd8f9ee8..4f871f10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ name: "Test" jobs: lint-unit: - uses: sous-chefs/.github/.github/workflows/lint-unit.yml@8.0.1 + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@8.0.2 permissions: actions: write checks: write diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5096863d..fe2dca8f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ permissions: jobs: release: - uses: sous-chefs/.github/.github/workflows/release-cookbook.yml@8.0.1 + uses: sous-chefs/.github/.github/workflows/release-cookbook.yml@8.0.2 secrets: token: ${{ secrets.PORTER_GITHUB_TOKEN }} supermarket_user: ${{ secrets.CHEF_SUPERMARKET_USER }} From 14e673eee215a0fb5faca1111399272b04735e4b Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Mon, 22 Jun 2026 10:26:33 +0100 Subject: [PATCH 183/188] feat!: remove legacy Java node attribute API (#758) * fix: repair workflow actionlint failures * chore: modernize Java cookbook Replace Berkshelf with Policyfile wiring, tighten CI and Kitchen matrices, and update resource implementations for safer shell usage, explicit provides names, cleanup actions, and stronger ChefSpec coverage. --- .github/workflows/ci.yml | 33 ++++-- .github/workflows/release.yml | 2 +- AGENTS.md | 79 ++++++++++++++ Berksfile | 7 -- Policyfile.rb | 15 +++ README.md | 6 +- documentation/resources/alternatives.md | 8 +- documentation/resources/certificate.md | 22 ++-- documentation/resources/corretto_install.md | 30 ++--- documentation/resources/jce.md | 21 ++-- .../resources/openjdk_pkg_install.md | 24 ++-- .../resources/openjdk_source_install.md | 6 +- .../resources/temurin_package_install.md | 31 +++--- kitchen.dokken.yml | 10 -- kitchen.global.yml | 7 +- kitchen.yml | 53 +++++---- libraries/bin_cmd_helpers.rb | 4 +- libraries/certificate_helpers.rb | 4 +- libraries/corretto_helpers.rb | 2 + libraries/openjdk_helpers.rb | 38 +++++-- libraries/temurin_helpers.rb | 6 +- metadata.rb | 20 ++-- resources/alternatives.rb | 64 ++++------- resources/certificate.rb | 58 ++++++---- resources/corretto_install.rb | 9 +- resources/jce.rb | 96 ++++++++++++---- resources/openjdk_install.rb | 26 +++-- resources/openjdk_pkg_install.rb | 45 ++++---- resources/openjdk_source_install.rb | 46 ++++---- resources/partial/_common.rb | 2 + resources/partial/_java_home.rb | 2 + resources/partial/_linux.rb | 2 + resources/partial/_macos.rb | 2 + resources/partial/_openjdk.rb | 2 + resources/temurin_package_install.rb | 82 ++++++++------ spec/libraries/bin_cmd_helpers_spec.rb | 25 +++++ spec/libraries/certificate_helpers_spec.rb | 4 +- spec/libraries/openjdk_helpers_spec.rb | 103 ++++++++++++++++++ spec/resources/alternatives_spec.rb | 19 ++++ spec/resources/certificate_spec.rb | 19 ++++ spec/resources/corretto_install_spec.rb | 16 +++ spec/resources/jce_spec.rb | 29 +++++ spec/resources/openjdk_install_spec.rb | 40 +++++++ spec/resources/openjdk_pkg_install_spec.rb | 21 ++++ spec/resources/openjdk_source_install_spec.rb | 36 ++++++ .../resources/temurin_package_install_spec.rb | 48 ++++++++ spec/spec_helper.rb | 17 ++- templates/jdk.sh.erb | 1 - .../test/recipes/alternatives_spec.rb | 4 + .../test/recipes/alternatives_unset_spec.rb | 5 + .../test/recipes/certificate_spec.rb | 20 ++++ .../cookbooks/test/recipes/corretto.rb | 11 +- .../cookbooks/test/recipes/corretto_spec.rb | 7 ++ .../cookbooks/test/recipes/java_cert.rb | 6 + .../cookbooks/test/recipes/jce_remove_spec.rb | 9 ++ .../cookbooks/test/recipes/jce_spec.rb | 8 ++ .../test/recipes/openjdk_package_spec.rb | 7 ++ .../test/recipes/openjdk_pkg_spec.rb | 6 + .../recipes/openjdk_source_direct_spec.rb | 7 ++ .../recipes/openjdk_source_remove_spec.rb | 8 ++ .../test/recipes/openjdk_source_spec.rb | 8 ++ .../test/recipes/temurin_package_spec.rb | 4 + .../custom-package/controls/verify_home.rb | 2 +- .../openjdk/controls/verify_openjdk.rb | 11 +- 64 files changed, 1019 insertions(+), 346 deletions(-) create mode 100644 AGENTS.md delete mode 100644 Berksfile create mode 100644 Policyfile.rb create mode 100644 spec/libraries/bin_cmd_helpers_spec.rb create mode 100644 spec/resources/alternatives_spec.rb create mode 100644 spec/resources/certificate_spec.rb create mode 100644 spec/resources/corretto_install_spec.rb create mode 100644 spec/resources/jce_spec.rb create mode 100644 spec/resources/openjdk_install_spec.rb create mode 100644 spec/resources/openjdk_pkg_install_spec.rb create mode 100644 spec/resources/openjdk_source_install_spec.rb create mode 100644 spec/resources/temurin_package_install_spec.rb delete mode 100644 templates/jdk.sh.erb create mode 100644 test/fixtures/cookbooks/test/recipes/alternatives_spec.rb create mode 100644 test/fixtures/cookbooks/test/recipes/alternatives_unset_spec.rb create mode 100644 test/fixtures/cookbooks/test/recipes/certificate_spec.rb create mode 100644 test/fixtures/cookbooks/test/recipes/corretto_spec.rb create mode 100644 test/fixtures/cookbooks/test/recipes/jce_remove_spec.rb create mode 100644 test/fixtures/cookbooks/test/recipes/jce_spec.rb create mode 100644 test/fixtures/cookbooks/test/recipes/openjdk_package_spec.rb create mode 100644 test/fixtures/cookbooks/test/recipes/openjdk_pkg_spec.rb create mode 100644 test/fixtures/cookbooks/test/recipes/openjdk_source_direct_spec.rb create mode 100644 test/fixtures/cookbooks/test/recipes/openjdk_source_remove_spec.rb create mode 100644 test/fixtures/cookbooks/test/recipes/openjdk_source_spec.rb create mode 100644 test/fixtures/cookbooks/test/recipes/temurin_package_spec.rb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f871f10..b4d4ec9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,13 +8,12 @@ name: "Test" jobs: lint-unit: - uses: sous-chefs/.github/.github/workflows/lint-unit.yml@8.0.2 + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@8.0.4 permissions: - actions: write checks: write pull-requests: write statuses: write - issues: write + secrets: inherit integration: needs: "lint-unit" @@ -22,29 +21,39 @@ jobs: strategy: matrix: os: + - almalinux-8 + - almalinux-9 + - almalinux-10 - amazonlinux-2023 + - centos-stream-9 + - centos-stream-10 - debian-12 - debian-13 - - rockylinux-9 + - fedora-latest + - oraclelinux-8 + - oraclelinux-9 - rockylinux-8 + - rockylinux-9 + - rockylinux-10 - ubuntu-2204 - - ubuntu-2004 + - ubuntu-2404 suite: - - corretto-11 - - corretto-17 - - corretto-18 - - temurin-8 + - openjdk-11 + - openjdk-17 - temurin-11 - temurin-17 - temurin-21 + - temurin-25 + - corretto-11 + - corretto-17 fail-fast: false steps: - name: Check out code uses: actions/checkout@v6 - name: Install Chef - uses: actionshub/chef-install@6.0.0 + uses: sous-chefs/.github/.github/actions/install-workstation@8.0.4 - name: Dokken - uses: actionshub/test-kitchen@3.0.0 + uses: actionshub/test-kitchen@main env: CHEF_LICENSE: accept-no-persist KITCHEN_LOCAL_YAML: kitchen.dokken.yml @@ -56,4 +65,4 @@ jobs: runs-on: ubuntu-latest needs: [integration] steps: - - run: echo ${{needs.integration.outputs}} + - run: echo "integration completed" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe2dca8f..7334bb52 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ permissions: jobs: release: - uses: sous-chefs/.github/.github/workflows/release-cookbook.yml@8.0.2 + uses: sous-chefs/.github/.github/workflows/release-cookbook.yml@8.0.4 secrets: token: ${{ secrets.PORTER_GITHUB_TOKEN }} supermarket_user: ${{ secrets.CHEF_SUPERMARKET_USER }} diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..4013626d --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,79 @@ +# AGENTS.md + +## Purpose + +This file records maintainer and agent decisions for the Java cookbook. Keep it focused on durable +patterns, support boundaries, and non-obvious implementation choices. Do not use it as a task +changelog. + +## Modernization Scope + +This cookbook is being modernized incrementally. Preserve the existing custom-resource API where it +is still useful, and avoid broad rewrites unless the requested work explicitly calls for a full +migration. + +Prefer resource properties and helper-derived defaults over cookbook node attributes. Do not add +`attributes/` back to provide defaults for resources. + +## Resource Defaults + +Cookbook-owned defaults should live on resources as static defaults, `lazy` helper calls, or helper +methods in `libraries/`. This keeps defaults visible at the resource boundary and testable through +ChefSpec. + +Do not write cookbook state into `node.default`, `node.normal`, `node.override`, or +`node.automatic`. In particular, do not reintroduce `node['java']` as an API surface for +`java_home`, `jdk_version`, `download_path`, install type, JCE values, or similar resource inputs. + +Do not create custom Ohai plugins for cookbook defaults. Ohai automatic attributes should describe +discovered machine facts, not cookbook policy or resource configuration. + +## Platform Support + +Keep `metadata.rb`, Kitchen files, and GitHub Actions matrices aligned. Platform entries should be +current, non-EOL, and backed by either vendor support or explicit cookbook helper behavior. + +OpenJDK package installs use the platform package manager where helper logic supports the requested +Java version. Source installs remain the fallback when a requested version is not available through +the package path. + +## Dependency Management + +Use `Policyfile.rb` for dependency resolution. Keep it local-only unless a real external cookbook +dependency is introduced. Do not add `default_source :supermarket` when every cookbook in the policy +is supplied by a path. + +Avoid external cookbook dependencies for simple file edits in custom resources. Prefer native Chef +resources so unit tests and Kitchen do not need to contact Supermarket during Policyfile setup. + +Do not reintroduce Berkshelf files or ChefSpec Berkshelf loading unless there is an explicit +compatibility reason. + +## Resource Notes + +`java_alternatives` accepts `bin_cmds` as an Array. Its public actions are `:set` and `:unset`. +Keep both actions covered by ChefSpec when changing alternatives behavior. + +Linux install resources that include the shared Linux partial (`openjdk_pkg_install`, +`openjdk_source_install`, `openjdk_install`, `corretto_install`, and `temurin_package_install`) +default `reset_alternatives` to `true` through that partial. + +`java_certificate` should provide sensible resource defaults without reading `node['java']`. +Current defaults are Java 17 and a platform-specific OpenJDK package `java_home` derived from helper +logic. + +`java_jce` documents legacy Oracle JCE policy file installation only. It should not be described as +a general Java vendor installation path. JCE URL, checksum, and Java home are explicit resource +inputs; staging defaults to Chef's file cache path. + +`temurin_package_install` does not have an `air_gap` property. It supports `repository_uri` for +alternate or mirrored package repositories. The resource must not make live Adoptium API calls while +evaluating defaults. + +Amazon Corretto installs are source archive based and support the architecture-specific Corretto +archive naming handled by helper code (`x64` and `aarch64`). Kitchen and CI cover Corretto 11 and 17 +only; do not add Corretto suites for other majors unless `libraries/corretto_helpers.rb`, docs, and +tests are updated with explicit archive metadata. + +`openjdk_source_install` documentation examples should call `openjdk_source_install`, not the +dispatcher resource `openjdk_install`. diff --git a/Berksfile b/Berksfile deleted file mode 100644 index e09849c7..00000000 --- a/Berksfile +++ /dev/null @@ -1,7 +0,0 @@ -source 'https://supermarket.chef.io' - -metadata - -group :integration do - cookbook 'test', path: 'test/fixtures/cookbooks/test' -end diff --git a/Policyfile.rb b/Policyfile.rb new file mode 100644 index 00000000..9fea7a53 --- /dev/null +++ b/Policyfile.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +name 'java' + +cookbook 'java', path: '.' +cookbook 'test', path: 'test/fixtures/cookbooks/test' + +run_list 'test::base' + +named_run_list :base, 'test::base' +named_run_list :openjdk, 'test::openjdk' +named_run_list :openjdk_pkg, 'test::openjdk_pkg' +named_run_list :temurin_pkg, 'test::temurin_pkg' +named_run_list :corretto, 'test::corretto' +named_run_list :java_cert, 'test::java_cert' diff --git a/README.md b/README.md index 1673d7af..65664747 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![OpenCollective](https://opencollective.com/sous-chefs/sponsors/badge.svg)](#sponsors) [![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0) -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/). +This cookbook installs a Java JDK/JRE. It defaults to installing [OpenJDK](https://openjdk.java.net/), but it can also install [Eclipse Temurin](https://adoptium.net/temurin/) and [Amazon Corretto](https://corretto.aws/). ## Maintainers @@ -25,14 +25,14 @@ Chef 15.3+ ## Resources -- [adoptopenjdk_install](https://github.com/sous-chefs/java/blob/master/documentation/resources/adoptopenjdk_install.md) -- [adoptopenjdk_macos_install](https://github.com/sous-chefs/java/blob/master/documentation/resources/adoptopenjdk_macos_install.md) - [alternatives](https://github.com/sous-chefs/java/blob/master/documentation/resources/alternatives.md) - [certificate](https://github.com/sous-chefs/java/blob/master/documentation/resources/certificate.md) - [corretto_install](https://github.com/sous-chefs/java/blob/master/documentation/resources/corretto_install.md) - [jce](https://github.com/sous-chefs/java/blob/master/documentation/resources/jce.md) - [openjdk_install](https://github.com/sous-chefs/java/blob/master/documentation/resources/openjdk_install.md) - [openjdk_pkg_install](https://github.com/sous-chefs/java/blob/master/documentation/resources/openjdk_pkg_install.md) +- [openjdk_source_install](https://github.com/sous-chefs/java/blob/master/documentation/resources/openjdk_source_install.md) +- [temurin_package_install](https://github.com/sous-chefs/java/blob/master/documentation/resources/temurin_package_install.md) ## Contributors diff --git a/documentation/resources/alternatives.md b/documentation/resources/alternatives.md index 902e4f6b..cb599c9d 100644 --- a/documentation/resources/alternatives.md +++ b/documentation/resources/alternatives.md @@ -15,10 +15,10 @@ The `java_alternatives` resource uses `update-alternatives` command to set and u | Name | Type | Default | Description | | -------------------- | ------------- | ------- | ---------------------------------------------------------------------------- | | `java_location` | `String` | | Java installation location | -| `bin_cmds` | `String` | | Array of Java tool names to set or unset alternatives on | +| `bin_cmds` | `Array` | | Array of Java tool names to set or unset alternatives on | | `default` | `true, false` | `true` | Whether to set the Java tools as system default. Boolean, defaults to `true` | | `priority` | `Integer` | `1061` | Priority of the alternatives. Integer, defaults to `1061` | -| `reset_alternatives` | `true, false` | `true` | Whether to reset alternatives before setting them | +| `reset_alternatives` | `true, false` | `false` | Whether to reset alternatives before setting them | - `java_location`: Java installation location. - `bin_cmds`: . @@ -29,7 +29,7 @@ The `java_alternatives` resource uses `update-alternatives` command to set and u ```ruby java_alternatives "set java alternatives" do - java_location '/usr/local/java' - bin_cmds ["java", "javac"] + java_location '/usr/local/java' + bin_cmds ["java", "javac"] end ``` diff --git a/documentation/resources/certificate.md b/documentation/resources/certificate.md index 019f1a77..864c0c87 100644 --- a/documentation/resources/certificate.md +++ b/documentation/resources/certificate.md @@ -13,17 +13,17 @@ It can also populate the keystore with a certificate retrieved from a given SSL ## Properties -| Name | Type | Default | Description | -| ----------------- | ------ | --------------------------- | --------------------------------------------------------------------------------------- | -| `java_home` | | `node['java']['java_home']` | The java home directory | -| `java_version` | | `node['java']['jdk_version']` | The java version | -| `keystore_path` | String | | Path to the keystore | -| `keystore_passwd` | String | `changeit` | Password to the keystore | -| `cert_alias` | String | | The alias of the certificate in the keystore. This defaults to the name of the resource | -| `cert_data` | String | | The certificate data to install | -| `cert_file` | String | | Path to a certificate file to install | -| `ssl_endpoint` | String | | An SSL end-point from which to download the certificate | -| `starttls` | String | | Control the TLS protocol handler when fetching a remote certificate from `ssl_endpoint` | +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| `java_home` | String | Platform-specific path for `java_version` | The java home directory | +| `java_version` | String | `17` | The java version | +| `keystore_path` | String | | Path to the keystore | +| `keystore_passwd` | String | `changeit` | Password to the keystore | +| `cert_alias` | String | | The alias of the certificate in the keystore. This defaults to the name of the resource | +| `cert_data` | String | | The certificate data to install | +| `cert_file` | String | | Path to a certificate file to install | +| `ssl_endpoint` | String | | An SSL end-point from which to download the certificate | +| `starttls` | String | | Control the TLS protocol handler when fetching a remote certificate from `ssl_endpoint` | ## Examples diff --git a/documentation/resources/corretto_install.md b/documentation/resources/corretto_install.md index 2c078524..58e9fddf 100644 --- a/documentation/resources/corretto_install.md +++ b/documentation/resources/corretto_install.md @@ -14,21 +14,21 @@ Introduced: v8.0.0 ## Properties -| Name | Type | Default | Description | -| --------------------- | --------------- | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------- | -| version | String | | Java version to install | -| full_version | String | | Used to configure the package directory, change this is the version installed by the package is no longer correct | -| url | String | `default_corretto_url(version)` | The URL to download from | -| checksum | String | | The checksum for the downloaded file | -| java_home | String | Based on the version | Set to override the java_home | -| java_home_mode | Integer, String | `0755` | The permission for the Java home directory | -| java_home_owner | String | `root` | Owner of the Java Home | -| java_home_group | String | `node['root_group']` | Group for the Java Home | -| default | Boolean | `true` | Whether to set this as the default Java | -| bin_cmds | Array | `default_corretto_bin_cmds(version)` | A list of bin_cmds based on the version and variant | -| alternatives_priority | Integer | `1` | Alternatives priority to set for this Java | -| reset_alternatives | Boolean | `true` | Whether to reset alternatives before setting | -| skip_alternatives | Boolean | `false` | Skip alternatives installation completely | +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| version | String | | Java version to install | +| full_version | String | | Used to configure the package directory, change this is the version installed by the package is no longer correct | +| url | String | `default_corretto_url(version)` | The URL to download from | +| checksum | String | | The checksum for the downloaded file | +| java_home | String | Based on the version | Set to override the java_home | +| java_home_mode | Integer, String | `0755` | The permission for the Java home directory | +| java_home_owner | String | `root` | Owner of the Java Home | +| java_home_group | String | `node['root_group']` | Group for the Java Home | +| default | Boolean | `true` | Whether to set this as the default Java | +| bin_cmds | Array | `default_corretto_bin_cmds(version)` | A list of bin_cmds based on the version and variant | +| alternatives_priority | Integer | `1` | Alternatives priority to set for this Java | +| reset_alternatives | Boolean | `true` | Whether to reset alternatives before setting | +| skip_alternatives | Boolean | `false` | Skip alternatives installation completely | ## Examples diff --git a/documentation/resources/jce.md b/documentation/resources/jce.md index d0714855..3a154fa1 100644 --- a/documentation/resources/jce.md +++ b/documentation/resources/jce.md @@ -8,18 +8,21 @@ ## Actions - `:install`: Installs the JCE policy files. +- `:remove`: Removes the staged JCE policy files, archive, and managed policy symlinks. ## Properties -| Name | Type | Default | Description | -| -------------- | ------ | -------------------------------------------------------- | -------------------------------------------------------------------------- | -| `jdk_version` | String | `node['java']['jdk_version']` | The Java version to install into | -| `jce_url` | String | `node['java']['oracle']['jce'][jdk_version]['url']` | The URL for the JCE distribution | -| `jce_checksum` | String | `node['java']['oracle']['jce'][jdk_version]['checksum']` | The checksum of the JCE distribution | -| `jce_cookie` | String | `node['java']['oracle']['accept_oracle_download_terms']` | Indicates that you accept Oracle's EULA | -| `jce_home` | String | `node['java']['oracle']['jce']['home']` | The location where JCE files will be decompressed for installation | -| `java_home` | String | `node['java']['java_home']` | The location of the Java installation | -| `principal` | String | `node['java']['windows']['owner']` | For Windows installations only, this determines the owner of the JCE files | +| Name | Type | Default | Description | +| --------------- | ------ | -------------------------------------------------------- | -------------------------------------------------------------------------- | +| `jdk_version` | String | Resource name | The Java version to install into | +| `jce_url` | String | Required | The URL for the JCE distribution | +| `jce_checksum` | String | Required | The checksum of the JCE distribution | +| `jce_cookie` | String | `''` | Indicates that you accept Oracle's EULA | +| `jce_home` | String | `/usr/lib/jvm/jce` | The location where JCE files will be decompressed for installation | +| `java_home` | String | Required | The location of the Java installation | +| `principal` | String | `administrator` | For Windows installations only, this determines the owner of the JCE files | +| `download_path` | String | Chef file cache path | Path used to stage the JCE archive | +| `install_type` | String | `jdk` | Whether the Java install is a jdk or jre layout | ## Examples diff --git a/documentation/resources/openjdk_pkg_install.md b/documentation/resources/openjdk_pkg_install.md index b135c291..885d5bb1 100644 --- a/documentation/resources/openjdk_pkg_install.md +++ b/documentation/resources/openjdk_pkg_install.md @@ -14,18 +14,18 @@ Introduced: v8.1.0 ## Properties -| Name | Type | Default | Description | -| --------------------- | ------- | ------------------------------------ | --------------------------------------------------- | -| version | String | | Java major version to install | -| pkg_names | Array | `default_openjdk_pkg_names(version)` | List of packages to install | -| pkg_version | String | `nil` | Package version to install | -| java_home | String | Based on the version | Set to override the java_home | -| default | Boolean | `true` | Whether to set this as the default Java | -| bin_cmds | Array | `default_bin_cmds(version)` | A list of bin_cmds based on the version and variant | -| alternatives_priority | Integer | `1062` | Alternatives priority to set for this Java | -| reset_alternatives | Boolean | `true` | Whether to reset alternatives before setting | -| skip_alternatives | Boolean | `false` | Skip alternatives installation completely | -| repository_uri | String | `nil` | URI for the repository mirror to use instead of default repository URLs | +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| version | String | | Java major version to install | +| pkg_names | Array | `default_openjdk_pkg_names(version)` | List of packages to install | +| pkg_version | String | `nil` | Package version to install | +| java_home | String | Based on the version | Set to override the java_home | +| default | Boolean | `true` | Whether to set this as the default Java | +| bin_cmds | Array | `default_bin_cmds(version)` | A list of bin_cmds based on the version and variant | +| alternatives_priority | Integer | `1062` | Alternatives priority to set for this Java | +| reset_alternatives | Boolean | `true` | Whether to reset alternatives before setting | +| skip_alternatives | Boolean | `false` | Skip alternatives installation completely | +| repository_uri | String | `nil` | URI for the repository mirror to use instead of default repository URLs | ## Examples diff --git a/documentation/resources/openjdk_source_install.md b/documentation/resources/openjdk_source_install.md index c6d2f11b..7032ba8d 100644 --- a/documentation/resources/openjdk_source_install.md +++ b/documentation/resources/openjdk_source_install.md @@ -24,7 +24,7 @@ Introduced: v8.0.0 | java_home_owner | String | `root` | Owner of the Java Home | | java_home_group | String | `node['root_group']` | Group for the Java Home | | default | Boolean | `true` | Whether to set this as the default Java | -| bin_cmds | Array | `default_bin_cmds(version)` | A list of bin_cmds based on the version and variant | +| bin_cmds | Array | `default_bin_cmds(version)` | A list of bin_cmds based on the version and variant | | alternatives_priority | Integer | `1` | Alternatives priority to set for this Java | | reset_alternatives | Boolean | `true` | Whether to reset alternatives before setting | | skip_alternatives | Boolean | `false` | Skip alternatives installation completely | @@ -34,13 +34,13 @@ Introduced: v8.0.0 To install OpenJDK 11 and set it as the default Java: ```ruby -openjdk_install '11' +openjdk_source_install '11' ``` To install OpenJDK 11 and set it as second highest priority: ```ruby -openjdk_install '11' do +openjdk_source_install '11' do alternatives_priority 2 end ``` diff --git a/documentation/resources/temurin_package_install.md b/documentation/resources/temurin_package_install.md index 82e9779c..a1965f8a 100644 --- a/documentation/resources/temurin_package_install.md +++ b/documentation/resources/temurin_package_install.md @@ -2,7 +2,7 @@ [back to resource list](https://github.com/sous-chefs/java#resources) -Installs Java Temurin (AdoptOpenJDK) packages provided by Adoptium. This resource handles the repository setup and package installation for Temurin JDK packages across various platforms. +Installs Eclipse Temurin packages provided by Adoptium. This resource handles the repository setup and package installation for Temurin JDK packages across various platforms. Introduced: v12.0.0 @@ -13,19 +13,18 @@ Introduced: v12.0.0 ## Properties -| Property | Type | Default | Description | -|-----------------------|----------------|----------------------------------------|----------------------------------------------| -| `version` | String | Name Property | Java version to install (e.g. '8', '11', '17') | -| `pkg_name` | String | `temurin-#{version}-jdk` | Package name to install | -| `pkg_version` | String | `nil` | Package version to install | -| `java_home` | String | Platform-specific JAVA_HOME | Path to set as JAVA_HOME | -| `bin_cmds` | Array | Version-specific binary commands | Commands for alternatives | -| `alternatives_priority` | Integer | 1062 | Priority for alternatives system | -| `reset_alternatives` | Boolean | true | Whether to reset alternatives before setting | -| `default` | Boolean | true | Whether to set this as the default Java | -| `skip_alternatives` | Boolean | false | Skip alternatives installation completely | -| `repository_uri` | String | `nil` | URI for the repository mirror to use instead of default repository URLs | -| air_gap | Boolean | false | Whether to install in air-gap mode | +| Property | Type | Default | Description | +| --- | --- | --- | --- | +| `version` | String | Name Property | Java version to install (e.g. '8', '11', '17') | +| `pkg_name` | String | `temurin-#{version}-jdk` | Package name to install | +| `pkg_version` | String | `nil` | Package version to install | +| `java_home` | String | Platform-specific JAVA_HOME | Path to set as JAVA_HOME | +| `bin_cmds` | Array | Version-specific binary commands | Commands for alternatives | +| `alternatives_priority` | Integer | `1062` | Priority for alternatives system | +| `reset_alternatives` | Boolean | `true` | Whether to reset alternatives before setting | +| `default` | Boolean | `true` | Whether to set this as the default Java | +| `skip_alternatives` | Boolean | `false` | Skip alternatives installation completely | +| `repository_uri` | String | `nil` | URI for the repository mirror to use instead of default repository URLs | ## Platform Support @@ -80,7 +79,5 @@ Each platform will have the appropriate Adoptium repository configured automatic ## Additional Information -- This resource uses the Adoptium API to validate available releases. -- The resource will warn if a requested version is not available as an LTS release. - For most use cases, you can simply specify the major version number. -- Air-gap mode disables version checking via the Adoptium API and instead uses the version specified in the `pkg_version` property. +- `repository_uri` can point package repository setup at an internal mirror. diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index 1d8623e0..e898fcd0 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -52,11 +52,6 @@ platforms: image: dokken/fedora-latest pid_one_command: /usr/lib/systemd/systemd - - name: opensuse-leap-15 - driver: - image: dokken/opensuse-leap-15 - pid_one_command: /usr/lib/systemd/systemd - - name: oraclelinux-8 driver: image: dokken/oraclelinux-8 @@ -82,11 +77,6 @@ platforms: image: dokken/rockylinux-10 pid_one_command: /usr/lib/systemd/systemd - - name: ubuntu-20.04 - driver: - image: dokken/ubuntu-20.04 - pid_one_command: /bin/systemd - - name: ubuntu-22.04 driver: image: dokken/ubuntu-22.04 diff --git a/kitchen.global.yml b/kitchen.global.yml index 1740e461..ad83b623 100644 --- a/kitchen.global.yml +++ b/kitchen.global.yml @@ -17,16 +17,17 @@ verifier: platforms: - name: almalinux-8 - name: almalinux-9 + - name: almalinux-10 - name: amazonlinux-2023 - name: centos-stream-9 - - name: debian-11 + - name: centos-stream-10 - name: debian-12 + - name: debian-13 - name: fedora-latest - - name: opensuse-leap-15 - name: oraclelinux-8 - name: oraclelinux-9 - name: rockylinux-8 - name: rockylinux-9 - - name: ubuntu-20.04 + - name: rockylinux-10 - name: ubuntu-22.04 - name: ubuntu-24.04 diff --git a/kitchen.yml b/kitchen.yml index 21f690a0..cdb91a2c 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -11,19 +11,28 @@ verifier: name: inspec platforms: + - name: almalinux-8 + - name: almalinux-9 + - name: almalinux-10 - name: amazonlinux-2023 + - name: centos-stream-9 + - name: centos-stream-10 - name: debian-12 - name: debian-13 - - name: freebsd-13 - name: fedora-latest - - name: rockylinux-9 + - name: oraclelinux-8 + - name: oraclelinux-9 - name: rockylinux-8 + - name: rockylinux-9 + - name: rockylinux-10 - name: ubuntu-22.04 - - name: ubuntu-20.04 + - name: ubuntu-24.04 suites: # OpenJDK - name: openjdk-11 + provisioner: + named_run_list: openjdk run_list: - recipe[test::openjdk] attributes: { version: "11" } @@ -32,6 +41,8 @@ suites: inputs: { java_version: "11" } - name: openjdk-17 + provisioner: + named_run_list: openjdk run_list: - recipe[test::openjdk] attributes: { version: "17" } @@ -41,6 +52,8 @@ suites: # Temurin - name: temurin-11 + provisioner: + named_run_list: temurin_pkg run_list: - recipe[test::temurin_pkg] attributes: @@ -50,6 +63,8 @@ suites: inputs: { java_version: "11" } - name: temurin-17 + provisioner: + named_run_list: temurin_pkg run_list: - recipe[test::temurin_pkg] attributes: @@ -60,6 +75,8 @@ suites: inputs: { java_version: "17" } - name: temurin-21 + provisioner: + named_run_list: temurin_pkg run_list: - recipe[test::temurin_pkg] attributes: @@ -70,6 +87,8 @@ suites: inputs: { java_version: "21" } - name: temurin-25 + provisioner: + named_run_list: temurin_pkg run_list: - recipe[test::temurin_pkg] attributes: @@ -80,15 +99,9 @@ suites: inputs: { java_version: "25" } # Corretto - - name: corretto-8 - run_list: - - recipe[test::corretto] - attributes: { version: "8" } - verifier: - inspec_tests: [test/integration/corretto] - inputs: { java_version: "8" } - - name: corretto-11 + provisioner: + named_run_list: corretto run_list: - recipe[test::corretto] attributes: { version: "11" } @@ -97,25 +110,11 @@ suites: inputs: { java_version: "11" } - name: corretto-17 + provisioner: + named_run_list: corretto run_list: - recipe[test::corretto] attributes: { version: "17" } verifier: inspec_tests: [test/integration/corretto] inputs: { java_version: "17" } - - - name: corretto-21 - run_list: - - recipe[test::corretto] - attributes: { version: "21" } - verifier: - inspec_tests: [test/integration/corretto] - inputs: { java_version: "21" } - - - name: corretto-25 - run_list: - - recipe[test::corretto] - attributes: { version: "25" } - verifier: - inspec_tests: [test/integration/corretto] - inputs: { java_version: "25" } diff --git a/libraries/bin_cmd_helpers.rb b/libraries/bin_cmd_helpers.rb index 3127b71d..ac8de87b 100644 --- a/libraries/bin_cmd_helpers.rb +++ b/libraries/bin_cmd_helpers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Java module Cookbook module BinCmdHelpers @@ -15,7 +17,7 @@ def default_bin_cmds(version) %w(jaotc jarsigner javac javap jconsole jdeprscan jfr jimage jjs jmap jps jshell jstat keytool rmic rmiregistry unpack200 jar java javadoc jcmd jdb jdeps jhsdb jinfo jlink jmod jrunscript jstack jstatd pack200 rmid serialver) when '17' %w(jarsigner javac javap jconsole jdeprscan jfr jimage jjs jmap jps jshell jstat keytool rmic rmiregistry unpack200 jar java javadoc jcmd jdb jdeps jhsdb jinfo jlink jmod jrunscript jstack jstatd pack200 rmid serialver) - when '18', '19', '20', '21', '22', 'latest' + when '18', '19', '20', '21', '22', '23', '24', '25', 'latest' %w(jarsigner javac javap jconsole jdeprscan jfr jimage jjs jmap jps jshell jstat keytool rmic rmiregistry unpack200 jar java javadoc jcmd jdb jdeps jhsdb jinfo jlink jmod jrunscript jstack jstatd pack200 rmid serialver jwebserver) else Chef::Log.fatal('Version specified does not have a default set of bin_cmds') diff --git a/libraries/certificate_helpers.rb b/libraries/certificate_helpers.rb index 3425fc76..e2491486 100644 --- a/libraries/certificate_helpers.rb +++ b/libraries/certificate_helpers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Java module Cookbook module CertificateHelpers @@ -11,7 +13,7 @@ def default_truststore_path(version, java_home) end def keystore_argument(cacerts, truststore_path) - cacerts ? '-cacerts' : "-keystore #{truststore_path}" + cacerts ? ['-cacerts'] : ['-keystore', truststore_path] end end end diff --git a/libraries/corretto_helpers.rb b/libraries/corretto_helpers.rb index 0d6a8b38..0e53c7cd 100644 --- a/libraries/corretto_helpers.rb +++ b/libraries/corretto_helpers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Java module Cookbook module CorrettoHelpers diff --git a/libraries/openjdk_helpers.rb b/libraries/openjdk_helpers.rb index 1cde1059..30114df1 100644 --- a/libraries/openjdk_helpers.rb +++ b/libraries/openjdk_helpers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Java module Cookbook module OpenJdkHelpers @@ -9,7 +11,7 @@ def lts # e.g. https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.3%2B7/OpenJDK17U-jdk_aarch64_linux_hotspot_17.0.3_7.tar.gz def sub_dir(url) URI.parse(url) - url.split('/')[7].split('_')[0].gsub('%2', '-').downcase + url.split('/')[7].split('_').first.gsub('%2', '-').downcase end def default_openjdk_install_method(version) @@ -17,17 +19,35 @@ def default_openjdk_install_method(version) when 'amazon' 'source' when 'rhel' - supported = lts.delete('11') + supported = node['platform_version'].to_i >= 10 ? [] : lts supported.include?(version) ? 'package' : 'source' + when 'fedora' + 'source' when 'debian' - case node['platform_version'] - when '10', '18.04' - supported = lts - ['17'] - supported.include?(version) ? 'package' : 'source' - when '9' - %w(8).include?(version) ? 'package' : 'source' + if node['platform'] == 'debian' + case node['platform_version'].to_i + when 9 + %w(8).include?(version) ? 'package' : 'source' + when 10 + supported = lts - ['17'] + supported.include?(version) ? 'package' : 'source' + when 11 + lts.include?(version) ? 'package' : 'source' + when 12 + %w(17).include?(version) ? 'package' : 'source' + else + 'source' + end else - lts.include?(version) ? 'package' : 'source' + case node['platform_version'] + when '10', '18.04' + supported = lts - ['17'] + supported.include?(version) ? 'package' : 'source' + when '9' + %w(8).include?(version) ? 'package' : 'source' + else + lts.include?(version) ? 'package' : 'source' + end end else lts.include?(version) ? 'package' : 'source' diff --git a/libraries/temurin_helpers.rb b/libraries/temurin_helpers.rb index 87a2e210..58285b7d 100644 --- a/libraries/temurin_helpers.rb +++ b/libraries/temurin_helpers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Java module Cookbook module TemurinHelpers @@ -48,7 +50,3 @@ def temurin_version_available?(version) end end end - -# Ensure the helper is included in the recipe DSL -Chef::DSL::Recipe.include Java::Cookbook::TemurinHelpers -Chef::Resource.include Java::Cookbook::TemurinHelpers diff --git a/metadata.rb b/metadata.rb index b491406f..999bf085 100644 --- a/metadata.rb +++ b/metadata.rb @@ -8,16 +8,12 @@ chef_version '>= 16.0' version '14.0.1' -supports 'debian' -supports 'ubuntu' -supports 'centos' -supports 'redhat' -supports 'scientific' +supports 'almalinux', '>= 8.0' +supports 'amazon', '>= 2023.0' +supports 'centos_stream', '>= 9.0' +supports 'debian', '>= 12.0' supports 'fedora' -supports 'amazon' -supports 'oracle' -supports 'freebsd' -supports 'suse' -supports 'opensuseleap' - -depends 'line' +supports 'oracle', '>= 8.0' +supports 'redhat', '>= 8.0' +supports 'rocky', '>= 8.0' +supports 'ubuntu', '>= 22.04' diff --git a/resources/alternatives.rb b/resources/alternatives.rb index 06f680d7..f67e7c44 100644 --- a/resources/alternatives.rb +++ b/resources/alternatives.rb @@ -1,3 +1,6 @@ +# frozen_string_literal: true + +provides :java_alternatives unified_mode true property :java_location, @@ -6,6 +9,11 @@ property :bin_cmds, Array, + callbacks: { + 'must contain only command names' => lambda { |cmds| + cmds.all? { |cmd| cmd.match?(/\A[A-Za-z0-9_.+-]+\z/) } + }, + }, description: 'Array of Java tool names to set or unset alternatives on' property :default, @@ -25,11 +33,9 @@ action :set do bin_cmds_to_setup = parse_java_alternatives - # Use not_if guard to make resource fully idempotent set_alternatives(bin_cmds_to_setup) do |cmd, alt_path| - # Skip if the alternative file already exists with our path alternative_exists = ::File.exist?("/var/lib/alternatives/#{cmd}") && - shell_out("#{alternatives_cmd} --display #{cmd}").stdout.include?(alt_path) + alternatives_display(cmd).stdout.include?(alt_path) Chef::Log.debug("Alternative for #{cmd} exists with correct path? #{alternative_exists}") alternative_exists end @@ -38,7 +44,7 @@ action :unset do new_resource.bin_cmds.each do |cmd| converge_by("Remove alternative for #{cmd}") do - shell_out("#{alternatives_cmd} --remove #{cmd} #{new_resource.java_location}/bin/#{cmd}") + shell_out!(alternatives_cmd, '--remove', cmd, "#{new_resource.java_location}/bin/#{cmd}") end end end @@ -48,6 +54,10 @@ def alternatives_cmd platform_family?('rhel', 'fedora', 'amazon') ? 'alternatives' : 'update-alternatives' end + def alternatives_display(cmd) + shell_out(alternatives_cmd, '--display', cmd) + end + def parse_java_alternatives bin_cmds_to_setup = [] new_resource.bin_cmds.each do |cmd| @@ -60,7 +70,6 @@ def parse_java_alternatives next end - # Add this command to the list of commands to process bin_cmds_to_setup << [cmd, bin_path, alt_path, priority] end bin_cmds_to_setup @@ -68,23 +77,17 @@ def parse_java_alternatives def set_alternatives(bin_cmds) bin_cmds.each do |cmd, bin_path, alt_path, priority| - # Use a custom not_if condition if provided as a block if block_given? && yield(cmd, alt_path) Chef::Log.debug "Skipping alternative for #{cmd} as it already exists with correct path" next end - # Get the full output of update-alternatives for this command - display_result = shell_out("#{alternatives_cmd} --display #{cmd}") + display_result = alternatives_display(cmd) cmd_output = display_result.stdout - # Check if the alternative exists at all alternative_system_exists = display_result.exitstatus == 0 && !cmd_output.empty? - - # Check if our specific path is already configured as an alternative our_alternative_exists = alternative_system_exists && cmd_output.include?(alt_path) - # Parse the priority of the existing alternative existing_priority = nil if our_alternative_exists if cmd_output =~ /#{Regexp.escape(alt_path)}.*priority\s+(\d+)/ @@ -92,57 +95,30 @@ def set_alternatives(bin_cmds) end end - # Only remove alternative if it exists with a different priority if our_alternative_exists && existing_priority && existing_priority != priority converge_by("Removing alternative for #{cmd} with old priority #{existing_priority}") do - remove_cmd = shell_out("#{alternatives_cmd} --remove #{cmd} #{alt_path}") - unless remove_cmd.exitstatus == 0 - raise(%( remove alternative failed )) - end + shell_out!(alternatives_cmd, '--remove', cmd, alt_path) end end - # Check if the alternative file exists at all alternative_file_exists = ::File.exist?("/var/lib/alternatives/#{cmd}") - # Install the alternative if needed if !our_alternative_exists || !alternative_file_exists converge_by("Add alternative for #{cmd}") do if new_resource.reset_alternatives && alternative_file_exists - shell_out("rm /var/lib/alternatives/#{cmd}") - end - install_cmd = shell_out("#{alternatives_cmd} --install #{bin_path} #{cmd} #{alt_path} #{priority}") - unless install_cmd.exitstatus == 0 - raise(%( install alternative failed )) + ::FileUtils.rm_f("/var/lib/alternatives/#{cmd}") end + shell_out!(alternatives_cmd, '--install', bin_path, cmd, alt_path, priority.to_s) end end - # set the alternative if default next unless new_resource.default - alternative_is_set = shell_out("#{alternatives_cmd} --display #{cmd} | grep \"link currently points to #{alt_path}\"").exitstatus == 0 + alternative_is_set = alternatives_display(cmd).stdout.include?("link currently points to #{alt_path}") next if alternative_is_set converge_by("Set alternative for #{cmd}") do Chef::Log.debug "Setting alternative for #{cmd}" - set_cmd = shell_out("#{alternatives_cmd} --set #{cmd} #{alt_path}") - unless set_cmd.exitstatus == 0 - raise(%( set alternative failed )) - end + shell_out!(alternatives_cmd, '--set', cmd, alt_path) end end end end - -action :unset do - new_resource.bin_cmds.each do |cmd| - converge_by("Remove alternative for #{cmd}") do - shell_out("#{alternatives_cmd} --remove #{cmd} #{new_resource.java_location}/bin/#{cmd}") - end - end -end - -action_class do - def alternatives_cmd - platform_family?('rhel', 'fedora', 'amazon') ? 'alternatives' : 'update-alternatives' - end -end diff --git a/resources/certificate.rb b/resources/certificate.rb index 62053219..c39e4016 100644 --- a/resources/certificate.rb +++ b/resources/certificate.rb @@ -1,21 +1,26 @@ +# frozen_string_literal: true + +provides :java_certificate unified_mode true include Java::Cookbook::CertificateHelpers +include Java::Cookbook::OpenJdkHelpers property :cert_alias, String, + regex: /\A[A-Za-z0-9_.-]+\z/, name_property: true, description: 'The alias of the certificate in the keystore. This defaults to the name of the resource' -property :java_home, - String, - default: lazy { node['java']['java_home'] }, - description: 'The java home directory' - property :java_version, String, - default: lazy { node['java']['jdk_version'] }, + default: '17', description: 'The major java version' +property :java_home, + String, + default: lazy { default_openjdk_pkg_java_home(java_version) }, + description: 'The java home directory' + property :cacerts, [true, false], default: true, @@ -41,6 +46,11 @@ property :ssl_endpoint, String, + callbacks: { + 'must be a host:port endpoint' => lambda { |endpoint| + endpoint.match?(/\A[A-Za-z0-9.-]+:\d+\z/) + }, + }, description: 'An SSL end-point from which to download the certificate' property :starttls, @@ -56,14 +66,14 @@ action :install do require 'openssl' - keystore_argument = keystore_argument(new_resource.cacerts, new_resource.keystore_path) + keystore_arguments = keystore_argument(new_resource.cacerts, new_resource.keystore_path) certdata = new_resource.cert_data || fetch_certdata hash = OpenSSL::Digest::SHA512.hexdigest(certdata) certfile = ::File.join(new_resource.file_cache_path, "#{new_resource.cert_alias}.cert.#{hash}") - cmd = Mixlib::ShellOut.new("#{new_resource.java_home}/bin/keytool -list #{keystore_argument} -storepass #{new_resource.keystore_passwd} -rfc -alias \"#{new_resource.cert_alias}\"") + cmd = keytool('-list', *keystore_arguments, '-storepass', new_resource.keystore_passwd, '-rfc', '-alias', new_resource.cert_alias) cmd.run_command keystore_cert = cmd.stdout.match(/^[-]+BEGIN.*END(\s|\w)+[-]+$/m).to_s @@ -72,16 +82,16 @@ if keystore_cert_digest == certfile_digest Chef::Log.debug("Certificate \"#{new_resource.cert_alias}\" in keystore \"#{new_resource.keystore_path}\" is up-to-date.") else - cmd = Mixlib::ShellOut.new("#{new_resource.java_home}/bin/keytool -list #{keystore_argument} -storepass #{new_resource.keystore_passwd} -v") + cmd = keytool('-list', *keystore_arguments, '-storepass', new_resource.keystore_passwd, '-v') cmd.run_command Chef::Log.debug(cmd.format_for_exception) Chef::Application.fatal!("Error querying keystore for existing certificate: #{cmd.exitstatus}", cmd.exitstatus) unless cmd.exitstatus == 0 - has_key = !cmd.stdout[/Alias name: \b#{new_resource.cert_alias}\s*$/i].nil? + has_key = !cmd.stdout[/Alias name: \b#{Regexp.escape(new_resource.cert_alias)}\s*$/i].nil? if has_key converge_by("delete existing certificate #{new_resource.cert_alias} from #{new_resource.keystore_path}") do - cmd = Mixlib::ShellOut.new("#{new_resource.java_home}/bin/keytool -delete -alias \"#{new_resource.cert_alias}\" #{keystore_argument} -storepass #{new_resource.keystore_passwd}") + cmd = keytool('-delete', '-alias', new_resource.cert_alias, *keystore_arguments, '-storepass', new_resource.keystore_passwd) cmd.run_command Chef::Log.debug(cmd.format_for_exception) unless cmd.exitstatus == 0 @@ -91,10 +101,11 @@ end end + ::FileUtils.mkdir_p(new_resource.file_cache_path) ::File.open(certfile, 'w', 0o644) { |f| f.write(certdata) } converge_by("add certificate #{new_resource.cert_alias} to keystore #{new_resource.keystore_path}") do - cmd = Mixlib::ShellOut.new("#{new_resource.java_home}/bin/keytool -import -trustcacerts -alias \"#{new_resource.cert_alias}\" -file #{certfile} #{keystore_argument} -storepass #{new_resource.keystore_passwd} -noprompt") + cmd = keytool('-import', '-trustcacerts', '-alias', new_resource.cert_alias, '-file', certfile, *keystore_arguments, '-storepass', new_resource.keystore_passwd, '-noprompt') cmd.run_command Chef::Log.debug(cmd.format_for_exception) @@ -107,17 +118,17 @@ end action :remove do - keystore_argument = keystore_argument(new_resource.cacerts, new_resource.keystore_path) + keystore_arguments = keystore_argument(new_resource.cacerts, new_resource.keystore_path) - cmd = Mixlib::ShellOut.new("#{new_resource.java_home}/bin/keytool -list #{keystore_argument} -storepass #{new_resource.keystore_passwd} -v | grep \"#{new_resource.cert_alias}\"") + cmd = keytool('-list', *keystore_arguments, '-storepass', new_resource.keystore_passwd, '-v') cmd.run_command - has_key = !cmd.stdout[/Alias name: #{new_resource.cert_alias}/].nil? - does_not_exist = cmd.stdout[/Alias <#{new_resource.cert_alias}> does not exist/].nil? + has_key = !cmd.stdout[/Alias name: #{Regexp.escape(new_resource.cert_alias)}/].nil? + does_not_exist = cmd.stdout[/Alias <#{Regexp.escape(new_resource.cert_alias)}> does not exist/] Chef::Application.fatal!("Error querying keystore for existing certificate: #{cmd.exitstatus}", cmd.exitstatus) unless (cmd.exitstatus == 0) || does_not_exist if has_key converge_by("remove certificate #{new_resource.cert_alias} from #{new_resource.keystore_path}") do - cmd = Mixlib::ShellOut.new("#{new_resource.java_home}/bin/keytool -delete -alias \"#{new_resource.cert_alias}\" #{keystore_argument} -storepass #{new_resource.keystore_passwd}") + cmd = keytool('-delete', '-alias', new_resource.cert_alias, *keystore_arguments, '-storepass', new_resource.keystore_passwd) cmd.run_command unless cmd.exitstatus == 0 Chef::Application.fatal!("Error deleting existing certificate \"#{new_resource.cert_alias}\" in " \ @@ -126,23 +137,28 @@ end end - FileUtils.rm_f("#{new_resource.file_cache_path}/#{new_resource.cert_alias}.cert.*") + FileUtils.rm_f(::Dir.glob(::File.join(new_resource.file_cache_path, "#{new_resource.cert_alias}.cert.*"))) end action_class do + def keytool(*args) + Mixlib::ShellOut.new(::File.join(new_resource.java_home, 'bin', 'keytool'), *args) + end + def fetch_certdata return IO.read(new_resource.cert_file) unless new_resource.cert_file.nil? certendpoint = new_resource.ssl_endpoint - starttls = new_resource.starttls.nil? ? '' : "-starttls #{new_resource.starttls}" unless certendpoint.nil? - cmd = Mixlib::ShellOut.new("echo QUIT | openssl s_client -showcerts -servername #{certendpoint.split(':').first} -connect #{certendpoint} #{starttls} 2> /dev/null | openssl x509") + host = certendpoint.split(':').first + starttls = new_resource.starttls.nil? ? [] : ['-starttls', new_resource.starttls] + cmd = Mixlib::ShellOut.new('openssl', 's_client', '-showcerts', '-servername', host, '-connect', certendpoint, *starttls, input: "QUIT\n", timeout: 30) cmd.run_command Chef::Log.debug(cmd.format_for_exception) Chef::Application.fatal!("Error returned when attempting to retrieve certificate from remote endpoint #{certendpoint}: #{cmd.exitstatus}", cmd.exitstatus) unless cmd.exitstatus == 0 - certout = cmd.stdout + certout = cmd.stdout[/-----BEGIN CERTIFICATE-----.*?-----END CERTIFICATE-----/m].to_s return certout unless certout.empty? Chef::Application.fatal!("Unable to parse certificate from openssl query of #{certendpoint}.", 999) end diff --git a/resources/corretto_install.rb b/resources/corretto_install.rb index 8b4a5ac4..0a5a53ac 100644 --- a/resources/corretto_install.rb +++ b/resources/corretto_install.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + provides :corretto_install unified_mode true include Java::Cookbook::CorrettoHelpers @@ -49,8 +51,6 @@ destination extract_dir end - node.default['java']['java_home'] = new_resource.java_home - # Set up .jinfo file for update-java-alternatives template "/usr/lib/jvm/.java-#{new_resource.version}-corretto.jinfo" do cookbook 'java' @@ -92,4 +92,9 @@ only_if { ::File.exist?(extract_dir) } action :delete end + + file "/usr/lib/jvm/.java-#{new_resource.version}-corretto.jinfo" do + only_if { platform_family?('debian') } + action :delete + end end diff --git a/resources/jce.rb b/resources/jce.rb index ee11918b..af69473e 100644 --- a/resources/jce.rb +++ b/resources/jce.rb @@ -1,32 +1,44 @@ +# frozen_string_literal: true + +provides :java_jce unified_mode true property :jdk_version, String, - default: lazy { node['java']['jdk_version'].to_s }, description: 'The Java version to install into' + name_property: true, description: 'The Java version to install into' property :jce_url, String, - default: lazy { node['java']['oracle']['jce'][jdk_version]['url'] }, description: 'The URL for the JCE distribution' + required: true, description: 'The URL for the JCE distribution' property :jce_checksum, String, - default: lazy { node['java']['oracle']['jce'][jdk_version]['checksum'] }, description: 'The checksum of the JCE distribution' + required: true, description: 'The checksum of the JCE distribution' property :java_home, String, - default: lazy { node['java']['java_home'] }, description: 'The location of the Java installation' + required: true, description: 'The location of the Java installation' property :jce_home, String, - default: lazy { node['java']['oracle']['jce']['home'] }, description: 'The location where JCE files will be decompressed for installation' + default: '/usr/lib/jvm/jce', description: 'The location where JCE files will be decompressed for installation' property :jce_cookie, String, - default: lazy { node['java']['oracle']['accept_oracle_download_terms'] ? 'oraclelicense=accept-securebackup-cookie' : '' }, description: 'Indicates that you accept Oracles EULA' + default: '', description: 'Indicates that you accept Oracles EULA' property :principal, String, - default: lazy { platform_family?('windows') ? node['java']['windows']['owner'] : 'administrator' }, description: 'For Windows installations only, this determines the owner of the JCE files' + default: 'administrator', description: 'For Windows installations only, this determines the owner of the JCE files' + +property :download_path, + String, + default: Chef::Config[:file_cache_path], description: 'Path used to stage the JCE archive' + +property :install_type, + String, + equal_to: %w(jdk jre), + default: 'jdk', description: 'Whether the Java install is a jdk or jre layout' action :install do jdk_version = new_resource.jdk_version @@ -36,13 +48,20 @@ jce_home = new_resource.jce_home jce_cookie = new_resource.jce_cookie principal = new_resource.principal + download_path = new_resource.download_path + install_type = new_resource.install_type directory ::File.join(jce_home, jdk_version) do mode '0755' recursive true end - r = remote_file "#{node['java']['download_path']}/jce.zip" do + directory download_path do + mode '0755' + recursive true + end + + r = remote_file ::File.join(download_path, 'jce.zip') do source jce_url checksum jce_checksum headers( @@ -52,7 +71,7 @@ end # JRE installation does not have a jre folder - jre_path = node['java']['install_type'] == 'jdk' ? 'jre' : '' + jre_path = install_type == 'jdk' ? 'jre' : '' if platform_family?('windows') @@ -82,19 +101,23 @@ else package 'unzip' - package 'curl' - - execute 'extract jce' do - command <<-EOF - rm -rf java_jce - mkdir java_jce - cd java_jce - unzip -o ../jce.zip - find ./ -name '*.jar' | xargs -I JCE_JAR mv JCE_JAR #{jce_home}/#{jdk_version}/ - chmod -R 0644 #{jce_home}/#{jdk_version}/*.jar - EOF - cwd node['java']['download_path'] - creates ::File.join(jce_home, jdk_version, 'US_export_policy.jar') + + archive_file 'extract jce' do + path r.path + destination ::File.join(download_path, 'java_jce') + overwrite true + not_if { ::File.exist?(::File.join(jce_home, jdk_version, 'US_export_policy.jar')) } + end + + ruby_block 'stage jce policy jars' do + block do + ::Dir.glob(::File.join(download_path, 'java_jce', '**', '*.jar')).each do |jar| + destination = ::File.join(jce_home, jdk_version, ::File.basename(jar)) + ::FileUtils.mv(jar, destination) + ::FileUtils.chmod(0o644, destination) + end + end + not_if { ::File.exist?(::File.join(jce_home, jdk_version, 'US_export_policy.jar')) } end %w(local_policy.jar US_export_policy.jar).each do |jar| @@ -110,3 +133,32 @@ end end end + +action :remove do + jdk_version = new_resource.jdk_version + java_home = new_resource.java_home + jce_home = new_resource.jce_home + download_path = new_resource.download_path + jre_path = new_resource.install_type == 'jdk' ? 'jre' : '' + + %w(local_policy.jar US_export_policy.jar).each do |jar| + file ::File.join(java_home, jre_path, 'lib', 'security', jar) do + action :delete + only_if { ::File.symlink?(path) } + end + end + + directory ::File.join(jce_home, jdk_version) do + recursive true + action :delete + end + + directory ::File.join(download_path, 'java_jce') do + recursive true + action :delete + end + + file ::File.join(download_path, 'jce.zip') do + action :delete + end +end diff --git a/resources/openjdk_install.rb b/resources/openjdk_install.rb index dc9f3810..e5c9ce9e 100644 --- a/resources/openjdk_install.rb +++ b/resources/openjdk_install.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + provides :openjdk_install unified_mode true include Java::Cookbook::OpenJdkHelpers @@ -5,7 +7,6 @@ property :install_type, String, - default: lazy { default_openjdk_install_method(version) }, equal_to: %w( package source ), description: 'Installation type' @@ -23,7 +24,6 @@ property :bin_cmds, Array, - default: lazy { default_bin_cmds(version) }, description: 'A list of bin_cmds based on the version and variant' property :url, @@ -40,18 +40,21 @@ use 'partial/_openjdk' action :install do - if new_resource.install_type == 'package' + install_type = new_resource.install_type || default_openjdk_install_method(new_resource.version) + bin_cmds = new_resource.bin_cmds || default_bin_cmds(new_resource.version) + + if install_type == 'package' openjdk_pkg_install new_resource.version do pkg_names new_resource.pkg_names pkg_version new_resource.pkg_version java_home new_resource.java_home default new_resource.default - bin_cmds new_resource.bin_cmds + bin_cmds bin_cmds skip_alternatives new_resource.skip_alternatives alternatives_priority new_resource.alternatives_priority reset_alternatives new_resource.reset_alternatives end - elsif new_resource.install_type == 'source' + elsif install_type == 'source' openjdk_source_install new_resource.version do url new_resource.url checksum new_resource.checksum @@ -59,7 +62,7 @@ java_home_mode new_resource.java_home_mode java_home_group new_resource.java_home_group default new_resource.default - bin_cmds new_resource.bin_cmds + bin_cmds bin_cmds skip_alternatives new_resource.skip_alternatives alternatives_priority new_resource.alternatives_priority reset_alternatives new_resource.reset_alternatives @@ -70,19 +73,22 @@ end action :remove do - if new_resource.install_type == 'package' + install_type = new_resource.install_type || default_openjdk_install_method(new_resource.version) + bin_cmds = new_resource.bin_cmds || default_bin_cmds(new_resource.version) + + if install_type == 'package' openjdk_pkg_install new_resource.version do pkg_names new_resource.pkg_names pkg_version new_resource.pkg_version java_home new_resource.java_home default new_resource.default - bin_cmds new_resource.bin_cmds + bin_cmds bin_cmds skip_alternatives new_resource.skip_alternatives alternatives_priority new_resource.alternatives_priority reset_alternatives new_resource.reset_alternatives action :remove end - elsif new_resource.install_type == 'source' + elsif install_type == 'source' openjdk_source_install new_resource.version do url new_resource.url checksum new_resource.checksum @@ -90,7 +96,7 @@ java_home_mode new_resource.java_home_mode java_home_group new_resource.java_home_group default new_resource.default - bin_cmds new_resource.bin_cmds + bin_cmds bin_cmds skip_alternatives new_resource.skip_alternatives alternatives_priority new_resource.alternatives_priority reset_alternatives new_resource.reset_alternatives diff --git a/resources/openjdk_pkg_install.rb b/resources/openjdk_pkg_install.rb index 86449b0b..783df2b8 100644 --- a/resources/openjdk_pkg_install.rb +++ b/resources/openjdk_pkg_install.rb @@ -1,21 +1,24 @@ +# frozen_string_literal: true + provides :openjdk_pkg_install unified_mode true include Java::Cookbook::OpenJdkHelpers include Java::Cookbook::BinCmdHelpers +use 'partial/_common' +use 'partial/_linux' +use 'partial/_openjdk' + property :pkg_names, [String, Array], - default: lazy { default_openjdk_pkg_names(version) }, description: 'List of packages to install' property :pkg_version, String, description: 'Package version to install' property :java_home, String, - default: lazy { default_openjdk_pkg_java_home(version) }, description: 'Set to override the java_home' property :bin_cmds, Array, - default: lazy { default_bin_cmds(version) }, description: 'A list of bin_cmds based on the version and variant' property :alternatives_priority, Integer, @@ -25,11 +28,11 @@ property :repository_uri, String, description: 'URI for the repository mirror (e.g., "https://custom-mirror.example.com/openjdk/ubuntu")' -use 'partial/_common' -use 'partial/_linux' -use 'partial/_openjdk' - action :install do + pkg_names = new_resource.pkg_names || default_openjdk_pkg_names(new_resource.version) + java_home = new_resource.java_home || default_openjdk_pkg_java_home(new_resource.version) + bin_cmds = new_resource.bin_cmds || default_bin_cmds(new_resource.version) + if platform?('ubuntu') apt_repository 'openjdk-r-ppa' do uri new_resource.repository_uri || 'ppa:openjdk-r' @@ -37,21 +40,19 @@ end pkg_version = - if new_resource.pkg_version && new_resource.pkg_names.is_a?(String) - version new_resource.pkg_version - elsif new_resource.pkg_version && new_resource.pkg_names.is_a?(Array) - Array.new(new_resource.pkg_names.size, new_resource.pkg_version) + if new_resource.pkg_version && pkg_names.is_a?(String) + new_resource.pkg_version + elsif new_resource.pkg_version && pkg_names.is_a?(Array) + Array.new(pkg_names.size, new_resource.pkg_version) end - package new_resource.pkg_names do + package pkg_names do version pkg_version if pkg_version end - node.default['java']['java_home'] = new_resource.java_home - java_alternatives 'set-java-alternatives' do - java_location new_resource.java_home - bin_cmds new_resource.bin_cmds + java_location java_home + bin_cmds bin_cmds priority new_resource.alternatives_priority default new_resource.default reset_alternatives new_resource.reset_alternatives @@ -60,15 +61,19 @@ end action :remove do + pkg_names = new_resource.pkg_names || default_openjdk_pkg_names(new_resource.version) + java_home = new_resource.java_home || default_openjdk_pkg_java_home(new_resource.version) + bin_cmds = new_resource.bin_cmds || default_bin_cmds(new_resource.version) + java_alternatives 'unset-java-alternatives' do - java_location new_resource.java_home - bin_cmds new_resource.bin_cmds - only_if { ::File.exist?(new_resource.java_home) } + java_location java_home + bin_cmds bin_cmds + only_if { ::File.exist?(java_home) } not_if { new_resource.skip_alternatives } action :unset end - package new_resource.pkg_names do + package pkg_names do action :remove end diff --git a/resources/openjdk_source_install.rb b/resources/openjdk_source_install.rb index 5eef5e0a..dae97036 100644 --- a/resources/openjdk_source_install.rb +++ b/resources/openjdk_source_install.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + provides :openjdk_source_install unified_mode true include Java::Cookbook::OpenJdkHelpers @@ -8,20 +10,16 @@ description: 'Java version to install' property :url, String, - default: lazy { default_openjdk_url(version, variant) }, description: 'The URL to download from. Can be an internal mirror URL (e.g., "https://internal-mirror.example.com/java/openjdk/").' property :checksum, String, regex: /^[0-9a-f]{32}$|^[a-zA-Z0-9]{40,64}$/, - default: lazy { default_openjdk_checksum(version) }, description: 'The checksum for the downloaded file' property :java_home, String, - default: lazy { "/usr/lib/jvm/java-#{version}-openjdk/jdk-#{version}" }, description: 'Set to override the java_home' property :bin_cmds, Array, - default: lazy { default_bin_cmds(version) }, description: 'A list of bin_cmds based on the version and variant' use 'partial/_common' @@ -30,9 +28,13 @@ use 'partial/_openjdk' action :install do - extract_dir = new_resource.java_home.split('/')[0..-2].join('/') - parent_dir = new_resource.java_home.split('/')[0..-3].join('/') - tarball_name = new_resource.url.split('/').last + url = new_resource.url || default_openjdk_url(new_resource.version, new_resource.variant) + checksum = new_resource.checksum || default_openjdk_checksum(new_resource.version) + java_home = new_resource.java_home || "/usr/lib/jvm/java-#{new_resource.version}-openjdk/jdk-#{new_resource.version}" + bin_cmds = new_resource.bin_cmds || default_bin_cmds(new_resource.version) + extract_dir = java_home.split('/')[0..-2].join('/') + parent_dir = java_home.split('/')[0..-3].join('/') + tarball_name = url.split('/').last directory parent_dir do owner new_resource.java_home_owner @@ -42,8 +44,8 @@ end remote_file "#{Chef::Config[:file_cache_path]}/#{tarball_name}" do - source new_resource.url - checksum new_resource.checksum + source url + checksum checksum retries new_resource.retries retry_delay new_resource.retry_delay mode '644' @@ -53,11 +55,9 @@ destination extract_dir end - node.default['java']['java_home'] = new_resource.java_home - java_alternatives 'set-java-alternatives' do - java_location new_resource.java_home - bin_cmds new_resource.bin_cmds + java_location java_home + bin_cmds bin_cmds priority new_resource.alternatives_priority default new_resource.default reset_alternatives new_resource.reset_alternatives @@ -65,18 +65,22 @@ action :set end - append_if_no_line 'Java Home' do - path '/etc/profile.d/java.sh' - line "export JAVA_HOME=#{new_resource.java_home}" + file '/etc/profile.d/java.sh' do + content "export JAVA_HOME=#{java_home}\n" + owner 'root' + group 'root' + mode '0644' end end action :remove do - extract_dir = new_resource.java_home.split('/')[0..-2].join('/') + java_home = new_resource.java_home || "/usr/lib/jvm/java-#{new_resource.version}-openjdk/jdk-#{new_resource.version}" + bin_cmds = new_resource.bin_cmds || default_bin_cmds(new_resource.version) + extract_dir = java_home.split('/')[0..-2].join('/') java_alternatives 'unset-java-alternatives' do - java_location new_resource.java_home - bin_cmds new_resource.bin_cmds + java_location java_home + bin_cmds bin_cmds only_if { ::File.exist?(extract_dir) } not_if { new_resource.skip_alternatives } action :unset @@ -88,4 +92,8 @@ only_if { ::File.exist?(extract_dir) } action :delete end + + file '/etc/profile.d/java.sh' do + action :delete + end end diff --git a/resources/partial/_common.rb b/resources/partial/_common.rb index 49c93c39..c95d9b88 100644 --- a/resources/partial/_common.rb +++ b/resources/partial/_common.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + property :version, String, name_property: true, description: 'Java version to install' diff --git a/resources/partial/_java_home.rb b/resources/partial/_java_home.rb index 8abdfc15..a99ae72a 100644 --- a/resources/partial/_java_home.rb +++ b/resources/partial/_java_home.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + property :java_home_mode, String, default: '0755', description: 'The permission for the Java home directory' diff --git a/resources/partial/_linux.rb b/resources/partial/_linux.rb index 3fcad6c0..d18532d3 100644 --- a/resources/partial/_linux.rb +++ b/resources/partial/_linux.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + property :alternatives_priority, Integer, default: 1, description: 'Alternatives priority to set for this Java' diff --git a/resources/partial/_macos.rb b/resources/partial/_macos.rb index 2e872fc3..0c2402fd 100644 --- a/resources/partial/_macos.rb +++ b/resources/partial/_macos.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + property :tap_url, String, description: 'The URL of the tap' diff --git a/resources/partial/_openjdk.rb b/resources/partial/_openjdk.rb index d51c680b..ec7a0721 100644 --- a/resources/partial/_openjdk.rb +++ b/resources/partial/_openjdk.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + property :variant, String, equal_to: %w(openjdk temurin), default: 'openjdk', diff --git a/resources/temurin_package_install.rb b/resources/temurin_package_install.rb index 0a7b5b43..b7308da3 100644 --- a/resources/temurin_package_install.rb +++ b/resources/temurin_package_install.rb @@ -1,63 +1,68 @@ +# frozen_string_literal: true + provides :temurin_package_install unified_mode true include Java::Cookbook::OpenJdkHelpers -include Java::Cookbook::TemurinHelpers include Java::Cookbook::BinCmdHelpers +use 'partial/_common' +use 'partial/_linux' + def default_temurin_pkg_name(version) - # Validate version against available releases - unless temurin_version_available?(version) - Chef::Log.warn("Temurin version #{version} might not be available. Available LTS versions: #{temurin_lts_versions.join(', ')}") - end "temurin-#{version}-jdk" end +def default_temurin_rpm_baseurl + return 'https://packages.adoptium.net/artifactory/rpm/amazonlinux/2/$basearch' if platform?('amazon') + + repository_platform = value_for_platform( + %w(almalinux oracle redhat rocky) => { 'default' => 'rhel' }, + 'centos' => { 'default' => 'centos' }, + 'fedora' => { 'default' => 'fedora' }, + 'default' => node['platform'] + ) + + "https://packages.adoptium.net/artifactory/rpm/#{repository_platform}/$releasever/$basearch" +end + property :pkg_name, String, - default: lazy { default_temurin_pkg_name(version) }, description: 'Package name to install' property :pkg_version, String, description: 'Package version to install' property :java_home, String, - default: lazy { "/usr/lib/jvm/temurin-#{version}-jdk" }, description: 'Set to override the java_home' property :bin_cmds, Array, - default: lazy { default_bin_cmds(version) }, description: 'A list of bin_cmds based on the version' property :repository_uri, String, description: 'URI for the repository mirror (e.g., "https://custom-mirror.example.com/artifactory/deb")' -use 'partial/_common' -use 'partial/_linux' - action :install do + keyring_path = '/usr/share/keyrings/adoptium.asc' + pkg_name = new_resource.pkg_name || default_temurin_pkg_name(new_resource.version) + java_home = new_resource.java_home || "/usr/lib/jvm/temurin-#{new_resource.version}-jdk" + bin_cmds = new_resource.bin_cmds || default_bin_cmds(new_resource.version) + + remote_file keyring_path do + source 'https://packages.adoptium.net/artifactory/api/gpg/key/public' + mode '0644' + only_if { platform_family?('debian') } + end + apt_repository 'adoptium' do uri new_resource.repository_uri || 'https://packages.adoptium.net/artifactory/deb' components ['main'] distribution lazy { node['lsb']['codename'] || node['debian']['distribution_codename'] } - # TODO: https://github.com/chef/chef/pull/15043 - # key '843C48A565F8F04B' - # keyserver 'keyserver.ubuntu.com' - signed_by false - trusted true + signed_by keyring_path only_if { platform_family?('debian') } end yum_repository 'adoptium' do description 'Eclipse Adoptium' - baseurl new_resource.repository_uri || value_for_platform( - 'amazon' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/amazonlinux/2/$basearch' }, - 'centos' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/centos/$releasever/$basearch' }, - 'fedora' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/fedora/$releasever/$basearch' }, - 'opensuse' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/opensuse/$releasever/$basearch' }, - 'oracle' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/oraclelinux/$releasever/$basearch' }, - 'redhat' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/rhel/$releasever/$basearch' }, - 'rocky' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/rocky/8/$basearch' }, - 'suse' => { 'default' => 'https://packages.adoptium.net/artifactory/rpm/sles/$releasever/$basearch' } - ) + baseurl new_resource.repository_uri || default_temurin_rpm_baseurl enabled true gpgcheck true gpgkey 'https://packages.adoptium.net/artifactory/api/gpg/key/public' @@ -73,15 +78,13 @@ def default_temurin_pkg_name(version) only_if { platform_family?('suse') } end - package new_resource.pkg_name do + package pkg_name do version new_resource.pkg_version if new_resource.pkg_version end - node.default['java']['java_home'] = new_resource.java_home - java_alternatives 'set-java-alternatives' do - java_location new_resource.java_home - bin_cmds new_resource.bin_cmds + java_location java_home + bin_cmds bin_cmds priority new_resource.alternatives_priority default new_resource.default reset_alternatives new_resource.reset_alternatives @@ -90,15 +93,19 @@ def default_temurin_pkg_name(version) end action :remove do + pkg_name = new_resource.pkg_name || default_temurin_pkg_name(new_resource.version) + java_home = new_resource.java_home || "/usr/lib/jvm/temurin-#{new_resource.version}-jdk" + bin_cmds = new_resource.bin_cmds || default_bin_cmds(new_resource.version) + java_alternatives 'unset-java-alternatives' do - java_location new_resource.java_home - bin_cmds new_resource.bin_cmds - only_if { ::File.exist?(new_resource.java_home) } + java_location java_home + bin_cmds bin_cmds + only_if { ::File.exist?(java_home) } action :unset not_if { new_resource.skip_alternatives } end - package new_resource.pkg_name do + package pkg_name do action :remove end @@ -107,6 +114,11 @@ def default_temurin_pkg_name(version) only_if { platform_family?('debian') } end + file '/usr/share/keyrings/adoptium.asc' do + action :delete + only_if { platform_family?('debian') } + end + yum_repository 'adoptium' do action :remove only_if { platform_family?('rhel', 'fedora', 'amazon', 'rocky', 'suse', 'oraclelinux') } diff --git a/spec/libraries/bin_cmd_helpers_spec.rb b/spec/libraries/bin_cmd_helpers_spec.rb new file mode 100644 index 00000000..2217ca20 --- /dev/null +++ b/spec/libraries/bin_cmd_helpers_spec.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Java::Cookbook::BinCmdHelpers do + subject(:helper) do + Class.new do + include Java::Cookbook::BinCmdHelpers + end.new + end + + describe '#default_bin_cmds' do + it 'returns Java command alternatives for Temurin 25' do + expect(helper.default_bin_cmds('25')).to include('java', 'javac', 'keytool', 'jwebserver') + end + + it 'logs a fatal error for unsupported versions' do + allow(Chef::Log).to receive(:fatal) + + helper.default_bin_cmds('26') + + expect(Chef::Log).to have_received(:fatal).with('Version specified does not have a default set of bin_cmds') + end + end +end diff --git a/spec/libraries/certificate_helpers_spec.rb b/spec/libraries/certificate_helpers_spec.rb index 59fd240f..0f60f40b 100644 --- a/spec/libraries/certificate_helpers_spec.rb +++ b/spec/libraries/certificate_helpers_spec.rb @@ -24,7 +24,7 @@ class DummyClass < Chef::Node let(:truststore_path) { '/usr/lib/jvm/corretto-9/jre/lib/security/cacerts' } it 'returns the correct argument' do - expect(subject.keystore_argument(cacerts, truststore_path)).to eq('-cacerts') + expect(subject.keystore_argument(cacerts, truststore_path)).to eq(['-cacerts']) end end @@ -33,7 +33,7 @@ class DummyClass < Chef::Node let(:truststore_path) { '/mycertstore.jks' } it 'returns the correct argument' do - expect(subject.keystore_argument(cacerts, truststore_path)).to eq('-keystore /mycertstore.jks') + expect(subject.keystore_argument(cacerts, truststore_path)).to eq(['-keystore', '/mycertstore.jks']) end end end diff --git a/spec/libraries/openjdk_helpers_spec.rb b/spec/libraries/openjdk_helpers_spec.rb index e541ffdf..b9950f9b 100644 --- a/spec/libraries/openjdk_helpers_spec.rb +++ b/spec/libraries/openjdk_helpers_spec.rb @@ -54,11 +54,13 @@ class DummyClass < Chef::Node before do allow(subject).to receive(:[]).with(version).and_return(version) allow(subject).to receive(:[]).with('platform_family').and_return(platform_family) + allow(subject).to receive(:[]).with('platform').and_return(platform) allow(subject).to receive(:[]).with('platform_version').and_return(platform_version) end context 'Amazon' do let(:platform_family) { 'amazon' } + let(:platform) { 'amazon' } let(:platform_version) { '2' } let(:version) { '17' } it 'should default to a source install' do @@ -66,8 +68,75 @@ class DummyClass < Chef::Node end end + context 'RHEL 9' do + let(:platform_family) { 'rhel' } + let(:platform) { 'almalinux' } + let(:platform_version) { '9.6' } + + context 'OpenJDK 11' do + let(:version) { '11' } + + it 'should default to a package install' do + expect(subject.default_openjdk_install_method(version)).to eq 'package' + end + end + + context 'OpenJDK 17' do + let(:version) { '17' } + + it 'should default to a package install' do + expect(subject.default_openjdk_install_method(version)).to eq 'package' + end + end + end + + context 'RHEL 10' do + let(:platform_family) { 'rhel' } + let(:platform) { 'almalinux' } + let(:platform_version) { '10.2' } + + context 'OpenJDK 11' do + let(:version) { '11' } + + it 'should default to a source install' do + expect(subject.default_openjdk_install_method(version)).to eq 'source' + end + end + + context 'OpenJDK 17' do + let(:version) { '17' } + + it 'should default to a source install' do + expect(subject.default_openjdk_install_method(version)).to eq 'source' + end + end + end + + context 'Fedora' do + let(:platform_family) { 'fedora' } + let(:platform) { 'fedora' } + let(:platform_version) { '44' } + + context 'OpenJDK 11' do + let(:version) { '11' } + + it 'should default to a source install' do + expect(subject.default_openjdk_install_method(version)).to eq 'source' + end + end + + context 'OpenJDK 17' do + let(:version) { '17' } + + it 'should default to a source install' do + expect(subject.default_openjdk_install_method(version)).to eq 'source' + end + end + end + context 'Debian' do let(:platform_family) { 'debian' } + let(:platform) { 'debian' } context '9' do let(:platform_version) { '9' } @@ -137,7 +206,40 @@ class DummyClass < Chef::Node end end + context '12' do + let(:platform_version) { '12' } + + context 'OpenJDK 11' do + let(:version) { '11' } + + it 'should default to a source install' do + expect(subject.default_openjdk_install_method(version)).to eq 'source' + end + end + + context 'OpenJDK 17' do + let(:version) { '17' } + + it 'should default to a package install' do + expect(subject.default_openjdk_install_method(version)).to eq 'package' + end + end + end + + context '13' do + let(:platform_version) { '13' } + + context 'OpenJDK 17' do + let(:version) { '17' } + + it 'should default to a source install' do + expect(subject.default_openjdk_install_method(version)).to eq 'source' + end + end + end + context 'Ubuntu 18.04' do + let(:platform) { 'ubuntu' } let(:platform_version) { '18.04' } context 'OpenJDK 17' do @@ -158,6 +260,7 @@ class DummyClass < Chef::Node end context 'Ubuntu 20.04' do + let(:platform) { 'ubuntu' } let(:platform_version) { '20.04' } context 'OpenJDK 17' do diff --git a/spec/resources/alternatives_spec.rb b/spec/resources/alternatives_spec.rb new file mode 100644 index 00000000..cdc5ad20 --- /dev/null +++ b/spec/resources/alternatives_spec.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'java_alternatives' do + let(:runner) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '24.04', step_into: ['java_alternatives']) } + + it 'converges with an empty command list without shelling out' do + expect { runner.converge('test::alternatives_spec') }.not_to raise_error + end + + it 'supports unsetting command alternatives' do + stubs_for_provider('java_alternatives[test-unset-alternatives]') do |provider| + allow(provider).to receive_shell_out('update-alternatives', '--remove', 'java', '/opt/java/bin/java') + end + + expect { runner.converge('test::alternatives_unset_spec') }.not_to raise_error + end +end diff --git a/spec/resources/certificate_spec.rb b/spec/resources/certificate_spec.rb new file mode 100644 index 00000000..f71fd487 --- /dev/null +++ b/spec/resources/certificate_spec.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'java_certificate' do + let(:shellout) do + instance_double(Mixlib::ShellOut, run_command: nil, stdout: '', exitstatus: 0, format_for_exception: '') + end + + before do + allow(Mixlib::ShellOut).to receive(:new).and_return(shellout) + end + + let(:runner) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '24.04', step_into: ['java_certificate']) } + + it 'steps into certificate install without invoking host keytool' do + expect { runner.converge('test::certificate_spec') }.not_to raise_error + end +end diff --git a/spec/resources/corretto_install_spec.rb b/spec/resources/corretto_install_spec.rb new file mode 100644 index 00000000..c42aaf13 --- /dev/null +++ b/spec/resources/corretto_install_spec.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'corretto_install' do + let(:runner) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '24.04', step_into: ['corretto_install']) } + let(:converge) { runner.converge('test::corretto_spec') } + + it 'downloads the Corretto archive' do + expect(converge).to create_remote_file(::File.join(Chef::Config[:file_cache_path], 'corretto.tar.gz')) + end + + it 'creates a Debian jinfo file' do + expect(converge).to create_template('/usr/lib/jvm/.java-17-corretto.jinfo') + end +end diff --git a/spec/resources/jce_spec.rb b/spec/resources/jce_spec.rb new file mode 100644 index 00000000..1524c614 --- /dev/null +++ b/spec/resources/jce_spec.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'java_jce' do + context 'install' do + let(:runner) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '24.04', step_into: ['java_jce']) } + let(:converge) { runner.converge('test::jce_spec') } + + it 'downloads the JCE archive to the explicit download path' do + expect(converge).to create_remote_file('/tmp/java/jce.zip') + end + + it 'extracts the archive without a shell execute resource' do + expect(converge).to extract_archive_file('extract jce') + expect(converge).to_not run_execute('extract jce') + end + end + + context 'remove' do + let(:runner) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '24.04', step_into: ['java_jce']) } + let(:converge) { runner.converge('test::jce_remove_spec') } + + it 'removes staged JCE artifacts' do + expect(converge).to delete_directory('/usr/lib/jvm/jce/17') + expect(converge).to delete_file('/tmp/java/jce.zip') + end + end +end diff --git a/spec/resources/openjdk_install_spec.rb b/spec/resources/openjdk_install_spec.rb new file mode 100644 index 00000000..6451c4fe --- /dev/null +++ b/spec/resources/openjdk_install_spec.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'openjdk_install' do + context 'package install' do + let(:runner) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '24.04', step_into: ['openjdk_install']) } + + let(:converge) do + runner.converge('test::openjdk_package_spec') + end + + it 'delegates to openjdk_pkg_install' do + expect(converge).to install_openjdk_pkg_install('17').with( + pkg_names: %w(openjdk-17-jdk openjdk-17-jre-headless), + java_home: '/usr/lib/jvm/java-17-openjdk-amd64', + bin_cmds: %w(java javac), + skip_alternatives: true + ) + end + end + + context 'source install' do + let(:runner) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '24.04', step_into: ['openjdk_install']) } + + let(:converge) do + runner.converge('test::openjdk_source_spec') + end + + it 'delegates to openjdk_source_install' do + expect(converge).to install_openjdk_source_install('17').with( + url: 'https://example.test/openjdk.tar.gz', + checksum: 'a' * 64, + java_home: '/usr/lib/jvm/java-17-openjdk/jdk-17', + bin_cmds: %w(java javac), + skip_alternatives: true + ) + end + end +end diff --git a/spec/resources/openjdk_pkg_install_spec.rb b/spec/resources/openjdk_pkg_install_spec.rb new file mode 100644 index 00000000..e1ddb0c8 --- /dev/null +++ b/spec/resources/openjdk_pkg_install_spec.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'openjdk_pkg_install' do + let(:runner) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '24.04', step_into: ['openjdk_pkg_install']) } + + let(:converge) do + runner.converge('test::openjdk_pkg_spec') + end + + it 'installs the requested OpenJDK packages' do + expect(converge).to install_package(%w(openjdk-17-jdk openjdk-17-jre-headless)) + end + + it 'does not write node java_home state' do + expect(converge.node.default_attrs).not_to have_key('java') + expect(converge.node.normal_attrs).not_to have_key('java') + expect(converge.node.override_attrs).not_to have_key('java') + end +end diff --git a/spec/resources/openjdk_source_install_spec.rb b/spec/resources/openjdk_source_install_spec.rb new file mode 100644 index 00000000..ba4e723e --- /dev/null +++ b/spec/resources/openjdk_source_install_spec.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'openjdk_source_install' do + context 'install' do + let(:runner) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '24.04', step_into: ['openjdk_source_install']) } + let(:converge) { runner.converge('test::openjdk_source_direct_spec') } + + it 'downloads the source archive' do + expect(converge).to create_remote_file(::File.join(Chef::Config[:file_cache_path], 'openjdk.tar.gz')) + end + + it 'sets JAVA_HOME in the profile file' do + resource = converge.resource_collection.to_a.find do |candidate| + candidate.resource_name == :file && candidate.name == '/etc/profile.d/java.sh' + end + + expect(resource.content).to eq("export JAVA_HOME=/usr/lib/jvm/java-17-openjdk/jdk-17\n") + expect(resource.mode).to eq('0644') + end + end + + context 'remove' do + let(:runner) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '24.04', step_into: ['openjdk_source_install']) } + let(:converge) { runner.converge('test::openjdk_source_remove_spec') } + + it 'removes the managed JAVA_HOME line' do + resource = converge.resource_collection.to_a.find do |candidate| + candidate.resource_name == :file && candidate.name == '/etc/profile.d/java.sh' + end + + expect(resource.action).to eq([:delete]) + end + end +end diff --git a/spec/resources/temurin_package_install_spec.rb b/spec/resources/temurin_package_install_spec.rb new file mode 100644 index 00000000..4cb660fe --- /dev/null +++ b/spec/resources/temurin_package_install_spec.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'temurin_package_install' do + let(:runner) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '24.04', step_into: ['temurin_package_install']) } + + let(:converge) do + runner.converge('test::temurin_package_spec') + end + + it 'installs the Adoptium apt keyring' do + expect(converge).to create_remote_file('/usr/share/keyrings/adoptium.asc').with( + source: 'https://packages.adoptium.net/artifactory/api/gpg/key/public', + mode: '0644' + ) + end + + it 'configures the apt repository with signed_by instead of trusted mode' do + expect(converge).to add_apt_repository('adoptium').with( + signed_by: '/usr/share/keyrings/adoptium.asc' + ) + end + + it 'installs the Temurin package' do + expect(converge).to install_package('temurin-17-jdk') + end + + context 'on AlmaLinux' do + let(:runner) { ChefSpec::SoloRunner.new(platform: 'almalinux', version: '8', step_into: ['temurin_package_install']) } + + it 'uses the RHEL-compatible Adoptium RPM repository' do + expect(converge).to create_yum_repository('adoptium').with( + baseurl: 'https://packages.adoptium.net/artifactory/rpm/rhel/$releasever/$basearch' + ) + end + end + + context 'on Amazon Linux' do + let(:runner) { ChefSpec::SoloRunner.new(platform: 'amazon', version: '2', step_into: ['temurin_package_install']) } + + it 'uses the Adoptium Amazon Linux 2 RPM repository' do + expect(converge).to create_yum_repository('adoptium').with( + baseurl: 'https://packages.adoptium.net/artifactory/rpm/amazonlinux/2/$basearch' + ) + end + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 317bf1fa..b9669727 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,10 +1,25 @@ require 'chefspec' -require 'chefspec/berkshelf' +require 'chefspec/policyfile' require_relative '../libraries/certificate_helpers' +require_relative '../libraries/bin_cmd_helpers' require_relative '../libraries/corretto_helpers' require_relative '../libraries/openjdk_helpers' +module PolicyfileCookbookPath + def initialize(options = {}) + if Array(options[:cookbook_path]).include?('spec/fixtures/cookbooks') + options = options.merge( + cookbook_path: Array(RSpec.configuration.cookbook_path) + [File.expand_path('fixtures/cookbooks', __dir__)] + ) + end + + super(options) + end +end + +ChefSpec::SoloRunner.prepend(PolicyfileCookbookPath) + RSpec.configure do |config| config.file_cache_path = File.join(Dir.tmpdir, 'chefspec') if config.respond_to?(:file_cache_path) config.color = true diff --git a/templates/jdk.sh.erb b/templates/jdk.sh.erb deleted file mode 100644 index 39486d3c..00000000 --- a/templates/jdk.sh.erb +++ /dev/null @@ -1 +0,0 @@ -export JAVA_HOME=<%= node['java']['java_home']%> diff --git a/test/fixtures/cookbooks/test/recipes/alternatives_spec.rb b/test/fixtures/cookbooks/test/recipes/alternatives_spec.rb new file mode 100644 index 00000000..f4167760 --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/alternatives_spec.rb @@ -0,0 +1,4 @@ +java_alternatives 'test-alternatives' do + java_location '/opt/java' + bin_cmds [] +end diff --git a/test/fixtures/cookbooks/test/recipes/alternatives_unset_spec.rb b/test/fixtures/cookbooks/test/recipes/alternatives_unset_spec.rb new file mode 100644 index 00000000..ef7469a8 --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/alternatives_unset_spec.rb @@ -0,0 +1,5 @@ +java_alternatives 'test-unset-alternatives' do + java_location '/opt/java' + bin_cmds ['java'] + action :unset +end diff --git a/test/fixtures/cookbooks/test/recipes/certificate_spec.rb b/test/fixtures/cookbooks/test/recipes/certificate_spec.rb new file mode 100644 index 00000000..f467a886 --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/certificate_spec.rb @@ -0,0 +1,20 @@ +java_certificate 'java_certificate_test' do + cert_data <<~CERT + -----BEGIN CERTIFICATE----- + MIICjzCCAfigAwIBAgIJAOXrhcX4ZaGtMA0GCSqGSIb3DQEBBQUAMDoxCzAJBgNV + BAYTAlVTMQ0wCwYDVQQIEwRUZXN0MQ0wCwYDVQQKEwRUZXN0MQ0wCwYDVQQDEwR0 + ZXN0MB4XDTE2MTAxMzAxMTkzOVoXDTM2MTAwODAxMTkzOVowOjELMAkGA1UEBhMC + VVMxDTALBgNVBAgTBFRlc3QxDTALBgNVBAoTBFRlc3QxDTALBgNVBAMTBHRlc3Qw + gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALu8/ylmItn9wUOB4qvlONEiFQpJ + DCK5bt/OkjT02Knm+aAEZS1EDTVEiZWkumM884fd2+WgaMREk02Gy6u5CraOTtEz + VjLeHdr7V9CBZpR6l5gmUY5Ujk1coHZImiqRs3STLVlWHJGjzLXMkRx10CIU8SHC + zgTr57kNG/FT+e25AgMBAAGjgZwwgZkwHQYDVR0OBBYEFP3Ox0pHbZ0u6z746Hp0 + Yk1EBTacMGoGA1UdIwRjMGGAFP3Ox0pHbZ0u6z746Hp0Yk1EBTacoT6kPDA6MQsw + CQYDVQQGEwJVUzENMAsGA1UECBMEVGVzdDENMAsGA1UEChMEVGVzdDENMAsGA1UE + AxMEdGVzdIIJAOXrhcX4ZaGtMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD + gYEAG4idDXusAZ9OrzqdWdFQ+rhQYRovZnfSgPSdF7hugWL5i/qGGlsFjZld2Kyj + X0msGzk61iW7C6kv6OfPGaGNzdNtsH8jUvIYP1IrKpf1NKTKetIWiP08ZI1XNF4H + bXmOxdtxzlHW4qukka+HkK0RBrwX35C8HYqePmInI51JnqY= + -----END CERTIFICATE----- + CERT +end diff --git a/test/fixtures/cookbooks/test/recipes/corretto.rb b/test/fixtures/cookbooks/test/recipes/corretto.rb index c79294d6..338e87fe 100644 --- a/test/fixtures/cookbooks/test/recipes/corretto.rb +++ b/test/fixtures/cookbooks/test/recipes/corretto.rb @@ -1,3 +1,12 @@ -corretto_install node['version'] +extend Java::Cookbook::CorrettoHelpers + +version = node['version'].to_s +java_home = "/usr/lib/jvm/java-#{version}-corretto/#{corretto_sub_dir(version)}" + +corretto_install version do + java_home java_home +end + +node.run_state['java_certificate_java_home'] = java_home include_recipe 'test::java_cert' diff --git a/test/fixtures/cookbooks/test/recipes/corretto_spec.rb b/test/fixtures/cookbooks/test/recipes/corretto_spec.rb new file mode 100644 index 00000000..9664c1eb --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/corretto_spec.rb @@ -0,0 +1,7 @@ +declare_resource(:corretto_install, '17') do + url 'https://example.test/corretto.tar.gz' + checksum 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + java_home '/usr/lib/jvm/java-17-corretto/amazon-corretto-17' + bin_cmds %w(java javac) + skip_alternatives true +end diff --git a/test/fixtures/cookbooks/test/recipes/java_cert.rb b/test/fixtures/cookbooks/test/recipes/java_cert.rb index 857d1874..7931ce01 100644 --- a/test/fixtures/cookbooks/test/recipes/java_cert.rb +++ b/test/fixtures/cookbooks/test/recipes/java_cert.rb @@ -1,4 +1,5 @@ version = node['version'].to_s +certificate_java_home = node.run_state['java_certificate_java_home'] cookbook_file '/tmp/java_certificate_test.pem' do source 'java_certificate_test.pem' @@ -7,15 +8,18 @@ java_certificate 'java_certificate_test' do cert_file '/tmp/java_certificate_test.pem' java_version version + java_home certificate_java_home if certificate_java_home end java_certificate 'java_certificate_ssl_endpoint' do ssl_endpoint 'google.com:443' java_version version + java_home certificate_java_home if certificate_java_home end java_certificate 'java_certificate_ssl_endpoint' do java_version version + java_home certificate_java_home if certificate_java_home action :remove end @@ -23,9 +27,11 @@ ssl_endpoint 'smtp.gmail.com:587' starttls 'smtp' java_version version + java_home certificate_java_home if certificate_java_home end java_certificate 'java_certificate_ssl_endpoint_starttls_smtp' do java_version version + java_home certificate_java_home if certificate_java_home action :remove end diff --git a/test/fixtures/cookbooks/test/recipes/jce_remove_spec.rb b/test/fixtures/cookbooks/test/recipes/jce_remove_spec.rb new file mode 100644 index 00000000..7e5d05e6 --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/jce_remove_spec.rb @@ -0,0 +1,9 @@ +declare_resource(:java_jce, '17') do + jce_url 'https://example.test/jce.zip' + jce_checksum 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + java_home '/usr/lib/jvm/java-17-openjdk-amd64' + jce_home '/usr/lib/jvm/jce' + download_path '/tmp/java' + install_type 'jdk' + action :remove +end diff --git a/test/fixtures/cookbooks/test/recipes/jce_spec.rb b/test/fixtures/cookbooks/test/recipes/jce_spec.rb new file mode 100644 index 00000000..51ac7427 --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/jce_spec.rb @@ -0,0 +1,8 @@ +declare_resource(:java_jce, '17') do + jce_url 'https://example.test/jce.zip' + jce_checksum 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + java_home '/usr/lib/jvm/java-17-openjdk-amd64' + jce_home '/usr/lib/jvm/jce' + download_path '/tmp/java' + install_type 'jdk' +end diff --git a/test/fixtures/cookbooks/test/recipes/openjdk_package_spec.rb b/test/fixtures/cookbooks/test/recipes/openjdk_package_spec.rb new file mode 100644 index 00000000..4f413866 --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/openjdk_package_spec.rb @@ -0,0 +1,7 @@ +declare_resource(:openjdk_install, '17') do + install_type 'package' + pkg_names %w(openjdk-17-jdk openjdk-17-jre-headless) + java_home '/usr/lib/jvm/java-17-openjdk-amd64' + bin_cmds %w(java javac) + skip_alternatives true +end diff --git a/test/fixtures/cookbooks/test/recipes/openjdk_pkg_spec.rb b/test/fixtures/cookbooks/test/recipes/openjdk_pkg_spec.rb new file mode 100644 index 00000000..5bb3e045 --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/openjdk_pkg_spec.rb @@ -0,0 +1,6 @@ +declare_resource(:openjdk_pkg_install, '17') do + pkg_names %w(openjdk-17-jdk openjdk-17-jre-headless) + java_home '/usr/lib/jvm/java-17-openjdk-amd64' + bin_cmds %w(java javac) + skip_alternatives true +end diff --git a/test/fixtures/cookbooks/test/recipes/openjdk_source_direct_spec.rb b/test/fixtures/cookbooks/test/recipes/openjdk_source_direct_spec.rb new file mode 100644 index 00000000..9a2207bb --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/openjdk_source_direct_spec.rb @@ -0,0 +1,7 @@ +declare_resource(:openjdk_source_install, '17') do + url 'https://example.test/openjdk.tar.gz' + checksum 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + java_home '/usr/lib/jvm/java-17-openjdk/jdk-17' + bin_cmds %w(java javac) + skip_alternatives true +end diff --git a/test/fixtures/cookbooks/test/recipes/openjdk_source_remove_spec.rb b/test/fixtures/cookbooks/test/recipes/openjdk_source_remove_spec.rb new file mode 100644 index 00000000..c822322c --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/openjdk_source_remove_spec.rb @@ -0,0 +1,8 @@ +declare_resource(:openjdk_source_install, '17') do + url 'https://example.test/openjdk.tar.gz' + checksum 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + java_home '/usr/lib/jvm/java-17-openjdk/jdk-17' + bin_cmds %w(java javac) + skip_alternatives true + action :remove +end diff --git a/test/fixtures/cookbooks/test/recipes/openjdk_source_spec.rb b/test/fixtures/cookbooks/test/recipes/openjdk_source_spec.rb new file mode 100644 index 00000000..b4a6227a --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/openjdk_source_spec.rb @@ -0,0 +1,8 @@ +declare_resource(:openjdk_install, '17') do + install_type 'source' + url 'https://example.test/openjdk.tar.gz' + checksum 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + java_home '/usr/lib/jvm/java-17-openjdk/jdk-17' + bin_cmds %w(java javac) + skip_alternatives true +end diff --git a/test/fixtures/cookbooks/test/recipes/temurin_package_spec.rb b/test/fixtures/cookbooks/test/recipes/temurin_package_spec.rb new file mode 100644 index 00000000..bc3b4eec --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/temurin_package_spec.rb @@ -0,0 +1,4 @@ +declare_resource(:temurin_package_install, '17') do + bin_cmds %w(java javac) + skip_alternatives true +end diff --git a/test/integration/custom-package/controls/verify_home.rb b/test/integration/custom-package/controls/verify_home.rb index bad2ff4d..9b63691d 100644 --- a/test/integration/custom-package/controls/verify_home.rb +++ b/test/integration/custom-package/controls/verify_home.rb @@ -11,7 +11,7 @@ desc 'Verify the correct version of java is installed' describe command('java -version 2>&1') do - its('stdout') { should match /AdoptOpenJDK/ } unless java_version.to_i == 1 + its('stdout') { should match(/OpenJDK|Temurin|Corretto/) } unless java_version.to_i == 1 its('stdout') { should match Regexp.new(java_version.to_s) } end end diff --git a/test/integration/openjdk/controls/verify_openjdk.rb b/test/integration/openjdk/controls/verify_openjdk.rb index 64e62479..cd5a75f0 100644 --- a/test/integration/openjdk/controls/verify_openjdk.rb +++ b/test/integration/openjdk/controls/verify_openjdk.rb @@ -14,20 +14,19 @@ title 'Path Verification' desc 'Verifies that keytool and other binaries are accessible in the correct paths using update-alternatives' - # Get architecture suffix - arch_suffix = command('uname -m').stdout.strip == 'x86_64' ? 'amd64' : 'arm64' - describe command('update-alternatives --display jar') do its('stdout') { should match %r{/usr/lib/jvm/java} } end + expected_java_home = %r{/usr/lib/jvm/java-#{java_version}[^\s]*/} + describe command('update-alternatives --display java') do - its('stdout') { should match %r{/usr/lib/jvm/java-#{java_version}-openjdk-#{arch_suffix}/bin/java} } + its('stdout') { should match %r{#{expected_java_home}bin/java} } end describe command('update-alternatives --display keytool') do - its('stdout') { should match %r{link best version is /usr/lib/jvm/java-#{java_version}-openjdk-#{arch_suffix}/bin/keytool} } - its('stdout') { should match %r{link keytool is /usr/bin/keytool} } + its('stdout') { should match %r{#{expected_java_home}bin/keytool} } + its('stdout') { should match %r{link (keytool )?(is )?/usr/bin/keytool|keytool - status} } its('stdout') { should match /priority 1/ } end end From 6045c5b44a4152586bbc3e6c6d38eff0c2712faf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 10:26:50 +0100 Subject: [PATCH 184/188] Update Actions to v7 (#759) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4d4ec9d..256d7fec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,7 @@ jobs: fail-fast: false steps: - name: Check out code - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Install Chef uses: sous-chefs/.github/.github/actions/install-workstation@8.0.4 - name: Dokken From e6b00140ecc5f1e83a65d2f7a9173dd33f105431 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Mon, 22 Jun 2026 10:50:46 +0100 Subject: [PATCH 185/188] fix: add release-please manifest (#760) * fix: repair workflow actionlint failures * chore: modernize Java cookbook Replace Berkshelf with Policyfile wiring, tighten CI and Kitchen matrices, and update resource implementations for safer shell usage, explicit provides names, cleanup actions, and stronger ChefSpec coverage. * fix: add release-please manifest --- .release-please-manifest.json | 3 +++ release-please-config.json | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..b2abfd3a --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "14.0.1" +} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..36027f41 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,12 @@ +{ + "packages": { + ".": { + "package-name": "java", + "changelog-path": "CHANGELOG.md", + "release-type": "ruby", + "include-component-in-tag": false, + "version-file": "metadata.rb" + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +} From 97433eab0686fb9b06b9b57fca75e37cd116fbc3 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Mon, 22 Jun 2026 14:25:48 +0100 Subject: [PATCH 186/188] fix!: support source archive upgrades (#762) Add version-aware source archive installs with source_install_dir support, pass java_home_owner through openjdk_install, and make Debian alternatives detection idempotent. Closes #745 Closes #708 Closes #649 --- documentation/resources/openjdk_install.md | 15 +++++ .../resources/openjdk_source_install.md | 26 ++++++++ metadata.rb | 2 +- resources/alternatives.rb | 14 +++- resources/openjdk_install.rb | 8 +++ resources/openjdk_source_install.rb | 51 +++++++++++---- spec/resources/alternatives_spec.rb | 26 ++++++++ spec/resources/openjdk_install_spec.rb | 2 + spec/resources/openjdk_source_install_spec.rb | 64 +++++++++++++++++++ .../recipes/alternatives_existing_spec.rb | 5 ++ .../recipes/openjdk_source_custom_url_spec.rb | 5 ++ .../openjdk_source_explicit_java_home_spec.rb | 6 ++ .../openjdk_source_install_dir_spec.rb | 6 ++ .../test/recipes/openjdk_source_spec.rb | 2 + 14 files changed, 217 insertions(+), 15 deletions(-) create mode 100644 test/fixtures/cookbooks/test/recipes/alternatives_existing_spec.rb create mode 100644 test/fixtures/cookbooks/test/recipes/openjdk_source_custom_url_spec.rb create mode 100644 test/fixtures/cookbooks/test/recipes/openjdk_source_explicit_java_home_spec.rb create mode 100644 test/fixtures/cookbooks/test/recipes/openjdk_source_install_dir_spec.rb diff --git a/documentation/resources/openjdk_install.md b/documentation/resources/openjdk_install.md index b9185b15..a9ad46d7 100644 --- a/documentation/resources/openjdk_install.md +++ b/documentation/resources/openjdk_install.md @@ -31,6 +31,7 @@ Introduced: v8.0.0 | pkg_names | Array | | List of packages to install | | | pkg_version | String | | Package version to install | | | install_type | String | | Installation type | `package` `source` | +| source_install_dir | String | | Source install directory | | ## Examples @@ -47,3 +48,17 @@ openjdk_install '11' do alternatives_priority 2 end ``` + +To install a source archive from an internal mirror: + +```ruby +openjdk_install '17' do + install_type 'source' + url 'https://artifacts.example.com/java/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz' + checksum 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +end +``` + +For source installs, custom URLs install into a directory derived from the archive name unless +`java_home` or `source_install_dir` is set. Source archives must contain a single top-level +directory because the source installer strips one leading path component during extraction. diff --git a/documentation/resources/openjdk_source_install.md b/documentation/resources/openjdk_source_install.md index 7032ba8d..e8dcb9d8 100644 --- a/documentation/resources/openjdk_source_install.md +++ b/documentation/resources/openjdk_source_install.md @@ -20,6 +20,7 @@ Introduced: v8.0.0 | url | String | `default_openjdk_url(version)` | The URL to download from | | checksum | String | `default_openjdk_checksum(version)` | The checksum for the downloaded file | | java_home | String | Based on the version | Set to override the java_home | +| source_install_dir | String | Based on the archive name | Source install directory | | java_home_mode | Integer, String | `0755` | The permission for the Java home directory | | java_home_owner | String | `root` | Owner of the Java Home | | java_home_group | String | `node['root_group']` | Group for the Java Home | @@ -44,3 +45,28 @@ openjdk_source_install '11' do alternatives_priority 2 end ``` + +To install a custom OpenJDK archive from an internal mirror: + +```ruby +openjdk_source_install '17' do + url 'https://artifacts.example.com/java/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz' + checksum 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +end +``` + +This installs to `/usr/lib/jvm/java-17-openjdk/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9` +and configures alternatives from that Java home. + +To choose a stable install directory for a custom archive: + +```ruby +openjdk_source_install '17' do + url 'https://artifacts.example.com/java/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz' + checksum 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + source_install_dir 'jdk-17.0.9+9' +end +``` + +Source archives must contain a single top-level directory. The resource extracts archives with +one leading path component stripped so the archive contents land directly in `java_home`. diff --git a/metadata.rb b/metadata.rb index 999bf085..55d8fa99 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,7 +5,7 @@ description 'Recipes and resources for installing Java and managing certificates' source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' -chef_version '>= 16.0' +chef_version '>= 17.5' version '14.0.1' supports 'almalinux', '>= 8.0' diff --git a/resources/alternatives.rb b/resources/alternatives.rb index f67e7c44..2def88b3 100644 --- a/resources/alternatives.rb +++ b/resources/alternatives.rb @@ -34,7 +34,7 @@ action :set do bin_cmds_to_setup = parse_java_alternatives set_alternatives(bin_cmds_to_setup) do |cmd, alt_path| - alternative_exists = ::File.exist?("/var/lib/alternatives/#{cmd}") && + alternative_exists = ::File.exist?(alternative_file_path(cmd)) && alternatives_display(cmd).stdout.include?(alt_path) Chef::Log.debug("Alternative for #{cmd} exists with correct path? #{alternative_exists}") alternative_exists @@ -58,6 +58,14 @@ def alternatives_display(cmd) shell_out(alternatives_cmd, '--display', cmd) end + def alternative_file_path(cmd) + if platform_family?('debian') + "/var/lib/dpkg/alternatives/#{cmd}" + else + "/var/lib/alternatives/#{cmd}" + end + end + def parse_java_alternatives bin_cmds_to_setup = [] new_resource.bin_cmds.each do |cmd| @@ -101,12 +109,12 @@ def set_alternatives(bin_cmds) end end - alternative_file_exists = ::File.exist?("/var/lib/alternatives/#{cmd}") + alternative_file_exists = ::File.exist?(alternative_file_path(cmd)) if !our_alternative_exists || !alternative_file_exists converge_by("Add alternative for #{cmd}") do if new_resource.reset_alternatives && alternative_file_exists - ::FileUtils.rm_f("/var/lib/alternatives/#{cmd}") + ::FileUtils.rm_f(alternative_file_path(cmd)) end shell_out!(alternatives_cmd, '--install', bin_path, cmd, alt_path, priority.to_s) end diff --git a/resources/openjdk_install.rb b/resources/openjdk_install.rb index e5c9ce9e..e119b717 100644 --- a/resources/openjdk_install.rb +++ b/resources/openjdk_install.rb @@ -22,6 +22,10 @@ String, description: 'Set to override the java_home' +property :source_install_dir, + String, + description: 'Directory under the versioned parent path where the source archive is installed' + property :bin_cmds, Array, description: 'A list of bin_cmds based on the version and variant' @@ -59,7 +63,9 @@ url new_resource.url checksum new_resource.checksum java_home new_resource.java_home + source_install_dir new_resource.source_install_dir java_home_mode new_resource.java_home_mode + java_home_owner new_resource.java_home_owner java_home_group new_resource.java_home_group default new_resource.default bin_cmds bin_cmds @@ -93,7 +99,9 @@ url new_resource.url checksum new_resource.checksum java_home new_resource.java_home + source_install_dir new_resource.source_install_dir java_home_mode new_resource.java_home_mode + java_home_owner new_resource.java_home_owner java_home_group new_resource.java_home_group default new_resource.default bin_cmds bin_cmds diff --git a/resources/openjdk_source_install.rb b/resources/openjdk_source_install.rb index dae97036..0b07ecb7 100644 --- a/resources/openjdk_source_install.rb +++ b/resources/openjdk_source_install.rb @@ -19,6 +19,9 @@ property :java_home, String, description: 'Set to override the java_home' +property :source_install_dir, String, + description: 'Directory under the versioned parent path where the source archive is installed' + property :bin_cmds, Array, description: 'A list of bin_cmds based on the version and variant' @@ -30,13 +33,11 @@ action :install do url = new_resource.url || default_openjdk_url(new_resource.version, new_resource.variant) checksum = new_resource.checksum || default_openjdk_checksum(new_resource.version) - java_home = new_resource.java_home || "/usr/lib/jvm/java-#{new_resource.version}-openjdk/jdk-#{new_resource.version}" + java_home = resolved_java_home(url) bin_cmds = new_resource.bin_cmds || default_bin_cmds(new_resource.version) - extract_dir = java_home.split('/')[0..-2].join('/') - parent_dir = java_home.split('/')[0..-3].join('/') tarball_name = url.split('/').last - directory parent_dir do + directory java_home do owner new_resource.java_home_owner group new_resource.java_home_group mode new_resource.java_home_mode @@ -52,7 +53,13 @@ end archive_file "#{Chef::Config[:file_cache_path]}/#{tarball_name}" do - destination extract_dir + destination java_home + strip_components 1 + overwrite true + owner new_resource.java_home_owner + group new_resource.java_home_group + mode new_resource.java_home_mode + not_if { ::File.exist?(::File.join(java_home, 'bin', 'java')) } end java_alternatives 'set-java-alternatives' do @@ -74,22 +81,22 @@ end action :remove do - java_home = new_resource.java_home || "/usr/lib/jvm/java-#{new_resource.version}-openjdk/jdk-#{new_resource.version}" + url = new_resource.url || default_openjdk_url(new_resource.version, new_resource.variant) + java_home = resolved_java_home(url) bin_cmds = new_resource.bin_cmds || default_bin_cmds(new_resource.version) - extract_dir = java_home.split('/')[0..-2].join('/') java_alternatives 'unset-java-alternatives' do java_location java_home bin_cmds bin_cmds - only_if { ::File.exist?(extract_dir) } + only_if { ::File.exist?(java_home) } not_if { new_resource.skip_alternatives } action :unset end - directory "Removing #{extract_dir}" do - path extract_dir + directory "Removing #{java_home}" do + path java_home recursive true - only_if { ::File.exist?(extract_dir) } + only_if { ::File.exist?(java_home) } action :delete end @@ -97,3 +104,25 @@ action :delete end end + +action_class do + def resolved_java_home(url) + return new_resource.java_home if new_resource.java_home + + install_dir = + if new_resource.source_install_dir + new_resource.source_install_dir + elsif new_resource.url + source_install_dir_from_url(url) + else + "jdk-#{new_resource.version}" + end + + "/usr/lib/jvm/java-#{new_resource.version}-openjdk/#{install_dir}" + end + + def source_install_dir_from_url(url) + ::File.basename(::URI.parse(url).path) + .sub(/\.(?:tar\.(?:gz|bz2|xz)|tgz|tbz2|zip)\z/i, '') + end +end diff --git a/spec/resources/alternatives_spec.rb b/spec/resources/alternatives_spec.rb index cdc5ad20..3d4953d8 100644 --- a/spec/resources/alternatives_spec.rb +++ b/spec/resources/alternatives_spec.rb @@ -16,4 +16,30 @@ expect { runner.converge('test::alternatives_unset_spec') }.not_to raise_error end + + it 'does not reinstall an existing Debian alternative' do + allow(::File).to receive(:exist?).and_call_original + allow(::File).to receive(:exist?).with('/opt/java/bin/java').and_return(true) + allow(::File).to receive(:exist?).with('/var/lib/dpkg/alternatives/java').and_return(true) + allow(::File).to receive(:exist?).with('/var/lib/alternatives/java').and_return(false) + + stubs_for_provider('java_alternatives[test-existing-alternatives]') do |provider| + display = <<~OUTPUT + java - auto mode + link best version is /opt/java/bin/java + link currently points to /opt/java/bin/java + link java is /usr/bin/java + /opt/java/bin/java - priority 1062 + OUTPUT + + allow(provider).to receive(:shell_out) + .with('update-alternatives', '--display', 'java') + .and_return(instance_double(Mixlib::ShellOut, stdout: display, exitstatus: 0)) + allow(provider).to receive(:shell_out!) do |*args| + raise "unexpected shell_out!: #{args.join(' ')}" + end + end + + expect { runner.converge('test::alternatives_existing_spec') }.not_to raise_error + end end diff --git a/spec/resources/openjdk_install_spec.rb b/spec/resources/openjdk_install_spec.rb index 6451c4fe..8bb387fe 100644 --- a/spec/resources/openjdk_install_spec.rb +++ b/spec/resources/openjdk_install_spec.rb @@ -32,6 +32,8 @@ url: 'https://example.test/openjdk.tar.gz', checksum: 'a' * 64, java_home: '/usr/lib/jvm/java-17-openjdk/jdk-17', + source_install_dir: 'jdk-17.0.9+9', + java_home_owner: 'javauser', bin_cmds: %w(java javac), skip_alternatives: true ) diff --git a/spec/resources/openjdk_source_install_spec.rb b/spec/resources/openjdk_source_install_spec.rb index ba4e723e..efcef1af 100644 --- a/spec/resources/openjdk_source_install_spec.rb +++ b/spec/resources/openjdk_source_install_spec.rb @@ -3,6 +3,8 @@ require 'spec_helper' RSpec.describe 'openjdk_source_install' do + let(:cache_path) { Chef::Config[:file_cache_path] } + context 'install' do let(:runner) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '24.04', step_into: ['openjdk_source_install']) } let(:converge) { runner.converge('test::openjdk_source_direct_spec') } @@ -19,6 +21,68 @@ expect(resource.content).to eq("export JAVA_HOME=/usr/lib/jvm/java-17-openjdk/jdk-17\n") expect(resource.mode).to eq('0644') end + + it 'extracts the archive into the final java_home' do + archive = converge.resource_collection.find(archive_file: ::File.join(cache_path, 'openjdk.tar.gz')) + + expect(archive.destination).to eq('/usr/lib/jvm/java-17-openjdk/jdk-17') + expect(archive.strip_components).to eq(1) + expect(archive.overwrite).to be true + expect(archive.not_if).not_to be_empty + end + end + + context 'custom source URL' do + let(:runner) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '24.04', step_into: ['openjdk_source_install']) } + let(:converge) { runner.converge('test::openjdk_source_custom_url_spec') } + let(:java_home) { '/usr/lib/jvm/java-17-openjdk/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9' } + + it 'derives java_home from the archive file name' do + resource = converge.resource_collection.find(file: '/etc/profile.d/java.sh') + + expect(resource.content).to eq("export JAVA_HOME=#{java_home}\n") + end + + it 'sets alternatives to the derived java_home' do + expect(converge).to set_java_alternatives('set-java-alternatives').with( + java_location: java_home, + bin_cmds: %w(java javac) + ) + end + + it 'extracts the archive into the derived java_home' do + archive = converge.resource_collection.find(archive_file: ::File.join(cache_path, 'OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz')) + + expect(archive.destination).to eq(java_home) + expect(archive.strip_components).to eq(1) + expect(archive.overwrite).to be true + expect(archive.owner).to eq('root') + expect(archive.group).to eq('root') + expect(archive.mode).to eq('0755') + expect(archive.not_if).not_to be_empty + end + end + + context 'custom source URL with explicit java_home' do + let(:runner) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '24.04', step_into: ['openjdk_source_install']) } + let(:converge) { runner.converge('test::openjdk_source_explicit_java_home_spec') } + + it 'uses the explicit java_home' do + resource = converge.resource_collection.find(file: '/etc/profile.d/java.sh') + + expect(resource.content).to eq("export JAVA_HOME=/opt/java/custom-openjdk\n") + end + end + + context 'custom source URL with source_install_dir' do + let(:runner) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '24.04', step_into: ['openjdk_source_install']) } + let(:converge) { runner.converge('test::openjdk_source_install_dir_spec') } + + it 'uses source_install_dir under the versioned parent directory' do + resource = converge.resource_collection.find(file: '/etc/profile.d/java.sh') + + expect(resource.content).to eq("export JAVA_HOME=/usr/lib/jvm/java-17-openjdk/jdk-17.0.9+9\n") + end end context 'remove' do diff --git a/test/fixtures/cookbooks/test/recipes/alternatives_existing_spec.rb b/test/fixtures/cookbooks/test/recipes/alternatives_existing_spec.rb new file mode 100644 index 00000000..b714fd5e --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/alternatives_existing_spec.rb @@ -0,0 +1,5 @@ +java_alternatives 'test-existing-alternatives' do + java_location '/opt/java' + bin_cmds ['java'] + priority 1062 +end diff --git a/test/fixtures/cookbooks/test/recipes/openjdk_source_custom_url_spec.rb b/test/fixtures/cookbooks/test/recipes/openjdk_source_custom_url_spec.rb new file mode 100644 index 00000000..8ac6fcf7 --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/openjdk_source_custom_url_spec.rb @@ -0,0 +1,5 @@ +declare_resource(:openjdk_source_install, '17') do + url 'https://artifacts.example.test/java/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz' + checksum 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + bin_cmds %w(java javac) +end diff --git a/test/fixtures/cookbooks/test/recipes/openjdk_source_explicit_java_home_spec.rb b/test/fixtures/cookbooks/test/recipes/openjdk_source_explicit_java_home_spec.rb new file mode 100644 index 00000000..4fc8a521 --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/openjdk_source_explicit_java_home_spec.rb @@ -0,0 +1,6 @@ +declare_resource(:openjdk_source_install, '17') do + url 'https://artifacts.example.test/java/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz' + checksum 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + java_home '/opt/java/custom-openjdk' + bin_cmds %w(java javac) +end diff --git a/test/fixtures/cookbooks/test/recipes/openjdk_source_install_dir_spec.rb b/test/fixtures/cookbooks/test/recipes/openjdk_source_install_dir_spec.rb new file mode 100644 index 00000000..dab3492d --- /dev/null +++ b/test/fixtures/cookbooks/test/recipes/openjdk_source_install_dir_spec.rb @@ -0,0 +1,6 @@ +declare_resource(:openjdk_source_install, '17') do + url 'https://artifacts.example.test/java/OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz' + checksum 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + source_install_dir 'jdk-17.0.9+9' + bin_cmds %w(java javac) +end diff --git a/test/fixtures/cookbooks/test/recipes/openjdk_source_spec.rb b/test/fixtures/cookbooks/test/recipes/openjdk_source_spec.rb index b4a6227a..80b2f26e 100644 --- a/test/fixtures/cookbooks/test/recipes/openjdk_source_spec.rb +++ b/test/fixtures/cookbooks/test/recipes/openjdk_source_spec.rb @@ -3,6 +3,8 @@ url 'https://example.test/openjdk.tar.gz' checksum 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' java_home '/usr/lib/jvm/java-17-openjdk/jdk-17' + source_install_dir 'jdk-17.0.9+9' + java_home_owner 'javauser' bin_cmds %w(java javac) skip_alternatives true end From ba8dba239d98eebf58a9a39dd31553f3650aca84 Mon Sep 17 00:00:00 2001 From: Sous Chefs Bot <33356041+kitchen-porter@users.noreply.github.com> Date: Mon, 22 Jun 2026 14:43:34 +0100 Subject: [PATCH 187/188] chore(main): release 15.0.0 (#761) * chore(main): release 15.0.0 * fix markdown Signed-off-by: Dan Webb --------- Signed-off-by: Dan Webb Co-authored-by: Dan Webb --- .markdownlint-cli2.yaml | 3 + .release-please-manifest.json | 2 +- CHANGELOG.md | 527 ++++++++++++++++++---------------- metadata.rb | 2 +- 4 files changed, 277 insertions(+), 257 deletions(-) diff --git a/.markdownlint-cli2.yaml b/.markdownlint-cli2.yaml index 0196ac7b..e42be9b1 100644 --- a/.markdownlint-cli2.yaml +++ b/.markdownlint-cli2.yaml @@ -3,5 +3,8 @@ config: line-length: false # MD013 no-duplicate-heading: false # MD024 reference-links-images: false # MD052 + no-multiple-blanks: + maximum: 2 ignores: - .github/copilot-instructions.md + - .windsurf/** diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b2abfd3a..b87683f4 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "14.0.1" + ".": "15.0.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index af7b6d58..2203cc0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,359 +8,376 @@ Standardise files with files in sous-chefs/repo-management Standardise files with files in sous-chefs/repo-management +## [15.0.0](https://github.com/sous-chefs/java/compare/14.0.1...v15.0.0) (2026-06-22) + + +### ⚠ BREAKING CHANGES + +* support source archive upgrades ([#762](https://github.com/sous-chefs/java/issues/762)) +* remove legacy Java node attribute API ([#758](https://github.com/sous-chefs/java/issues/758)) + +### Features + +* remove legacy Java node attribute API ([#758](https://github.com/sous-chefs/java/issues/758)) ([14e673e](https://github.com/sous-chefs/java/commit/14e673eee215a0fb5faca1111399272b04735e4b)) + +### Bug Fixes + +* add release-please manifest ([#760](https://github.com/sous-chefs/java/issues/760)) ([e6b0014](https://github.com/sous-chefs/java/commit/e6b00140ecc5f1e83a65d2f7a9173dd33f105431)) +* support source archive upgrades ([#762](https://github.com/sous-chefs/java/issues/762)) ([97433ea](https://github.com/sous-chefs/java/commit/97433eab0686fb9b06b9b57fca75e37cd116fbc3)), closes [#745](https://github.com/sous-chefs/java/issues/745) [#708](https://github.com/sous-chefs/java/issues/708) [#649](https://github.com/sous-chefs/java/issues/649) + ## 14.0.1 - *2025-09-04* ## 14.0.0 - *2025-07-16* -- Remove Semeru support as there is no clean yum or apt repository for it +* Remove Semeru support as there is no clean yum or apt repository for it ## 13.2.0 - *2025-07-14* -- Add `repository_uri` property to `temurin_package_install` and `openjdk_pkg_install` resources to support installation from alternative/internal mirrors ([#728](https://github.com/sous-chefs/java/issues/728)) -- Clarify documentation for `url` property in `openjdk_source_install` resource to note it can be used for internal mirrors -- Standardise files with files in sous-chefs/repo-management +* Add `repository_uri` property to `temurin_package_install` and `openjdk_pkg_install` resources to support installation from alternative/internal mirrors ([#728](https://github.com/sous-chefs/java/issues/728)) +* Clarify documentation for `url` property in `openjdk_source_install` resource to note it can be used for internal mirrors +* Standardise files with files in sous-chefs/repo-management Update the recommended Ruby VSCode extensions -- Fix missing skip_alternatives property in openjdk_pkg_install +* Fix missing skip_alternatives property in openjdk_pkg_install ## 13.1.0 - *2025-07-14* -- add `skip_alternatives` to resources `corretto_install`, `openjdk_install`, `openjdk_pkg_install`, `openjdk_source_install` for cases when management of alternatives is not desired. (@dschlenk) +* add `skip_alternatives` to resources `corretto_install`, `openjdk_install`, `openjdk_pkg_install`, `openjdk_source_install` for cases when management of alternatives is not desired. (@dschlenk) ## 13.0.0 - *2025-07-13* -- Add new resource `temurin_package_install` -- Add script to check for Java updates -- Update Temurin Java 8 support -- Update Temurin repositories -- Update bin commands for all OpenJDK versions -- Fix Java alternatives to prevent unnecessary removal and re-addition of alternatives -- Move bin_cmds from Java::Cookbook::OpenJdkHelpers to Java::Cookbook::BinCmdHelpers for reuse outside of OpenJDK -- Fix apt_repository failing to install the GPG in the correct location -- Add Temurin 21 to the test matrix -- Remove Semeru from the test matrix +* Add new resource `temurin_package_install` +* Add script to check for Java updates +* Update Temurin Java 8 support +* Update Temurin repositories +* Update bin commands for all OpenJDK versions +* Fix Java alternatives to prevent unnecessary removal and re-addition of alternatives +* Move bin_cmds from Java::Cookbook::OpenJdkHelpers to Java::Cookbook::BinCmdHelpers for reuse outside of OpenJDK +* Fix apt_repository failing to install the GPG in the correct location +* Add Temurin 21 to the test matrix +* Remove Semeru from the test matrix ## 12.1.1 - *2024-12-05* ## 12.1.0 - *2024-12-03* -- Add support for OpenJDK versions 19, 20, 21 and 22 -- Remove commented out `adoptopenjdk_linux_install` resource -- CI: chore(deps): update sous-chefs/.github action to v3.1.0 -- CI: chore(deps): update actionshub/chef-install action to v3 -- Update platforms -- Replace AdoptOpenJDK with Eclipse Temurin and IBM Semeru +* Add support for OpenJDK versions 19, 20, 21 and 22 +* Remove commented out `adoptopenjdk_linux_install` resource +* CI: chore(deps): update sous-chefs/.github action to v3.1.0 +* CI: chore(deps): update actionshub/chef-install action to v3 +* Update platforms +* Replace AdoptOpenJDK with Eclipse Temurin and IBM Semeru ## 12.0.7 - *2024-11-18* -- Standardise files with files in sous-chefs/repo-management +* Standardise files with files in sous-chefs/repo-management ## 12.0.6 - *2024-07-15* -- Standardise files with files in sous-chefs/repo-management +* Standardise files with files in sous-chefs/repo-management ## 12.0.2 - *2024-01-16* -- Fix `openjdk_pkg_install` to obey `pkg_version` property for all `pkg_names` +* Fix `openjdk_pkg_install` to obey `pkg_version` property for all `pkg_names` ## 11.2.0 - *2023-09-12* -- Standardise files with files in sous-chefs/repo-management +* Standardise files with files in sous-chefs/repo-management ## 11.1.0 - *2023-04-17* -- Standardise files with files in sous-chefs/repo-management +* Standardise files with files in sous-chefs/repo-management ## 11.1.0 - *2022-04-26* -- Remove Correto 15 and 16 -- Add Corretto 17 and 18 -- Change the defualt download URL for Corretto to the versioned resources URL, rather than latest. +* Remove Correto 15 and 16 +* Add Corretto 17 and 18 +* Change the defualt download URL for Corretto to the versioned resources URL, rather than latest. ## 11.0.0 - *2022-02-16* -- Require Chef 16 for resource partials -- Add resource partials for: MacOS, Linux, Java Home and Common as these are used in a multiple places +* Require Chef 16 for resource partials +* Add resource partials for: MacOS, Linux, Java Home and Common as these are used in a multiple places ## 10.2.0 - *2022-01-26* -- Remove tap_full option as this is no longer supported and there is no replacement -- Remove delivery and move to calling RSpec directly via a reusable workflow +* Remove tap_full option as this is no longer supported and there is no replacement +* Remove delivery and move to calling RSpec directly via a reusable workflow ## 10.1.0 - *2021-10-06* -- Revert worklfow split out -- Rename InSpec attribute folders to input -- Add Corretto 16 -- Update the Corretto minor version numbers -- Default the Debian install method to package -- Remove testing for end of life OpenJDK suites -- Primarily support OpenJDK LTS versions 11, 17 -- Drop support for OpenJDK package installs for non-LTS versions -- Direct Amazon users to Amazon Corretto instead of installing OpenJDK -- Drop package install support for Java 8 +* Revert worklfow split out +* Rename InSpec attribute folders to input +* Add Corretto 16 +* Update the Corretto minor version numbers +* Default the Debian install method to package +* Remove testing for end of life OpenJDK suites +* Primarily support OpenJDK LTS versions 11, 17 +* Drop support for OpenJDK package installs for non-LTS versions +* Direct Amazon users to Amazon Corretto instead of installing OpenJDK +* Drop package install support for Java 8 ## 10.0.0 - *2021-09-02* -- Remove recipes to stop confusing users +* Remove recipes to stop confusing users ## 9.0.0 - *2021-06-04* -- Remove Corretto checksum code defaults as this changes regularly, and is not provided in the SHA256 format via an API -- Set unified_mode to true for Chef 17 support -- Bump the minimum Chef version to 15.3 for unified_mode support +* Remove Corretto checksum code defaults as this changes regularly, and is not provided in the SHA256 format via an API +* Set unified_mode to true for Chef 17 support +* Bump the minimum Chef version to 15.3 for unified_mode support ## 8.6.0 - *2021-01-22* -- Added Amazon Corretto 15 support to `corretto_install` -- Added configurable `file_cache_path` property to `java_certificate` -- Added `cacerts` property to `java_certificate` for interacting with java cacerts file (Java 9+) +* Added Amazon Corretto 15 support to `corretto_install` +* Added configurable `file_cache_path` property to `java_certificate` +* Added `cacerts` property to `java_certificate` for interacting with java cacerts file (Java 9+) ## 8.5.0 - *2020-12-03* -- If installation issues with `openjdk_install` resource (fixes #645) -- Remove testing of Amazon Linux 1 -- Use fedora-latest +* If installation issues with `openjdk_install` resource (fixes #645) +* Remove testing of Amazon Linux 1 +* Use fedora-latest ## 8.4.0 - *2020-09-09* -- Add `starttls` property to `java_certificate` resource to allow fetching certificates from non HTTPS endpoints +* Add `starttls` property to `java_certificate` resource to allow fetching certificates from non HTTPS endpoints ## 8.3.2 - *2020-08-20* -- Add aarch64 installation candidate for Corretto +* Add aarch64 installation candidate for Corretto ## 8.3.1 - *2020-08-06* -- Extract correct JAVA_HOME from custom URLs +* Extract correct JAVA_HOME from custom URLs ## 8.3.0 - *2020-06-18* -- Restore compatibility with Chef Infra Client < 16 -- Update Fedora releases in the Kitchen configs +* Restore compatibility with Chef Infra Client < 16 +* Update Fedora releases in the Kitchen configs ## 8.2.0 - *2020-06-02* -- resolved cookstyle error: resources/adoptopenjdk_install.rb:1:1 warning: `ChefDeprecations/ResourceUsesOnlyResourceName` -- Remove testing of Ubuntu 14.04, support at this point is no longer guaranteed +* resolved cookstyle error: resources/adoptopenjdk_install.rb:1:1 warning: `ChefDeprecations/ResourceUsesOnlyResourceName` +* Remove testing of Ubuntu 14.04, support at this point is no longer guaranteed ## 8.1.0 - *2020-04-19* -- Added `openjdk_pkg_install` resource -- Added documentation for openjdk_pkg_install -- Added `adoptopenjdk_linux_install` resource -- Added `adoptopenjdk_macos_install` resource -- Added documentation for `adoptopenjdk_linux_install` -- Added documentation for `adoptopenjdk_macos_install` -- Resolved cookstyle error: resources/alternatives.rb:49:13 refactor: `ChefCorrectness/ChefApplicationFatal` -- Resolved cookstyle error: resources/alternatives.rb:62:13 refactor: `ChefCorrectness/ChefApplicationFatal` -- Resolved cookstyle error: resources/alternatives.rb:75:11 refactor: `ChefCorrectness/ChefApplicationFatal` -- Resolved cookstyle error: resources/jce.rb:51:6 refactor: `ChefStyle/UnnecessaryOSCheck` +* Added `openjdk_pkg_install` resource +* Added documentation for openjdk_pkg_install +* Added `adoptopenjdk_linux_install` resource +* Added `adoptopenjdk_macos_install` resource +* Added documentation for `adoptopenjdk_linux_install` +* Added documentation for `adoptopenjdk_macos_install` +* Resolved cookstyle error: resources/alternatives.rb:49:13 refactor: `ChefCorrectness/ChefApplicationFatal` +* Resolved cookstyle error: resources/alternatives.rb:62:13 refactor: `ChefCorrectness/ChefApplicationFatal` +* Resolved cookstyle error: resources/alternatives.rb:75:11 refactor: `ChefCorrectness/ChefApplicationFatal` +* Resolved cookstyle error: resources/jce.rb:51:6 refactor: `ChefStyle/UnnecessaryOSCheck` ## 8.0.0 - *2020-03-30* -- Added `openjdk_install` resource & documentation -- Removed openjdk, corretto, default_java_symlink, ibm & ibm_tar, notify & oracle recipes -- Removed support for IBM and Oracle Java -- Temporarily removed support for Windows -- Split out helpers for each provider into their own namespace and file +* Added `openjdk_install` resource & documentation +* Removed openjdk, corretto, default_java_symlink, ibm & ibm_tar, notify & oracle recipes +* Removed support for IBM and Oracle Java +* Temporarily removed support for Windows +* Split out helpers for each provider into their own namespace and file ## 7.0.0 - *2020-03-05* -- Refactored and sped up unit tests. -- Added `adoptopenjdk_install` resource & documentation -- Added AdoptOpenJDK 13 testing -- Removed the adoptopenjdk recipe, please use the `adoptopenjdk_install` resource instead. -- Increased the minimum Chef requirement to Chef 15 to use the archive resource. -- Removed AdoptOpenJDK 10 testing +* Refactored and sped up unit tests. +* Added `adoptopenjdk_install` resource & documentation +* Added AdoptOpenJDK 13 testing +* Removed the adoptopenjdk recipe, please use the `adoptopenjdk_install` resource instead. +* Increased the minimum Chef requirement to Chef 15 to use the archive resource. +* Removed AdoptOpenJDK 10 testing ## 6.0.0 - *2020-03-02* -- The resource alias `java_ark` has been deprecated in favour of `java_oracle_install` +* The resource alias `java_ark` has been deprecated in favour of `java_oracle_install` ## 5.0.0 - *2020-02-21* -- Fixed java_certificate regex where it checks if cert exists in cacert file. -- Make Homebrew Cask name an attribute to allow for other options (ex: adoptopenjdk) -- Switch homebrew tap to homebrew/cask-versions -- Make builds parallel -- Updates package name and link changes for adoptopenjdk -- Migrated testing to github actions -- Removes openjdk-6 -- Removes openjdk-7 for Ubuntu 16.04 -- Removes openjdk-11 for Ubuntu -- Removes openjdk-direct for Debian 8 -- Removes oracle variants from test configurations +* Fixed java_certificate regex where it checks if cert exists in cacert file. +* Make Homebrew Cask name an attribute to allow for other options (ex: adoptopenjdk) +* Switch homebrew tap to homebrew/cask-versions +* Make builds parallel +* Updates package name and link changes for adoptopenjdk +* Migrated testing to github actions +* Removes openjdk-6 +* Removes openjdk-7 for Ubuntu 16.04 +* Removes openjdk-11 for Ubuntu +* Removes openjdk-direct for Debian 8 +* Removes oracle variants from test configurations ## 4.3.0 - *2019-08-04* -- Upgrade Amazon Corretto to the latest versions: 8.222.10.1 and 11.0.4.11.1 -- Upgrade circleci orb to version 2 and add yamllint and markdown lint +* Upgrade Amazon Corretto to the latest versions: 8.222.10.1 and 11.0.4.11.1 +* Upgrade circleci orb to version 2 and add yamllint and markdown lint ## 4.2.0 - *2019-07-15* -- Fix for issue 538 -- Added "download_path" node attribute defaulting to file_cache_path -- Replaced all hardcoded instances of file_cache_path with the node attribute +* Fix for issue 538 +* Added "download_path" node attribute defaulting to file_cache_path +* Replaced all hardcoded instances of file_cache_path with the node attribute ## 4.1.0 - *2019-05-08* -- Added new install flavor "corretto" for Amazon's Corretto distribution of OpenJDK +* Added new install flavor "corretto" for Amazon's Corretto distribution of OpenJDK ## 4.0.0 - *2019-04-19* -- Added new install flavor "adoptopenjdk" for AdoptOpenJDK's distribution of Java -- The certificate resource now uses the Java version to determine the default cacerts location -- Updated AdoptOpenJDK links for Java 8 -- Updated AdoptOpenJDK links for Java 11 to 11.0.1 -- BREAKING CHANGE: Remove support for Java 6 & 7 -- Remove platform suport for untested platforms (smartOS, XenServer, zlinux, arch) -- Remove testing of Ubuntu 14.04, support at this point is no longer guaranteed and patches or other changes may not be accepted going further as Ubuntu 14.04 will be shortly EOL -- Fixed oracle download link for JDK 8 (update to 8u202 from 8u201) -- fixed specs for windows +* Added new install flavor "adoptopenjdk" for AdoptOpenJDK's distribution of Java +* The certificate resource now uses the Java version to determine the default cacerts location +* Updated AdoptOpenJDK links for Java 8 +* Updated AdoptOpenJDK links for Java 11 to 11.0.1 +* BREAKING CHANGE: Remove support for Java 6 & 7 +* Remove platform suport for untested platforms (smartOS, XenServer, zlinux, arch) +* Remove testing of Ubuntu 14.04, support at this point is no longer guaranteed and patches or other changes may not be accepted going further as Ubuntu 14.04 will be shortly EOL +* Fixed oracle download link for JDK 8 (update to 8u202 from 8u201) +* fixed specs for windows ## 3.2.0 - *2019-01-24* -- Add support OpenJDK 11 -- Fixed oracle download link again +* Add support OpenJDK 11 +* Fixed oracle download link again ## 3.1.2 - *2018-12-11* -- Set java home on macosx using /usr/libexec/java_home -- Find command should have ./ for path to search, works for nix and mac -- Make `java_certificate` work with SNI endpoints +* Set java home on macosx using /usr/libexec/java_home +* Find command should have ./ for path to search, works for nix and mac +* Make `java_certificate` work with SNI endpoints ## 3.1.1 - *2018-11-09* -- Fix jce installation linux -- Allow overwrite `returns` property of windows_packages +* Fix jce installation linux +* Allow overwrite `returns` property of windows_packages ## 3.1.0 - *2018-10-18* -- Add support for JDK 11 +* Add support for JDK 11 ## 3.0.0 - *2018-10-18* -- Fix broken JCE with JRE installations -- make cert alias matching case insensitive as `keytool` always returns results downcases -- BREAKING CHANGE: fixed greedy matching by adding a word boundry when checking cert alias this prevents matching `foo_123` as `foo` -- verify artifact after downloading from oracle -- fixed `recipes/openjdk` when `node['java']['jdk_version']` by casting it to a string -- Updated Oracle Java links to 8u191 +* Fix broken JCE with JRE installations +* make cert alias matching case insensitive as `keytool` always returns results downcases +* BREAKING CHANGE: fixed greedy matching by adding a word boundry when checking cert alias this prevents matching `foo_123` as `foo` +* verify artifact after downloading from oracle +* fixed `recipes/openjdk` when `node['java']['jdk_version']` by casting it to a string +* Updated Oracle Java links to 8u191 ## 2.2.1 - *2018-09-29* -- Allows for additional Oracle (post 9) jdk download file naming, including '10.0.2'. '18.9', '11' +* Allows for additional Oracle (post 9) jdk download file naming, including '10.0.2'. '18.9', '11' ## 2.2.0 - *2018-07-19* -- Updated Oracle Java links to 8u181 -- Fixed incorrect kitchen setup runlists that preventing local testing -- Resolve undefined certout errors +* Updated Oracle Java links to 8u181 +* Fixed incorrect kitchen setup runlists that preventing local testing +* Resolve undefined certout errors ## 2.1.0 - *2018-05-25* -- Added Java 10 JCE attributes to default attrs -- Update oracle recipeM to not perform a switch on java major version and instead use the version provided in attributes. This allows end users to include new Java versions without the cookbook requiring an update each time a major version gets released -- Updated the oracle_install resource to pick up semantic versioning that Oracle has started using for Java 10+ -- Updated the default attributes file to include x86_64 endpoint and checksum for Oracle Java 10\. The i586 version is not (yet) available. -- Fix JCE installation on Windows -- Avoid EmptyWindowsCommand error on Windows +* Added Java 10 JCE attributes to default attrs +* Update oracle recipeM to not perform a switch on java major version and instead use the version provided in attributes. This allows end users to include new Java versions without the cookbook requiring an update each time a major version gets released +* Updated the oracle_install resource to pick up semantic versioning that Oracle has started using for Java 10+ +* Updated the default attributes file to include x86_64 endpoint and checksum for Oracle Java 10\. The i586 version is not (yet) available. +* Fix JCE installation on Windows +* Avoid EmptyWindowsCommand error on Windows ## v2.0.1 - *2018-05-02* -- Fix java_certificate and java_oracle_install to work on FIPS enabled systems +* Fix java_certificate and java_oracle_install to work on FIPS enabled systems ## v2.0.0 - *2018-05-02* -- Converted alternatives, ark, and certificate LWRP/HWRPs to custom resources with improved logging and convergence notification. -- Renamed the java_ark resource to java_oracle_install, which better represents what it does. The existing name will continue to function -- Removed the need for the apt cookbook and instead require Chef 12.9+ -- Fixed Amazon Linux support on Chef 13+. -- Fixed the alternatives commands on Fedora systems. -- Added initial openSUSE leap support. -- Updated code to use multi-package installs to speed up runs -- Made the 'cert_alias' property in the certificate resource the name_property to allow users to avoid resource cloning and to be able to use friendly resource names -- Moved the warning code for downloading directly from Oracle into the resource to prevent another resource showing as converged -- Updated the metadata to resolve failures to parse chef_version on older chef-client releases. -- Added installation of tar directly to the ark resource when uncompression .tar.gz files. This prevents installation in the recipe that occurred even if tar wasn't needed. -- Add support for Mac OS X "mac_os_x" via homebrew. -- Update metadata.rb to contain source and issue information for supermarket and chef-repo convenience +* Converted alternatives, ark, and certificate LWRP/HWRPs to custom resources with improved logging and convergence notification. +* Renamed the java_ark resource to java_oracle_install, which better represents what it does. The existing name will continue to function +* Removed the need for the apt cookbook and instead require Chef 12.9+ +* Fixed Amazon Linux support on Chef 13+. +* Fixed the alternatives commands on Fedora systems. +* Added initial openSUSE leap support. +* Updated code to use multi-package installs to speed up runs +* Made the 'cert_alias' property in the certificate resource the name_property to allow users to avoid resource cloning and to be able to use friendly resource names +* Moved the warning code for downloading directly from Oracle into the resource to prevent another resource showing as converged +* Updated the metadata to resolve failures to parse chef_version on older chef-client releases. +* Added installation of tar directly to the ark resource when uncompression .tar.gz files. This prevents installation in the recipe that occurred even if tar wasn't needed. +* Add support for Mac OS X "mac_os_x" via homebrew. +* Update metadata.rb to contain source and issue information for supermarket and chef-repo convenience ### Known Issues -- Kitchen CI test with 12.04 fails due to hostname unable to be set. +* Kitchen CI test with 12.04 fails due to hostname unable to be set. ## v1.31 - *2/3/2015* -- Update to latest JDKs for 7 and 8\. JDK7 will be EOL April 2015 -- Fix up Travis support. -- Add ability to install JCE policy files for oracle JDK #228 -- Change connect timeout to 30 seconds +* Update to latest JDKs for 7 and 8\. JDK7 will be EOL April 2015 +* Fix up Travis support. +* Add ability to install JCE policy files for oracle JDK #228 +* Change connect timeout to 30 seconds ## v1.29.0 - *11/14/2014* -- Ensure dirs, links, and jinfo files are owned correctly -- Update to Oracle JDK 8u25 -- Update to Oracle JDK 7u71-b14 -- Adding a connect_timeout option for downloading java. -- Switched to chef-zero provisioner in test suites. -- Adding ISSUES.md for guidance on creating new issues for the Java cookbook. -- Fix IBM unit tests. +* Ensure dirs, links, and jinfo files are owned correctly +* Update to Oracle JDK 8u25 +* Update to Oracle JDK 7u71-b14 +* Adding a connect_timeout option for downloading java. +* Switched to chef-zero provisioner in test suites. +* Adding ISSUES.md for guidance on creating new issues for the Java cookbook. +* Fix IBM unit tests. ## v1.28.0 - *9/6/2014* -- Allow setting of group to extracted java files. -- Add -no-same-owner parameter to tar extract to avoid issues when the chef cache dir is on an NFS mounted drive. -- In the ark provider, it doesn't compare the MD5 sum with the right value which causes Java cookbook always download tarball from oracle server +* Allow setting of group to extracted java files. +* Add -no-same-owner parameter to tar extract to avoid issues when the chef cache dir is on an NFS mounted drive. +* In the ark provider, it doesn't compare the MD5 sum with the right value which causes Java cookbook always download tarball from oracle server ## v1.27.0 - *8/22/2014* -- Update Oracle JDK8 to version 8u20 +* Update Oracle JDK8 to version 8u20 ## v1.26.0 - *8/16/2014* -- Allow pinning of package versions for openjdk -- Update Oracle JDK7 to version 7u67 -- Support specific version and name for Oracle RPM +* Allow pinning of package versions for openjdk +* Update Oracle JDK7 to version 7u67 +* Support specific version and name for Oracle RPM ## v1.25.0 - *8/1/2014* -- Resource ark -> attribute bin_cmds default value -- Add option to put JAVA_HOME in /etc/environment -- Allow ark to pull from http and files ending in .gz. -- Recommendations for inclusion in community cookbooks -- Production Deployment with Oracle Java -- Update testing instructions for chefdk -- Various Readme formatting. -- Use Supermarket endpoint in berksfile -- rspec cleanup -- Adding ubuntu-14.04 to test suite +* Resource ark -> attribute bin_cmds default value +* Add option to put JAVA_HOME in /etc/environment +* Allow ark to pull from http and files ending in .gz. +* Recommendations for inclusion in community cookbooks +* Production Deployment with Oracle Java +* Update testing instructions for chefdk +* Various Readme formatting. +* Use Supermarket endpoint in berksfile +* rspec cleanup +* Adding ubuntu-14.04 to test suite ## v1.24.0 - *7/25/2014* New Cookbook maintainer! **[Agile Orbit](http://agileorbit.com)** -- Bump JDK7 URLs to 7u65 -- Upgrade Oracle's Java 8 to u11 -- Allow for alternatives priority to be set from attribute. -- Change ownership of extracted files -- Add retries and retry_delay parameters to java_ark LWRP -- default: don't fail when using java 8 on windows -- Support for Server JRE -- Updated README for accepting oracle terms -- Remove VirtualBox specific box_urls -- List AgileOrbit as the maintainer (AgileOrbit took over from Socrata in July 2014) +* Bump JDK7 URLs to 7u65 +* Upgrade Oracle's Java 8 to u11 +* Allow for alternatives priority to be set from attribute. +* Change ownership of extracted files +* Add retries and retry_delay parameters to java_ark LWRP +* default: don't fail when using java 8 on windows +* Support for Server JRE +* Updated README for accepting oracle terms +* Remove VirtualBox specific box_urls +* List AgileOrbit as the maintainer (AgileOrbit took over from Socrata in July 2014) ## v1.23.0 - *7/25/2014* -- Tagged but never published to community cookbooks. All changes rolled into 1.24.0 +* Tagged but never published to community cookbooks. All changes rolled into 1.24.0 ## v1.22.0 -- Add support for Oracle JDK 1.8.0 -- Make use of Chef's cache directory instead of /tmp -- Update Test Kitchen suites -- Add safety check for JDK 8 on non-Oracle +* Add support for Oracle JDK 1.8.0 +* Make use of Chef's cache directory instead of /tmp +* Update Test Kitchen suites +* Add safety check for JDK 8 on non-Oracle ## v1.21.2 @@ -368,128 +385,128 @@ New Cookbook maintainer! **[Agile Orbit](http://agileorbit.com)** ## v1.21.0 -- Update Oracle accept-license-terms cookie format +* Update Oracle accept-license-terms cookie format ## v1.20.0 -- Fixing version number. Accidently released at 0.15.x instead of 1.15.x +* Fixing version number. Accidently released at 0.15.x instead of 1.15.x ## v0.15.2 ### FIX -- Fixing JAVA_HOME on Ubuntu 10.04 +* Fixing JAVA_HOME on Ubuntu 10.04 ## v1.14.0 -- Fix alternatives when the package is already installed -- Fix a condition that would result in an error executing action `run` on resource 'bash[update-java-alternatives]' -- Fix bad checksum length -- Fix an issue where Java cookbook installs both JDK 6 and JDK 7 when JDK 7 is specified -- Allow Windoes recipe to download from signed S3 url -- Fix a failure on Centos 6.4 and Oracle JDK 7 -- Improve Windows support +* Fix alternatives when the package is already installed +* Fix a condition that would result in an error executing action `run` on resource 'bash[update-java-alternatives]' +* Fix bad checksum length +* Fix an issue where Java cookbook installs both JDK 6 and JDK 7 when JDK 7 is specified +* Allow Windoes recipe to download from signed S3 url +* Fix a failure on Centos 6.4 and Oracle JDK 7 +* Improve Windows support ## v1.13.0 -- Add default `platform_family` option in Java helper -- Fix support for Fedora -- Upgrade to Oracle Java 7u25 -- Add Oracle RPM support -- Add support for the platform `xenserver` -- Add SmartOS support +* Add default `platform_family` option in Java helper +* Fix support for Fedora +* Upgrade to Oracle Java 7u25 +* Add Oracle RPM support +* Add support for the platform `xenserver` +* Add SmartOS support ## v1.12.0 -- Add SmartOS support to java::openjdk recipe -- upgrade to Oracle Java 7u25 -- Adding support for the platform 'xenserver' (for installations of java in DOM0) -- java cookbook fails on Fedora +* Add SmartOS support to java::openjdk recipe +* upgrade to Oracle Java 7u25 +* Adding support for the platform 'xenserver' (for installations of java in DOM0) +* java cookbook fails on Fedora ## v1.11.6 -- Java cookbook does not have opensuse support -- Syntax Errors spec/default_spec.rb:4-8 +* Java cookbook does not have opensuse support +* Syntax Errors spec/default_spec.rb:4-8 ## v1.11.4 -- `bash[update-java-alternatives]` resource uses wrong attribute +* `bash[update-java-alternatives]` resource uses wrong attribute ## v1.11.2 -- Use SHA256 checksums for Oracle downloads, not SHA1. +* Use SHA256 checksums for Oracle downloads, not SHA1. ## v1.11.0 This version brings a wealth of tests and (backwards-compatible) refactoring, plus some new features (updated Java, IBM recipe). -- Add ibm recipe to java cookbook -- move java_home resources to their own recipe -- refactor ruby_block "update-java-alternatives" -- use platform_family in java cookbook -- add chefspec to java cookbook -- Refactor java cookbook -- update JDK to JDK 7u21, 6u45 +* Add ibm recipe to java cookbook +* move java_home resources to their own recipe +* refactor ruby_block "update-java-alternatives" +* use platform_family in java cookbook +* add chefspec to java cookbook +* Refactor java cookbook +* update JDK to JDK 7u21, 6u45 ## v1.10.2 -- [2415] - Fixed deprecation warnings in ark provider and openjdk recipe by using Chef::Mixin::ShellOut instead of Chef::ShellOut +* [2415] - Fixed deprecation warnings in ark provider and openjdk recipe by using Chef::Mixin::ShellOut instead of Chef::ShellOut ## v1.10.0 -- Allow java ark :url to be https -- Upgrade needed for oracle jdk in java cookbook +* Allow java ark :url to be https +* Upgrade needed for oracle jdk in java cookbook ## v1.9.6 -- add support for Oracle Linux +* add support for Oracle Linux ## v1.9.4 -- Run set-env-java-home in Java cookbook only if necessary -- ark provider does not allow for *.tgz tarballs to be used -- Java cookbook fails on CentOS6 (update-java-alternatives) +* Run set-env-java-home in Java cookbook only if necessary +* ark provider does not allow for *.tgz tarballs to be used +* Java cookbook fails on CentOS6 (update-java-alternatives) ## v1.9.2 -- FoodCritic fixes for java cookbook +* FoodCritic fixes for java cookbook ## v1.9.0 -- Update the Oracle Java version in the Java cookbook to release 1.7u11 +* Update the Oracle Java version in the Java cookbook to release 1.7u11 ## v1.8.2 -- Fix for missing /usr/lib/jvm/default-java on Debian +* Fix for missing /usr/lib/jvm/default-java on Debian ## v1.8.0 -- Add windows support +* Add windows support ## v1.7.0 -- improvements for Oracle update-alternatives -- When installing an Oracle JDK it is now registered with a higher priority than OpenJDK. (Related to COOK-1131.) -- When running both the oracle and oracle_i386 recipes, alternatives are now created for both JDKs. -- Alternatives are now created for all binaries listed in version specific attributes. (Related to COOK-1563 and COOK-1635.) -- When installing Oracke JDKs on Ubuntu, create .jinfo files for use with update-java-alternatives. Commands to set/install alternatives now only run if needed. +* improvements for Oracle update-alternatives +* When installing an Oracle JDK it is now registered with a higher priority than OpenJDK. (Related to COOK-1131.) +* When running both the oracle and oracle_i386 recipes, alternatives are now created for both JDKs. +* Alternatives are now created for all binaries listed in version specific attributes. (Related to COOK-1563 and COOK-1635.) +* When installing Oracke JDKs on Ubuntu, create .jinfo files for use with update-java-alternatives. Commands to set/install alternatives now only run if needed. ## v1.6.4 -- fixed typo in attribute for java 5 on i586 +* fixed typo in attribute for java 5 on i586 ## v1.6.2 -- whyrun support in `java_ark` LWRP -- CHEF-1804 compatibility -- install Java 6u37 and Java 7u9 -- incorrect warning text about `node['java']['oracle']['accept_oracle_download_terms']` +* whyrun support in `java_ark` LWRP +* CHEF-1804 compatibility +* install Java 6u37 and Java 7u9 +* incorrect warning text about `node['java']['oracle']['accept_oracle_download_terms']` ## v1.6.0 -- Install Oracle JDK from Oracle download directly -- set JAVA_HOME in openjdk recipe -- Install correct architecture on Amazon Linux +* Install Oracle JDK from Oracle download directly +* set JAVA_HOME in openjdk recipe +* Install correct architecture on Amazon Linux ## v1.5.4 @@ -498,21 +515,21 @@ use shellout instead of execute resource to update alternatives ## v1.5.2 -- remove sun-java6-jre on Ubuntu before installing Oracle's Java -- fails on Ubuntu 12.04 64bit with openjdk7 -- Oracle Java should symlink the jar command +* remove sun-java6-jre on Ubuntu before installing Oracle's Java +* fails on Ubuntu 12.04 64bit with openjdk7 +* Oracle Java should symlink the jar command ## v1.5.0 -- Oracle now prevents download of JDK via non-browser -- fix File.exists? +* Oracle now prevents download of JDK via non-browser +* fix File.exists? ## v1.4.2 -- fix attributes typo and platform case switch consistency +* fix attributes typo and platform case switch consistency ## v1.4.0 -- numerous updates: handle jdk6 and 7, switch from sun to oracle, make openjdk default, add `java_ark` LWRP. -- [42] - FreeBSD support -- ArchLinux support +* numerous updates: handle jdk6 and 7, switch from sun to oracle, make openjdk default, add `java_ark` LWRP. +* [42] - FreeBSD support +* ArchLinux support diff --git a/metadata.rb b/metadata.rb index 55d8fa99..602ca56d 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/sous-chefs/java' issues_url 'https://github.com/sous-chefs/java/issues' chef_version '>= 17.5' -version '14.0.1' +version '15.0.0' supports 'almalinux', '>= 8.0' supports 'amazon', '>= 2023.0' From a8c0d874781140ee5167f1be2f1fd819c4193068 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 9 Jul 2026 15:51:35 +0100 Subject: [PATCH 188/188] chore(deps): update sous-chefs/.github action to v9 (#763) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 256d7fec..08b47e1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ name: "Test" jobs: lint-unit: - uses: sous-chefs/.github/.github/workflows/lint-unit.yml@8.0.4 + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@9.0.0 permissions: checks: write pull-requests: write @@ -51,7 +51,7 @@ jobs: - name: Check out code uses: actions/checkout@v7 - name: Install Chef - uses: sous-chefs/.github/.github/actions/install-workstation@8.0.4 + uses: sous-chefs/.github/.github/actions/install-workstation@9.0.0 - name: Dokken uses: actionshub/test-kitchen@main env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7334bb52..bd814d3c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ permissions: jobs: release: - uses: sous-chefs/.github/.github/workflows/release-cookbook.yml@8.0.4 + uses: sous-chefs/.github/.github/workflows/release-cookbook.yml@9.0.0 secrets: token: ${{ secrets.PORTER_GITHUB_TOKEN }} supermarket_user: ${{ secrets.CHEF_SUPERMARKET_USER }}