Sha256: 03435fb73f91ad341477a678e7f670644eeac1f450d5febca0338355dd00133c

Contents?: true

Size: 792 Bytes

Versions: 7

Compression:

Stored size: 792 Bytes

Contents

require_relative 'task_helper'

namespace :dad do
  namespace :unicorn do

    desc 'Unicornの設定を行います。'
    task :config => :environment do
      config = File.join('tmp', 'unicorn', 'unicorn.rb')
      render File.join(File.dirname(__FILE__), 'unicorn', 'unicorn.rb.erb'), :to => config
      run "cp -f #{config} config/"

      init_script = File.join('tmp', 'unicorn', "unicorn_#{app_name}")
      render File.join(File.dirname(__FILE__), 'unicorn', 'unicorn.erb'), :to => init_script

      run "sudo cp -f #{init_script} /etc/init.d/",
          "sudo chown root:root /etc/init.d/#{File.basename(init_script)}",
          "sudo chmod 755 /etc/init.d/#{File.basename(init_script)}",
          "sudo /sbin/chkconfig #{File.basename(init_script)} on"
    end  

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
daddy-0.3.27 lib/tasks/unicorn.rake
daddy-0.3.26 lib/tasks/unicorn.rake
daddy-0.3.25 lib/tasks/unicorn.rake
daddy-0.3.24 lib/tasks/unicorn.rake
daddy-0.3.23 lib/tasks/unicorn.rake
daddy-0.3.22 lib/tasks/unicorn.rake
daddy-0.3.21 lib/tasks/unicorn.rake