Sha256: 4190a8155a430f3d1ce961a6903425c7cc66170aa86431507310eeed2dd7c1d1

Contents?: true

Size: 745 Bytes

Versions: 1

Compression:

Stored size: 745 Bytes

Contents

require_relative 'task_helper'

namespace :dad do
  namespace :nginx do

    desc I18n.t('nginx.install')
    task :install do
      run_itamae 'nginx/install'
    end

    desc 'Nginxにアプリの設定ファイルをインストールします。'
    task :config do
      @server_name = ENV['SERVER_NAME'] || ask('SERVER_NAME', :default => 'localhost', :required => true)
      @rails_env = rails_env(:default => 'production')
      app_conf = render File.join(File.dirname(__FILE__), 'nginx', 'app.conf.erb'),
          :to => "tmp/daddy/nginx/#{app_name}.conf"

      unless dry_run?
        run "sudo mkdir -p /etc/nginx/conf.d/servers",
            "sudo cp -f #{app_conf.path} /etc/nginx/conf.d/servers/"
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
daddy-0.5.14 lib/tasks/nginx.rake