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

add jdk17 option #241

Merged
merged 4 commits into from
Aug 23, 2024
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 manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# JVM Settings
$javahome = undef,
Enum['openjdk-11', 'oracle-jdk-1.8', 'custom'] $jvm_type = 'openjdk-11',
Enum['openjdk-17', 'openjdk-11', 'oracle-jdk-1.8', 'custom'] $jvm_type = 'openjdk-11',
$jvm_xms = '256m',
$jvm_xmx = '1024m',
$jvm_permgen = '256m',
Expand Down
17 changes: 17 additions & 0 deletions spec/classes/confluence_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,23 @@
end
end

context 'jdk17 specific option' do
let(:params) do
{
version: '8.5.14',
javahome: '/opt/java',
jvm_type: 'openjdk-17'
}
end

it do
is_expected.to compile.with_all_deps
is_expected.to contain_file('/opt/confluence/atlassian-confluence-8.5.14/bin/setenv.sh').
with_content(%r{CATALINA_OPTS="-XX:\+ExplicitGCInvokesConcurrent \${CATALINA_OPTS}"}).
with_content(%r{CATALINA_OPTS="-Xlog:gc\*:file=\$LOGBASEABS/logs/gc-%t.log:tags,time,uptime,level:filecount=5,filesize=2M \${CATALINA_OPTS}"}) # fix this spec test
end
end

context 'manage_user set to true' do
let(:params) do
{
Expand Down
10 changes: 7 additions & 3 deletions templates/setenv.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,22 @@ export JAVA_OPTS
# Set the JVM arguments used to start Confluence. For a description of the options, see
# http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

<%- if version[0] >= 7 # 7.x.x or higher -%>
<%- if version[0] == 7 # 7.x.x -%>
<%- if version[1] >= 1 # 7.1.x or higher -%>
CATALINA_OPTS="-XX:+IgnoreUnrecognizedVMOptions ${CATALINA_OPTS}"
CATALINA_OPTS="-Xlog:gc+age=debug:file=$LOGBASEABS/logs/gc-`date +%F_%H-%M-%S`.log::filecount=5,filesize=2M ${CATALINA_OPTS}"
<%- end -%>
<%- end -%>
<%- if scope.lookupvar('confluence::jvm_type') == 'openjdk-11' -%>
<%- if scope.lookupvar('confluence::jvm_type') == 'openjdk-17' -%>
CATALINA_OPTS="-XX:+ExplicitGCInvokesConcurrent ${CATALINA_OPTS}"
CATALINA_OPTS="-Xlog:gc*:file=$LOGBASEABS/logs/gc-%t.log:tags,time,uptime,level:filecount=5,filesize=2M ${CATALINA_OPTS}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Update unit tests? I think there is some jdk specific tests already.

<%- elsif scope.lookupvar('confluence::jvm_type') == 'openjdk-11' -%>
CATALINA_OPTS="-XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCDateStamps ${CATALINA_OPTS}"
CATALINA_OPTS="-Xloggc:$LOGBASEABS/logs/gc-`date +%F_%H-%M-%S`.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M ${CATALINA_OPTS}"
<%- elsif scope.lookupvar('confluence::jvm_type') == 'oracle-jdk-1.8' -%>
CATALINA_OPTS="-XX:-PrintGCDetails -XX:+PrintGCDateStamps -XX:-PrintTenuringDistribution ${CATALINA_OPTS}"
<%- end -%>
CATALINA_OPTS="-Xloggc:$LOGBASEABS/logs/gc-`date +%F_%H-%M-%S`.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M ${CATALINA_OPTS}"
<%- end -%>
CATALINA_OPTS="-XX:G1ReservePercent=20 ${CATALINA_OPTS}"
CATALINA_OPTS="-Djava.awt.headless=true ${CATALINA_OPTS}"
CATALINA_OPTS="-Datlassian.plugins.enable.wait=300 ${CATALINA_OPTS}"
Expand Down