Skip to content

Commit

Permalink
Move some hardcoded angelbox app setup into railsframe
Browse files Browse the repository at this point in the history
  • Loading branch information
noahgibbs committed Jan 16, 2011
1 parent 5f02b54 commit 2296978
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
4 changes: 1 addition & 3 deletions cookbooks/angelbox/recipes/default.rb
Expand Up @@ -25,7 +25,7 @@
group "www"
end

# Outdated information sometimes means package won't install
# Outdated information sometimes means packages won't install - update
require_recipe "apt"

# includes build-essential, for gems with native extensions
Expand All @@ -49,8 +49,6 @@
package "libsqlite3-dev"
###########



directory "/home/www/checkouts" do
owner "www"
group "www"
Expand Down
20 changes: 18 additions & 2 deletions cookbooks/railsframe/recipes/default.rb
Expand Up @@ -18,9 +18,10 @@
app[:name] ||= app[:github]
end

project = app[:dir] || app[:name]
dir = "#{node[:railsframe][:dir]}/#{project}"
if app[:git]
project = app[:dir] || app[:name]
git "#{node[:railsframe][:dir]}/#{project}" do
git dir do
action :sync
repository app[:git]
user node[:railsframe][:user]
Expand All @@ -30,4 +31,19 @@
raise "Couldn't find a git repository!"
end

directory "#{dir}/tmp" do
owner node[:railsframe][:user]
group node[:railsframe][:group]
end

bash "bundler installation" do
code "bundle install"
cwd dir
only_if { File.exist? "#{dir}/Gemfile" }
end

bash "passenger restart" do
code "touch tmp/restart.txt"
cwd dir
end
end

0 comments on commit 2296978

Please sign in to comment.