Sha256: 1d397f43c5fe87f12c5e2140cb67682a17f36520400efa7cb64a71c1f548579e
Contents?: true
Size: 977 Bytes
Versions: 42
Compression:
Stored size: 977 Bytes
Contents
# coding: UTF-8 require 'rake' namespace :dad do namespace :unicorn do desc 'Unicornをインストールします。' task :install => :environment do rails_env = ENV['RAILS_ENV'] || Rails.env rails_root = ENV['RAILS_ROOT'] || Rails.root init_script = 'unicorn_' + YAML.load_file("config/database.yml")[Rails.env]['database'] commands = [ "RAILS_ENV=#{rails_env} RAILS_ROOT=#{rails_root} erb -T - #{File.dirname(__FILE__)}/unicorn.erb > tmp/#{init_script}", "RAILS_ENV=#{rails_env} RAILS_ROOT=#{rails_root} erb -T - #{File.dirname(__FILE__)}/unicorn.rb.erb > config/unicorn.rb", "sudo cp -f tmp/#{init_script} /etc/init.d/#{init_script}", "sudo chown root:root /etc/init.d/#{init_script}", "sudo chmod 755 /etc/init.d/#{init_script}", "sudo /sbin/chkconfig #{init_script} on", ] commands.each do |c| puts c fail unless system(c) end end end end
Version data entries
42 entries across 42 versions & 1 rubygems