Merge branch 'master' into 3.2-master

Conflicts:
	config/deploy.rb
This commit is contained in:
Pavel Chipiga 2012-02-28 17:44:11 +02:00
commit 2f39b050ae
6 changed files with 15 additions and 7 deletions

View File

@ -4,7 +4,7 @@ class Category < ActiveRecord::Base
validates :name, :presence => true
scope :default_order, order('categories.name')
default_scope order('categories.name')
has_ancestry
end

View File

@ -8,6 +8,7 @@ require 'bundler/capistrano'
require 'delayed/recipes'
require 'airbrake/capistrano'
set :whenever_command, "bundle exec whenever"
# require "whenever/capistrano"
@ -65,7 +66,13 @@ end
after "deploy:finalize_update", "deploy:symlink_all"
after "deploy:update_code", "deploy:migrate"
after "deploy:setup", "deploy:symlink_pids"
after "deploy:restart", "bluepill:start" # "bluepill:processes:restart_dj" # "bluepill:restart"
# after "deploy:restart", "bluepill:start" # "bluepill:processes:restart_dj" # "bluepill:restart"
# DJ
after "deploy:stop", "delayed_job:stop"
after "deploy:start", "delayed_job:start"
after "deploy:restart", "delayed_job:restart"
after "deploy:restart", "deploy:cleanup"
require 'cape'

View File

@ -9,9 +9,8 @@ Bluepill.application(app_name) do |app|
process.stop_grace_time = 10.seconds
process.restart_grace_time = 10.seconds
process.start_command = "/usr/bin/env RAILS_ENV=production script/delayed_job start"
process.stop_command = "/usr/bin/env RAILS_ENV=production script/delayed_job stop"
process.restart_command = "/usr/bin/env RAILS_ENV=production script/delayed_job restart"
process.start_command = "/usr/bin/env ruby script/delayed_job start"
process.stop_command = "/usr/bin/env ruby script/delayed_job stop"
process.pid_file = File.join(app.working_dir, 'tmp', 'pids', 'delayed_job.pid')
end

View File

@ -36,7 +36,8 @@ Capistrano::Configuration.instance(:must_exist).load do
end
desc "Quit bluepill"
task :stop, :roles => [:app] do
task :quit, :roles => [:app] do
run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} #{fetch :application} stop"
run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} #{fetch :application} quit"
end

View File

@ -64,7 +64,7 @@ header div.text {
article {
width: 760px;
height: 305px;
height: auto;
background: #1c394c url("../pics/bg-signup.png") repeat-x;
border-radius: 5px;
border: 1px solid #38658c;

View File

@ -1,5 +1,6 @@
#!/usr/bin/env ruby
ENV['RAILS_ENV'] ||= "production"
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
require 'delayed/command'
Delayed::Command.new(ARGV).daemonize