-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving the cookbook to the top level
- Loading branch information
Showing
6 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
run "rm public/index.html" | ||
gem "browser_cms" | ||
run "cp /var/www/browsercms/database.yml config/database.yml" | ||
rake("db:create") | ||
route "map.routes_for_browser_cms" | ||
generate(:browser_cms) | ||
rake("db:migrate") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
run "rm public/index.html" | ||
gem "browser_cms" | ||
run "cp /var/www/browsercms/database.yml config/database.yml" | ||
rake("db:create") | ||
route "map.routes_for_browser_cms" | ||
generate(:browser_cms) | ||
generate(:browser_cms_demo_site) | ||
rake("db:migrate") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# | ||
# Cookbook Name:: browsercms | ||
# Recipe:: default | ||
# | ||
# Copyright 2009, Kane Reid Securities Group, 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. | ||
# | ||
|
||
include_recipe 'mysql' | ||
include_recipe 'apache2' | ||
include_recipe 'passenger' | ||
include_recipe 'gems' | ||
|
||
browsercms = node[:browsercms] | ||
user = node[:user] | ||
|
||
execute "download-browsercms" do | ||
command "cd /home/#{user}; git clone git://github.com/browsermedia/browsercms.git" | ||
creates "/home/#{user}/browsercms" | ||
action :run | ||
end | ||
|
||
execute "install-browsercms" do | ||
command "cd /home/#{user}/browsercms; rake cms:install" | ||
creates "/usr/lib/ruby/gems/1.8/gems/browser_cms_blog_module-3.0.0" | ||
action :run | ||
end | ||
|
||
|
||
directory "/var/log/browsercms" do | ||
action :create | ||
owner "root" | ||
group "admin" | ||
mode 0775 | ||
end | ||
|
||
directory "/var/www/browsercms" do | ||
action :create | ||
owner user | ||
group "www-data" | ||
mode 0775 | ||
end | ||
|
||
directory "/var/www/browsercms/site" do | ||
action :create | ||
owner user | ||
group "www-data" | ||
mode 0775 | ||
end | ||
|
||
template "/var/www/browsercms/database.yml" do | ||
owner node[:user] | ||
mode 0644 | ||
source "database.yml.erb" | ||
variables({ | ||
:name => "browsercms", | ||
:passwd => "J4LZE1XYTX30QYL" | ||
}) | ||
end | ||
|
||
execute "setup-browsercms" do | ||
command "umask 002 && rails site -d mysql -m /var/chef/cookbooks/browsercms/files/default/#{browsercms["style"]}_rails_template.rb > results.txt" | ||
creates "/var/www/browsercms/site/public/" | ||
group "www-data" | ||
cwd "/var/www/browsercms" | ||
user "www-data" | ||
action :run | ||
end | ||
|
||
passenger_app "public-site" do | ||
conf( {:env => "production", | ||
:server_name => browsercms["server_name"], | ||
:template => "public.conf.erb", | ||
:docroot => browsercms["docroot"], | ||
:enable => true | ||
} ) | ||
end | ||
|
||
passenger_app "admin-site" do | ||
conf( {:env => "production", | ||
:server_name => browsercms["server_name"], | ||
:template => "admin.conf.erb", | ||
:docroot => browsercms["docroot"], | ||
:enable => true | ||
} ) | ||
end | ||
|
||
# append config.action_controller.page_cache_directory = RAILS_ROOT + "/public/cache/" to config/environments/production.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<VirtualHost *:80> | ||
ServerName cms.<%= @server_name %> | ||
DocumentRoot <%= @docroot %> | ||
RailsAllowModRewrite on | ||
RailsBaseURI / | ||
RailsMaxPoolSize <%= @max_pool_size %> | ||
RailsPoolIdleTime 3600 | ||
RailsEnv 'production' | ||
|
||
ErrorLog /var/log/browsercms/admin_site_error.log | ||
CustomLog /var/log/browsercms/admin_site_access.log combined | ||
|
||
ErrorDocument 404 /404.html | ||
ErrorDocument 500 /500.html | ||
|
||
RewriteEngine On | ||
|
||
<Directory <%= @docroot %>> | ||
Options FollowSymLinks | ||
AllowOverride None | ||
Order allow,deny | ||
Allow from all | ||
</Directory> | ||
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
defaults: &defaults | ||
adapter: mysql | ||
host: localhost | ||
username: root | ||
password: <%= @passwd %> | ||
|
||
production: | ||
database: browsercms | ||
<<: *defaults | ||
|
||
development: | ||
database: browsercms | ||
<<: *defaults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<VirtualHost *:80> | ||
ServerName <%= @server_name %> | ||
DocumentRoot <%= @docroot %> | ||
RailsAllowModRewrite on | ||
RailsBaseURI / | ||
RailsMaxPoolSize <%= @max_pool_size %> | ||
RailsPoolIdleTime 3600 | ||
RailsEnv 'production' | ||
|
||
ErrorLog /var/log/browsercms/public_site_error.log | ||
CustomLog /var/log/browsercms/public_site_access.log combined | ||
|
||
ErrorDocument 404 /404.html | ||
ErrorDocument 500 /500.html | ||
|
||
RewriteEngine On | ||
|
||
# Uncomment for rewrite debugging | ||
#RewriteLog /var/sites/mysite/log/rewrite.log | ||
#RewriteLogLevel 9 | ||
|
||
#apache should serve cached pages | ||
RewriteRule ^/$ /cache/index.html [QSA] | ||
RewriteRule ^([^.]+)$ /cache/$1.html [QSA] | ||
|
||
<Directory <%= @docroot %>> | ||
Order allow,deny | ||
Allow from all | ||
</Directory> | ||
</VirtualHost> |