Commit 7142cb98 authored by Joshua Hoblitt's avatar Joshua Hoblitt Committed by GitHub

Merge pull request #883 from esalberg/java

Allow custom location for slave JAVA command
parents 76b4514d dcc7612c
......@@ -87,7 +87,6 @@
# can be a String, or an Array.
#
# [*proxy_server*]
#
# Serves the same function as `::jenkins::proxy_server` but is an independent
# parameter so the `::jenkins` class does not need to be the catalog for
# slave only nodes.
......@@ -95,6 +94,9 @@
# [*swarm_client_args*]
# Swarm client arguments to add to slave command line. More info: https://github.com/jenkinsci/swarm-plugin/blob/master/client/src/main/java/hudson/plugins/swarm/Options.java
#
# [*java_cmd*]
# Path to the java command in ${defaults_location}/jenkins-slave. Defaults to '/usr/bin/java'
#
# === Examples
#
......@@ -140,6 +142,7 @@ class jenkins::slave (
Any $java_args = undef,
Any $swarm_client_args = undef,
Boolean $delete_existing_clients = false,
Any $java_cmd = '/usr/bin/java',
) inherits jenkins::params {
if versioncmp($version, '3.0') < 0 {
......
......@@ -253,6 +253,13 @@ describe 'jenkins::slave' do
end
end
end # delete_existing_clients
describe 'with a non-default $java_cmd' do
let(:params) { { java_cmd: '/usr/local/bin/java' } }
it { is_expected.to contain_file(slave_runtime_file).with_content(%r{^JAVA="#{java_cmd}"$}) }
end
end
shared_examples 'using slave_name' do
......
......@@ -4,7 +4,7 @@
# this file can not be used in its current state as a systemd EnvironmentFile.
# location of java
JAVA=/usr/bin/java
JAVA=<%= @java_cmd %>
# arguments to pass to java
#JAVA_ARGS="-Xmx256m"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment