Run bluepill as user. Fix configs. Refs #1

This commit is contained in:
Pavel Chipiga 2011-12-14 13:06:56 +02:00
parent 045b8441f6
commit 3379419eae
5 changed files with 9 additions and 9 deletions

View File

@ -40,6 +40,7 @@ gem 'unicorn', '~> 4.1.1'
group :production do group :production do
gem "airbrake", '~> 3.0.5' gem "airbrake", '~> 3.0.5'
# gem 'newrelic_rpm', '~> 3.1.1' # gem 'newrelic_rpm', '~> 3.1.1'
gem 'bluepill', :require => false
end end
group :development do group :development do
@ -64,7 +65,6 @@ group :development do
# gem 'capistrano-exts', :require => false #, :git => 'git://github.com/chipiga/capistrano-exts.git' # gem 'capistrano-exts', :require => false #, :git => 'git://github.com/chipiga/capistrano-exts.git'
# gem 'capistrano-recipes', :require => false # gem 'capistrano-recipes', :require => false
gem 'capistrano_colors', :require => false gem 'capistrano_colors', :require => false
gem 'bluepill', :require => false
end end
group :development, :test do group :development, :test do

View File

@ -2,7 +2,7 @@
for f in `ls /srv` for f in `ls /srv`
do do
sudo -u rosa rvmsudo bundle exec bluepill load /srv/$f/current/config/production.pill APP_NAME=$f sudo -u rosa bundle exec bluepill --no-privileged load /srv/$f/current/config/production.pill APP_NAME=$f
done done
/srv/rosa_build/current/bin/mount_downloads.sh /srv/rosa_build/current/bin/mount_downloads.sh

View File

@ -10,6 +10,6 @@ role :db, domain, :primary => true
set :application, "rosa_build_#{stage}" set :application, "rosa_build_#{stage}"
set :deploy_to, "/srv/#{application}" set :deploy_to, "/srv/#{application}"
set :unicorn_port, 8081 # set :unicorn_port, 8081
before "deploy:restart", "deploy:stub_xml_rpc" before "deploy:restart", "deploy:stub_xml_rpc"

View File

@ -10,6 +10,6 @@ role :db, domain, :primary => true
set :application, "rosa_build_#{stage}" set :application, "rosa_build_#{stage}"
set :deploy_to, "/srv/#{application}" set :deploy_to, "/srv/#{application}"
set :unicorn_port, 8082 # set :unicorn_port, 8082
before "deploy:restart", "deploy:stub_xml_rpc" before "deploy:restart", "deploy:stub_xml_rpc"

View File

@ -1,21 +1,21 @@
Capistrano::Configuration.instance(:must_exist).load do Capistrano::Configuration.instance(:must_exist).load do
namespace :bluepill do namespace :bluepill do
set(:bluepill_config) { File.join release_path, 'config', 'production.pill' } set :bluepill_binary, "bundle exec bluepill --no-privileged"
desc "Stop processes that bluepill is monitoring and quit bluepill" desc "Stop processes that bluepill is monitoring and quit bluepill"
task :quit, :roles => [:app] do task :quit, :roles => [:app] do
sudo "bundle exec bluepill stop APP_NAME=#{fetch :application}" run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} stop APP_NAME=#{fetch :application}"
sudo "bundle exec bluepill quit APP_NAME=#{fetch :application}" run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} quit APP_NAME=#{fetch :application}"
end end
desc "Load bluepill configuration and start it" desc "Load bluepill configuration and start it"
task :start, :roles => [:app] do task :start, :roles => [:app] do
sudo "bundle exec bluepill load #{bluepill_config} APP_NAME=#{fetch :application}" run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} load config/production.pill APP_NAME=#{fetch :application}"
end end
desc "Prints bluepills monitored processes statuses" desc "Prints bluepills monitored processes statuses"
task :status, :roles => [:app] do task :status, :roles => [:app] do
sudo "bundle exec bluepill status APP_NAME=#{fetch :application}" run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} status APP_NAME=#{fetch :application}"
end end
end end
end end