added capistrano config

This commit is contained in:
Roland 2011-04-30 23:31:23 +02:00
parent 97f25be3a1
commit 37883e0846
2 changed files with 55 additions and 0 deletions

51
config/deploy.rb Normal file
View file

@ -0,0 +1,51 @@
# Commented out as capistrano cannot finde 'bundle' on production site.
# require 'bundler/capistrano'
set :application, "contactorama"
set :local_repository, "web1@railshosting.de:/files/repositories/git/contactorama.git"
set :repository, "/var/www/htdocs/web1/files/repositories/git/contactorama.git"
set :deploy_to, "/var/www/htdocs/web1/files/rails/#{application}"
set :symlink_path, "/var/www/htdocs/web1/html/rails/#{application}"
set :scm, :git
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
set :user, "web1"
ssh_options[:port] = 981
set :use_sudo, false
set :deploy_via, :remote_cache
role :web, "railshosting.de" # Your HTTP server, Apache/etc
role :app, "railshosting.de" # This may be the same as your `Web` server
role :db, "railshosting.de", :primary => true # This is where Rails migrations will run
# role :db, "railshosting.de"
# copy shared files after update
task :update_config, :roles => :app do
run "cp -Rf #{shared_path}/config/* #{release_path}/config/"
end
# create symlink after setup
task :symlink_config, :roles => :app do
run "mkdir -p /var/www/htdocs/#{user}/html/rails"
run "ln -nfs #{current_path}/public #{symlink_path}"
end
after "deploy:setup", :symlink_config
after "deploy:update_code", :update_config
# mod_rails (phusion_passenger) stuff
namespace :deploy do
desc "Restart Application"
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{current_path}/tmp/restart.txt"
end
[:start, :stop].each do |t|
desc "start/stop is not necessary with mod_rails"
task t, :roles => :app do
# nothing
end
end
end