Skip to content

Commit

Permalink
Change deploy tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
mlainez committed Sep 11, 2011
1 parent 377c03b commit 3548766
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
22 changes: 20 additions & 2 deletions config/deploy/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,32 @@
run "cd #{current_path}/ && rake RAILS_ENV=\"production\" db:migrate"
end

desc "Removng pictures"
task :remove_pictures do
run "cd #{current_path}/ && rm -rf public/system/*"
end

task :symlink_members_pictures do
run "ln -s #{deploy_to}/shared/system/ #{deploy_to}/current/public/system"
end

task :symlink_options do
run "ln -s #{deploy_to}/shared/options.yml #{deploy_to}/current/config/options.yml"
end

task :symlink_db do
run "ln -s #{deploy_to}/shared/database.yml #{deploy_to}/current/config/database.yml"
end

desc "Seeding Database"
task :rake_db_seed do
run "cd #{current_path}/ && rake RAILS_ENV=\"production\" db:seed"
run "cd #{current_path}/ && rake RAILS_ENV=\"testing\" db:seed --trace"
end

[:start, :stop].each do |t|
desc "#{t} task is a no-op with mod_rails"
task t, :roles => :app do ; end
end

after "deploy:update", "deploy:rake_db_migrate", "deploy:rake_db_seed", "deploy:symlink_members_pictures"
after "deploy:update", "deploy:remove_pictures", "deploy:symlink_members_pictures", "deploy:symlink_options", "deploy:symlink_db", "deploy:rake_db_migrate", "deploy:rake_db_seed"
end
22 changes: 20 additions & 2 deletions config/deploy/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,32 @@
run "cd #{current_path}/ && rake RAILS_ENV=\"staging\" db:migrate --trace"
end

desc "Removng pictures"
task :remove_pictures do
run "cd #{current_path}/ && rm -rf public/system/*"
end

task :symlink_members_pictures do
run "ln -s #{deploy_to}/shared/system/ #{deploy_to}/current/public/system"
end

task :symlink_options do
run "ln -s #{deploy_to}/shared/options.yml #{deploy_to}/current/config/options.yml"
end

task :symlink_db do
run "ln -s #{deploy_to}/shared/database.yml #{deploy_to}/current/config/database.yml"
end

desc "Seeding Database"
task :rake_db_seed do
run "cd #{current_path}/ && rake RAILS_ENV=\"staging\" db:seed --trace"
run "cd #{current_path}/ && rake RAILS_ENV=\"testing\" db:seed --trace"
end

[:start, :stop].each do |t|
desc "#{t} task is a no-op with mod_rails"
task t, :roles => :app do ; end
end

after "deploy:update", "deploy:rake_db_migrate", "deploy:rake_db_seed"
after "deploy:update", "deploy:remove_pictures", "deploy:symlink_members_pictures", "deploy:symlink_options", "deploy:symlink_db", "deploy:rake_db_migrate", "deploy:rake_db_seed"
end

0 comments on commit 3548766

Please sign in to comment.