You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.0 KiB

13 years ago
require 'bundler/capistrano'
13 years ago
default_run_options[:pty] = true
13 years ago
set :application, 'entrydns'
13 years ago
set :domain, 'n0.entrydns.net'
13 years ago
set :repository, "git@bitbucket.org:clyfe/entrydns.git"
13 years ago
set :deploy_to, '/srv/www/apps/entrydns'
set :user, 'clyfe'
13 years ago
set :use_sudo, false
13 years ago
set :scm, 'git'
13 years ago
set :ssh_options, :forward_agent => true
13 years ago
set :deploy_via, :remote_cache
13 years ago
# set :branch, "master"
# set :scm_verbose, true
13 years ago
# set :git_enable_submodules,
# set :scm_passphrase, "passwd0" # the deploy user's password
13 years ago
13 years ago
role :web, domain # Your HTTP server, Apache/etc
role :app, domain # This may be the same as your `Web` server
role :db, domain, :primary => true # This is where Rails migrations will run
# role :db, "your slave db-server here"
13 years ago
after 'deploy:update_code', 'deploy:symlink_database_yml'
after 'deploy:update_code', 'deploy:symlink_settings_yml'
load 'deploy/assets'
# TODO
# chown -R clyfe:wwwdata /srv/www/apps/entrydns/current/public
# find /srv/www/apps/entrydns/current/public -type d -exec chmod 0750 {} +
# find /srv/www/apps/entrydns/current/public -type f -exec chmod 0640 {} +
# TODO
# precompile assets
13 years ago
namespace :deploy do
13 years ago
task :start, :roles => :app, :except => { :no_release => true } do
13 years ago
run "touch #{current_release}/tmp/restart.txt"
end
task :stop, :roles => :app do
# Do nothing.
end
desc "Restart Application"
13 years ago
task :restart, :roles => :app, :except => { :no_release => true } do
13 years ago
run "touch #{current_release}/tmp/restart.txt"
end
desc "Symlinks the database.yml"
13 years ago
task :symlink_database_yml, :roles => :app do
run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml"
end
13 years ago
desc "Symlinks the settings.yml"
task :symlink_settings_yml, :roles => :app do
run "ln -nfs #{deploy_to}/shared/config/settings.yml #{release_path}/config/settings.yml"
end
13 years ago
desc "Populates the Production Database"
task :seed do
run "cd #{current_path}; #{rake} db:seed RAILS_ENV=production"
end
13 years ago
end