Skip to content

Commit

Permalink
Do not require the java cookbook
Browse files Browse the repository at this point in the history
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
sethvargo committed Jan 9, 2014
1 parent a8464de commit ca2a69d
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------------
Expand Down
1 change: 0 additions & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
43 changes: 43 additions & 0 deletions recipes/java.rb
Original file line number Diff line number Diff line change
@@ -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
3 changes: 0 additions & 3 deletions recipes/master.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit ca2a69d

Please sign in to comment.