Skip to content

Instantly share code, notes, and snippets.

@tdelam
Created August 21, 2012 13:26
Show Gist options
  • Save tdelam/3415395 to your computer and use it in GitHub Desktop.
Save tdelam/3415395 to your computer and use it in GitHub Desktop.
require 'rvm/capistrano'
set :application, "bigpond"
set :repository, "[email protected]:tdelam/bigpond.git"
set :scm, :git
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
set :rvm_type, :system
set :user, "trevor"
set :deploy_to, "/home/trevor/apps/#{application}"
set :use_sudo, false
set :keep_releases, 5
role :web, "184.106.69.164" # Your HTTP server, Apache/etc
role :app, "184.106.69.164" # This may be the same as your `Web` server
role :db, "184.106.69.164", :primary => true # This is where Rails migrations will run
role :db, "184.106.69.164"
namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
desc "Populates the Production Database"
task :seed do
puts "\n\n=== Populating the Production Database! ===\n\n"
run "cd #{current_path}; bundle exec rake db:seed RAILS_ENV=production"
end
task :symlink_database_yml do
run "rm #{release_path}/config/database.yml"
run "ln -sfn #{shared_path}/config/database.yml #{release_path}/config/database.yml"
end
end
after "bundle:install", "deploy:symlink_database_yml"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment