Skip to content

Commit

Permalink
Switch back to SCM resource instead of deploy, since we don't need th…
Browse files Browse the repository at this point in the history
…e deploy magic
  • Loading branch information
Jonathan Owens committed Mar 22, 2012
1 parent 19fbba0 commit e38b264
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions deploy/cookbooks/petclinic/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,31 @@

app_root = '/web_apps/rails_pet_clinic'

directory "#{app_root}/shared" do
directory app_root do
recursive true
action :create
owner 'www-data'
group 'www-data'
mode '0755'
end

deploy app_root do
repo "git://github.com/niralisse/RailsPetClinic.git"
action :deploy
# no symlinks, we store production config in the repo
symlink_before_migrate({})
git app_root do
repository "git://github.com/niralisse/RailsPetClinic.git"
action :sync
revision 'master'
enable_submodules true
migrate true
# nuke everything all the time
migration_command "bundle install; bundle exec rake db:drop; bundle exec rake db:create; bundle exec rake db:migrate && bundle exec rake db:populate"
environment "RAILS_ENV" => "production"
restart_command 'monit restart unicorn'
user 'www-data'
group 'www-data'
notifies :run, resources(:execute => "database setup")
end

execute "database setup" do
command "bundle install; bundle exec rake db:drop; bundle exec rake db:create; bundle exec rake db:migrate && bundle exec rake db:populate"
cwd app_root
environment('RAILS_ENV' => 'production')
group 'www-data'
user 'www-data'
action :nothing
end

template "#{node[:nginx][:dir]}/sites-available/petclinic" do
Expand Down

0 comments on commit e38b264

Please sign in to comment.