This repository has been archived by the owner on Dec 12, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
57 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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
load 'deploy' if respond_to?(:namespace) # cap2 differentiator | |||
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } | |||
load 'config/deploy' |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,54 @@ | |||
set :application, "dailystamp.r09.railsrumble.com" | |||
role :app, application | |||
role :web, application | |||
role :db, application, :primary => true | |||
|
|||
set :user, "rbates" | |||
set :deploy_to, "/var/apps/dailystamp" | |||
set :deploy_via, :remote_cache | |||
set :use_sudo, false | |||
set :ssh_options, { :forward_agent => true } | |||
|
|||
set :scm, "git" | |||
set :repository, "git@github.com:railsrumble/rr09-team-16.git" | |||
set :branch, "master" | |||
|
|||
namespace :deploy do | |||
desc "Tell Passenger to restart." | |||
task :restart, :roles => :web do | |||
run "touch #{deploy_to}/current/tmp/restart.txt" | |||
end | |||
|
|||
desc "Do nothing on startup so we don't get a script/spin error." | |||
task :start do | |||
puts "You may need to restart Apache." | |||
end | |||
|
|||
desc "Symlink extra configs and folders." | |||
task :symlink_extras do | |||
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml" | |||
run "ln -nfs #{shared_path}/config/app_config.yml #{release_path}/config/app_config.yml" | |||
run "ln -nfs #{shared_path}/db/production.sqlite3 #{release_path}/db/production.sqlite3" | |||
run "ln -nfs #{shared_path}/assets #{release_path}/public/assets" | |||
end | |||
|
|||
desc "Setup shared directory." | |||
task :setup_shared do | |||
run "mkdir #{shared_path}/assets" | |||
run "mkdir #{shared_path}/config" | |||
run "mkdir #{shared_path}/db" | |||
run "mkdir #{shared_path}/db/sphinx" | |||
put File.read("config/database.example.yml"), "#{shared_path}/config/database.yml" | |||
puts "Now edit the config files and fill assets folder in #{shared_path}." | |||
end | |||
|
|||
desc "Update the crontab file" | |||
task :update_crontab, :roles => :db do | |||
run "cd #{release_path} && whenever --update-crontab #{application}" | |||
end | |||
end | |||
|
|||
after "deploy", "deploy:cleanup" # keeps only last 5 releases | |||
after "deploy:setup", "deploy:setup_shared" | |||
after "deploy:update_code", "deploy:symlink_extras" | |||
# after "deploy:symlink", "deploy:update_crontab" |