Permalink
Browse files

Do not require the java cookbook

The Java cookbook might be overkill for most users, and it is not even a
requirement for the package installer. Removing this dependency removes the
tight coupling between Jenkins and Java and allows users to easily install and
manage their own Java, outside of this cookbook.
  • Loading branch information...
Seth Vargo
Seth Vargo committed Jan 9, 2014
1 parent a8464de commit ca2a69d982011dc1bec6a6d0ee4da5c1a1599864
Showing with 49 additions and 5 deletions.
  1. +3 −1 .kitchen.yml
  2. +3 −0 README.md
  3. +0 −1 metadata.rb
  4. +43 −0 recipes/java.rb
  5. +0 −3 recipes/master.rb
View
@@ -36,7 +36,9 @@ suites:
master:
install_method: package
- name: jenkins_smoke_war
run_list: jenkins_smoke::default
run_list:
- jenkins::java
- jenkins_smoke::default
attributes:
jenkins:
master:
View
@@ -24,6 +24,9 @@ The master recipe will create the required directory structure and install jenki
- `package` - Install Jenkins from the official jenkins-ci.org packages
- `war` - Download the latest version of the WAR file and configure it with Runit
### java
By default, this cookbook does not install, manage, or manipulate a JDK, as that is outside of the scope of Jenkins. The `package` installation method will automatically pull in a valid Java if one does not exist, by the nature of package installers. However, the `war` installation method will require you to install a valid Java runtime. This very simple recipe installs OpenJDK 7 on the target system. **If you need a more complex Java setup, you should use the community cookbook or write your own.** For more information and warnings, please see the inline documentation in the `jenkins::java` recipe.
Resource/Provider
-----------------
View
@@ -9,6 +9,5 @@
recipe 'master', 'Installs a Jenkins master'
depends 'apt', '~> 2.0'
depends 'java', '~> 1.17'
depends 'runit', '~> 1.5'
depends 'yum', '~> 3.0'
View
@@ -0,0 +1,43 @@
#
# Cookbook Name:: jenkins
# Recipe:: java
#
# Author: Seth Vargo <sethvargo@getchef.com>
#
# Copyright 2014, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This is a very basic recipe for installing Java on the target system. It is
# NOT included in any recipes by default. The purpose of this cookbook is to
# install Jenkins, not manage a Java. For complex Java scenarios, you should
# use the Java community cookbook or construct your own.
#
# Do NOT submit patches adding support for additional platforms
# Do NOT submit patches adding support for installing Java derivatives
# Do NOT submit patches adding support for installing different Java versions
#
# This recipe is not included by default, and you have no obligation to use it.
# We are going to be incredibly opinionated about what this recipe includes, as
# it is a minimum viable cookbook for installing Java. If you need a more
# complex scenario, that is outside the scope of this cookbook.
#
case node['platform_family']
when 'debian'
package 'openjdk-7-jdk'
when 'rhel'
package 'java-1.7.0-openjdk'
else
fail "`#{node['platform_family']}' is not supported!"
end
View
@@ -26,9 +26,6 @@
# limitations under the License.
#
# Install Java (TODO: remove)
include_recipe 'java::default'
# Create the Jenkins user
user node['jenkins']['master']['user'] do
home node['jenkins']['master']['home']

0 comments on commit ca2a69d

Please sign in to comment.