Skip to content

Commit

Permalink
Merge pull request #1 from phlipper/master
Browse files Browse the repository at this point in the history
fixed crash, added readme
  • Loading branch information
fnichol committed Aug 16, 2011
2 parents e808161 + 664243e commit f8debc2
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 7 deletions.
63 changes: 62 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,69 @@
# DESCRIPTION:

Installs passenger gem via RVM and configures Apache or Nginx.


# REQUIREMENTS:

The following platforms are supported by this cookbook, meaning that the recipes run on these platforms without error:

* Ubuntu


# RECIPES

## default

Installs dependencies and contains helpers for other recipes.

## apache2

Installs passenger as an apache2 module. Requires the `apache2` recipe.

## nginx

Installs passenger as an nginx module. Requires the `nginx::source` recipe.


# ATTRIBUTES:

# USAGE:
## version

The version of passenger to deploy. This will be in a format used by the gem command.

Default is `3.0.7`.

## rvm_ruby

The RVM ruby (and optional gemset) under which to install the passenger gem. This will be in a format used by the rvm command.

Default is `ree-1.8.7-2011.03@passenger`.

## root_path

Optionally override the full path to the root of the installed passenger gem.

## module_path

Optionallly override the full path to the Apache2 module.


# LICENSE and AUTHOR

Author:: Fletcher Nichol (<fnichol@nichol.ca>)

Contributors:: Phil Cohen (http://phlippers.net/)

Copyright:: 2010, 2011, Fletcher Nichol

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.
2 changes: 1 addition & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
# limitations under the License.
#

default[:rvm_passenger][:version] = "3.0.5"
default[:rvm_passenger][:version] = "3.0.7"
default[:rvm_passenger][:rvm_ruby] = "ree-1.8.7-2011.03@passenger"
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
attribute "rvm_passenger/version",
:display_name => "Version of passenger",
:description => "The version of passenger to deploy. This will be in a format used by the gem command.",
:default => "3.0.3"
:default => "3.0.7"

attribute "rvm_passenger/rvm_ruby",
:display_name => "RVM ruby to use",
Expand Down
2 changes: 2 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
package "libcurl4-openssl-dev"
end

rvm_environment node[:rvm_passenger][:rvm_ruby]

# install passenger gem
rvm_gem "passenger" do
ruby_string node[:rvm_passenger][:rvm_ruby]
Expand Down
19 changes: 15 additions & 4 deletions recipes/nginx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,21 @@
include_recipe "rvm_passenger"

configure_flags = node[:nginx][:configure_flags].join(" ")
nginx_install = node[:nginx][:install_path]
nginx_version = node[:nginx][:version]
nginx_dir = node[:nginx][:dir]
archive_cache = node[:nginx][:archive_cache]
nginx_install = node[:nginx][:install_path]
nginx_version = node[:nginx][:version]
nginx_dir = node[:nginx][:dir]
archive_cache = node[:nginx][:archive_cache] || Chef::Config[:file_cache_path]

remote_file "#{archive_cache}/nginx-#{nginx_version}.tar.gz" do
source "http://sysoev.ru/nginx/nginx-#{nginx_version}.tar.gz"
action :create_if_missing
end

bash "extract_nginx_source" do
cwd archive_cache
code "tar zxf nginx-#{nginx_version}.tar.gz"
not_if "test -d #{archive_cache}/nginx-#{nginx_version}"
end

rvm_shell "build passenger_nginx_module" do
ruby_string node[:rvm_passenger][:rvm_ruby]
Expand Down

0 comments on commit f8debc2

Please sign in to comment.