apt_update 'update' if platform_family?('debian')

include_recipe 'java::default'
include_recipe 'jenkins::master'

# Install some plugins needed, but not installed on jenkins2 by default
jenkins_plugins = %w(
  mailer
  credentials
  ssh-credentials
  ssh-slaves
)
jenkins_plugins.each do |plugin|
  jenkins_plugin plugin do
    notifies :execute, 'jenkins_command[safe-restart]', :immediately
  end
end

jenkins_command 'safe-restart' do
  action :nothing
end

apt_update 'update' if platform_family?('debian')

include_recipe 'java::default'
include_recipe 'jenkins::master'

# Install some plugins needed, but not installed on jenkins2 by default
# jdk-tool is required by Jenkins version 2.112
jenkins_plugins = %w(
  mailer
  credentials
  ssh-credentials
  ssh-slaves
  jdk-tool
)
jenkins_plugins.each do |plugin|
  jenkins_plugin plugin do
    notifies :execute, 'jenkins_command[safe-restart]', :immediately
  end
end

jenkins_command 'safe-restart' do
  action :nothing
end

Add jdk-tool plugin as its not in Jenkins 2.112
Add jdk-tool plugin as its not in Jenkins 2.112

Signed-off-by: Josh Barker <88d7d21fa8a250d4e915db098658a3f5a42acdfb@gmail.com>
