Fix ENV var syntax. Fix autostart. Refs #1

This commit is contained in:
Pavel Chipiga 2011-12-14 15:04:16 +02:00
parent 326fe3f998
commit 31bd8d799f
3 changed files with 7 additions and 7 deletions

View File

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

View File

@ -1,6 +1,6 @@
#! /usr/bin/env ruby
app_name = ENV['APP_NAME'] rescue 'rosa_build'
app_name = ENV['APP_NAME'] || 'rosa_build'
Bluepill.application(app_name) do |app|
app.uid = app.gid = 'rosa'
app.working_dir = "/srv/#{app_name}/current"

View File

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