Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $:.unshift(File.expand_path('./lib', ENV['rvm_path']))
- require 'rubygems'
- require 'bundler/capistrano'
- require 'rvm/capistrano'
- set :application, "izinenko-ru"
- set :user, 'hosting_zinenkoan'
- set :use_sudo, false
- set :rails_env, 'production'
- set :rake, 'rake'
- set :rvm_ruby_string, '1.9.2@blog'
- set :rvm_type, :user
- role :web, "lithium.locum.ru"
- role :app, "lithium.locum.ru"
- role :db, "lithium.locum.ru", :primary => true
- set :scm, :git
- set :deploy_to, "/home/#{user}/projects/#{application}"
- set :deploy_via, :remote_cache
- set :repository, "git://github.com/zinenko/izinenko.git"
- set :branch, 'master'
- set :bundle_gemfile, 'Gemfile'
- set :bundle_dir, fetch(:shared_path) + '/bundle'
- set :bundle_flags, '--deployment --quiet'
- set :bundle_without, [ :development, :test ]
- set :bundle_cmd, 'LANG=ru_RU.UTF-8 bundle'
- set :unicorn_rails, "#{bundle_cmd} exec unicorn_rails"
- set :unicorn_conf, "/etc/unicorn/#{application}.#{user}.rb"
- set :unicorn_pid, "/var/run/unicorn/#{application}.#{user}.pid"
- after "deploy:update_code", :copy_database_config
- task :copy_database_config, roles => :app do
- db_config = "#{shared_path}/database.yml"
- run "cp #{db_config} #{release_path}/config/database.yml"
- end
- # after 'deploy:symlink' do
- # release_log_dir = File.join(current_path, 'log')
- # shared_log_dir = File.join(shared_path, 'log')
- # run "rm -rf #{release_log_dir}"
- # run "ln -sf #{shared_log_dir} #{release_log_dir}"
- # sockets_dir = File.join(current_path, 'tmp', 'sockets')
- # run("mkdir -p #{sockets_dir}")
- # run("ln -sf #{shared_path}/things " +
- # "#{current_path}/public/things")
- # run("ln -sf #{shared_path}/database.yml " +
- # "#{current_path}/config/database.yml")
- # end
- namespace :deploy do
- task :start do
- run "cd #{current_path} && #{unicorn_rails} -Dc #{unicorn_conf} -E #{rails_env}"
- end
- task :stop do
- run "[ -f #{unicorn_pid} ] && kill -QUIT `cat #{unicorn_pid}`"
- end
- task :restart, :roles => :app, :except => { :no_release => true } do
- run "cd #{current_path} && [ -f #{unicorn_pid} ] && kill -USR2 `cat #{unicorn_pid}` || #{unicorn_rails} -Dc #{unicorn_conf} -E #{rails_env}"
- end
- end
Add Comment
Please, Sign In to add comment