From 6a0d457d5f4e13704f7e53d3439aabd9bb4cac39 Mon Sep 17 00:00:00 2001 From: Saurabh Pandit Date: Tue, 1 Oct 2024 16:21:01 +0530 Subject: [PATCH] (CAT-2051): Support for `aarch64` and `arm64` was added for Adopt and Adoptium Java installations. --- .github/workflows/nightly.yml | 2 +- manifests/adopt.pp | 6 ++--- spec/acceptance/install_spec.rb | 45 +++++++++++++++++++-------------- 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ebbaa7ff..617decd9 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -16,4 +16,4 @@ jobs: secrets: "inherit" with: runs_on: "ubuntu-20.04" - flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\"]'" + flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" diff --git a/manifests/adopt.pp b/manifests/adopt.pp index 957a7f03..bcf45bd8 100644 --- a/manifests/adopt.pp +++ b/manifests/adopt.pp @@ -216,7 +216,7 @@ if ( $_version_int == 8 ) { $_release_minor_package_name = $release_minor } else { - $_release_minor_package_name = "_${release_minor}" + $_release_minor_package_name = "_${release_minor.split(/\./)[0]}" } case $_package_type { @@ -251,8 +251,6 @@ $destination = "${destination_dir}${package_name}" notice ("Destination is ${destination}") - $install_command = ['tar', '-zxf', $destination, '-C', $_basedir] - case $ensure { 'present' : { archive { $destination : @@ -288,6 +286,8 @@ } } + $install_command = ['tar', '-zxf', $destination, '-C', $_basedir] + exec { "Install AdoptOpenJDK java ${java} ${_version} ${release_major} ${release_minor}" : path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin', command => $install_command, diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index 6e3a1d3f..a1099dc4 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -102,28 +102,21 @@ # We need to test version 8 and >8 (here we use 9), because namings are different after version 8 adopt_enabled = true unless os[:family].casecmp('SLES').zero? -adopt_version8_major = '8' -adopt_version8_minor = '202' -adopt_version8_build = '08' adopt_version9_major = '9' -adopt_version9_full = '9.0.4' -adopt_version9_build = '11' +case os[:arch] +when 'aarch64', 'arm64' + adopt_version9_full = '9' + adopt_version9_build = '181' +else + adopt_version9_full = '9.0.4' + adopt_version9_build = '11' +end + +adopt_version10_major = '10' +adopt_version10_full = '10.0.2' +adopt_version10_build = '13.1' install_adopt_jdk_jre = < '#{adopt_version8_major}', - version_major => '#{adopt_version8_major}u#{adopt_version8_minor}', - version_minor => 'b#{adopt_version8_build}', - java => 'jre', - } - java::adopt { - 'test_adopt_jdk_version8': - version => '#{adopt_version8_major}', - version_major => '#{adopt_version8_major}u#{adopt_version8_minor}', - version_minor => 'b#{adopt_version8_build}', - java => 'jdk', - } java::adopt { 'test_adopt_jre_version9': version => '#{adopt_version9_major}', @@ -138,6 +131,20 @@ version_minor => '#{adopt_version9_build}', java => 'jdk', } + java::adopt { + 'test_adopt_jre_version10': + version => '#{adopt_version10_major}', + version_major => '#{adopt_version10_full}', + version_minor => '#{adopt_version10_build}', + java => 'jre', + } + java::adopt { + 'test_adopt_jdk_version10': + version => '#{adopt_version10_major}', + version_major => '#{adopt_version10_full}', + version_minor => '#{adopt_version10_build}', + java => 'jdk', + } MANIFEST # Adoptium