Sha256: 04862fcb3bfb6c17900898e97c97cb19d7a647311f4fc64b1ea9365bd1ab58f4

Contents?: true

Size: 660 Bytes

Versions: 24

Compression:

Stored size: 660 Bytes

Contents

require 'pushapp/tasks/base'

module Pushapp
  module Tasks
    class NginxExport < Base
      def run
        system "#{sudo} cp #{nginx_conf} #{nginx_sites}"

        unless options[:nginx_skip_reload]
          system "#{sudo} /etc/init.d/nginx reload"
        end
      end

      register_as :nginx_export

      private

      def nginx_conf
        options[:nginx_conf] || find_nginx_conf
      end

      def nginx_sites
        options[:nginx_sites] || '/etc/nginx/sites-enabled'
      end

      def find_nginx_conf
        file = "config/deploys/#{app_name_from_path}.nginx.conf"
        return file if File.exists?(file)
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
pushapp-0.1.0 lib/pushapp/tasks/nginx_export.rb
pushapp-0.0.6 lib/pushapp/tasks/nginx_export.rb
pushapp-0.0.5 lib/pushapp/tasks/nginx_export.rb
pushapp-0.0.4 lib/pushapp/tasks/nginx_export.rb