Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove platform version complexity for Java version #6

Merged
merged 2 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '8', '11' ]
java: [ '11, '17' ]
env:
LEIN_HOME: local

Expand Down
33 changes: 5 additions & 28 deletions resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,24 +189,13 @@
options.systemd_el = 1
elsif options.operating_system == :el && options.os_version >= 7 # systemd el
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we even build for EL6 or can we also simplify this?

if ! options.is_pe
fpm_opts << "--depends tzdata-java"
options.java =
case options.platform_version
when 8
# rpm on Redhat 7 may not support OR dependencies
if options.os_version == 7
'java-11-openjdk-headless'
elsif options.os_version == 8
'(java-17-openjdk-headless or java-11-openjdk-headless)'
elsif options.os_version >= 9
'java-17-openjdk-headless'
else
fail "Unrecognized el os version #{options.os_version}"
end
when 7
if options.os_version == 7
'java-11-openjdk-headless'
elsif options.os_version >= 8
'java-17-openjdk-headless'
else
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even this else is not needed since line 190 already guarantees os_version is at least 7. I'll clean that up in a later patch.

fail "Unknown Puppet Platform Version #{options.platform_version}"
fail "Unrecognized el os version #{options.os_version}"
end
end

Expand All @@ -223,19 +212,7 @@
options.systemd_sles = 1
options.sles = 1
if ! options.is_pe
options.java =
case options.platform_version
when 8
'java-11-openjdk-headless'
when 7
if options.os_version > 12
'java-11-openjdk-headless'
else
'java-1_8_0-openjdk-headless'
end
else
fail "Unknown Puppet Platform Version #{options.platform_version}"
end
options.java = 'java-11-openjdk-headless'
end
elsif options.operating_system == :sles #old sles
options.sysvinit = 1
Expand Down
1 change: 1 addition & 0 deletions test/unit/puppetlabs/ezbake/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
:is-pe-build "false"
:reload-timeout "'120'"
:bootstrap-source "'bootstrap-cfg'"
:package-name "'dummy'"
:debian-interested-install-triggers ()
:group "'dummy'"
:java-args "'-Xmx192m'"
Expand Down