Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set :stages, %w(staging production)
- set :default_stage, "staging"
- require 'capistrano/ext/multistage'
- default_run_options[:pty] = true
- ssh_options[:forward_agent] = true
- set :keep_releases, 10
- set :application, "extranet"
- set :user, "deploy"
- set :rails_env, "production"
- set :rake, "/var/lib/gems/1.8/bin/rake"
- set :use_sudo, false
- # Target directory for the application on the web and app servers.
- set :deploy_to, "/var/apps/#{application}"
- set :repository, "git@github.com:obtiva/els_#{application}.git"
- set :scm, :git
- set :branch, "master"
- set :git_enable_submodules, true
- set :git_shallow_clone, true
- task :after_after_update_code, :roles => :app do
- desc "Set up link to shared cache directory"
- run "ln -s #{shared_path}/cache #{release_path}/cache"
- desc "Set up link to shared upload directory"
- run "ln -s #{shared_path}/uploads #{release_path}/tmp/uploads"
- desc "Set up link to product images directory"
- run "ln -s #{shared_path}/product_images #{release_path}/public/images/products"
- end
- task :restart_backgroundrb, :roles => :app do
- desc "Restart BackgrounDRb server. Please be careful not to kill any existing Workers!!!"
- run "cd #{current_path} && ./script/backgroundrb stop && ./script/backgroundrb start"
- end
- task :tail_production_logs, :roles => :app do
- desc "tail production log files"
- run "tail -f #{current_path}/log/production.log" do |channel, stream, data|
- # puts # for an extra line break before the host name
- puts "#{channel[:host]}_production: #{data}"
- break if stream == :err
- end
- end
- task :tail_backgroundrb_logs, :roles => :app do
- run "tail -f #{current_path}/log/backgroundrb.log" do |channel, stream, data|
- # puts # for an extra line break before the host name
- puts "#{channel[:host]}_backgroundrb: #{data}"
- break if stream == :err
- end
- end
- namespace :passenger do
- desc "Restart Application"
- task :restart do
- run "touch #{current_path}/tmp/restart.txt"
- end
- end
- after :deploy, "passenger:restart"
Add Comment
Please, Sign In to add comment