суббота, 29 декабря 2012 г.

Deploy Capistrano + Mailman + RVM + Monit (for FreeBSD) - ВЫСТРАДАНО

you should use gem 'capistrano/rvm'

 

met be set(:rvm_ruby_string){ '1.9.3@mygemset' } somewhere

and here is recipe for capistrano

namespace :mailman do
desc "Mailman::Start"
task :start, :roles => [:app] do
run "cd #{current_path}; RAILS_ENV=production script/mailman_daemon start"
end

desc "Mailman::Stop"
task :stop, :roles => [:app] do
run "cd #{current_path}; RAILS_ENV=production script/mailman_daemon stop"
end
desc "Mailman::Status"
task :status, :roles => [:app] do
run "cd #{current_path}; RAILS_ENV=production script/mailman_daemon status"
end

desc "Mailman::Restart"
task :restart, :roles => [:app] do
mailman.stop
mailman.start
end
end
before :deploy, "mailman:stop"
after :deploy, "mailman:start"

in order to run monit you should use this config for user and group nexus

check process mailman_server with pidfile /www/itservice/current/script/mailman_server.pid
start program = "/usr/local/rvm/bin/rvm-shell '1.9.3@mygemset' -c 'cd /www/itservice/current/; RAILS_ENV=production /www/itservice/current/script/mailman_daemon start'"
as uid nexus and gid nexus
stop program = "/usr/local/rvm/bin/rvm-shell '1.9.3@mygemset' -c 'cd /www/itservice/current/; RAILS_ENV=production /www/itservice/current/script/mailman_daemon stop'"
as uid nexus and gid nexus
~

Комментариев нет:

Отправить комментарий