Sha256: 949917e1b45a42ec2971fa7c000b1d296c0672ecbe3d48eb89ef12d8ef9b59f9

Contents?: true

Size: 954 Bytes

Versions: 16

Compression:

Stored size: 954 Bytes

Contents

if File.exists? Rails.root.join('unicorn.rb')
  namespace :unicorn do
    desc 'Start unicorn server'
    task :start => :stop do
      if File.exists? Rails.root.join('config.ru')
        cmd = 'unicorn'
      else
        cmd = 'unicorn_rails'
      end
      cmd << ' -c unicorn.rb -E production -D'
      zfben_rails_rake_system 'mkdir tmp' unless File.exists? Rails.root.join('tmp')
      zfben_rails_rake_system cmd
    end

    desc 'Stop unicorn server'
    task :stop do
      if File.exists? Rails.root.join('tmp/unicorn.pid')
        zfben_rails_rake_system 'kill -QUIT `cat tmp/unicorn.pid`'
        sleep 1
        zfben_rails_rake_system 'rm tmp/unicorn.pid' if File.exists? Rails.root.join('tmp/unicorn.pid')
      end
    end

    desc 'Hot restart unicorn server'
    task :restart do
      if File.exists? Rails.root.join('tmp/unicorn.pid')
        zfben_rails_rake_system 'kill -USR2 `cat tmp/unicorn.pid`'
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
h2ocube_rails_tasks-0.0.14 lib/h2ocube_rails_tasks/tasks/unicorn.rb
h2ocube_rails_tasks-0.0.13 lib/h2ocube_rails_tasks/tasks/unicorn.rb
h2ocube_rails_tasks-0.0.12 lib/h2ocube_rails_tasks/tasks/unicorn.rb
h2ocube_rails_tasks-0.0.11 lib/h2ocube_rails_tasks/tasks/unicorn.rb
h2ocube_rails_tasks-0.0.10 lib/h2ocube_rails_tasks/tasks/unicorn.rb
h2ocube_rails_tasks-0.0.9 lib/h2ocube_rails_tasks/tasks/unicorn.rb
h2ocube_rails_tasks-0.0.8 lib/h2ocube_rails_tasks/tasks/unicorn.rb
h2ocube_rails_tasks-0.0.7 lib/h2ocube_rails_tasks/tasks/unicorn.rb
h2ocube_rails_tasks-0.0.6 lib/h2ocube_rails_tasks/tasks/unicorn.rb
h2ocube_rails_tasks-0.0.5 lib/h2ocube_rails_tasks/tasks/unicorn.rb
h2ocube_rails_tasks-0.0.4 lib/h2ocube_rails_tasks/tasks/unicorn.rb
h2ocube_rails_tasks-0.0.3 lib/h2ocube_rails_tasks/tasks/unicorn.rb
h2ocube_rails_tasks-0.0.2 lib/h2ocube_rails_tasks/tasks/unicorn.rb
h2ocube_rails_tasks-0.0.1 lib/h2ocube_rails_tasks/tasks/unicorn.rb
zfben_rails_rake-0.0.23 lib/zfben_rails_rake/tasks/unicorn.rb
zfben_rails_rake-0.0.22 lib/zfben_rails_rake/tasks/unicorn.rb