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.2.10 lib/pushapp/tasks/nginx_export.rb
pushapp-0.2.9 lib/pushapp/tasks/nginx_export.rb
pushapp-0.2.8 lib/pushapp/tasks/nginx_export.rb
pushapp-0.2.7 lib/pushapp/tasks/nginx_export.rb
pushapp-0.2.6 lib/pushapp/tasks/nginx_export.rb
pushapp-0.2.5 lib/pushapp/tasks/nginx_export.rb
pushapp-0.2.4 lib/pushapp/tasks/nginx_export.rb
pushapp-0.2.3 lib/pushapp/tasks/nginx_export.rb
pushapp-0.2.2 lib/pushapp/tasks/nginx_export.rb
pushapp-0.2.1 lib/pushapp/tasks/nginx_export.rb
pushapp-0.2.0 lib/pushapp/tasks/nginx_export.rb
pushapp-0.1.9 lib/pushapp/tasks/nginx_export.rb
pushapp-0.1.8 lib/pushapp/tasks/nginx_export.rb
pushapp-0.1.7 lib/pushapp/tasks/nginx_export.rb
pushapp-0.1.6 lib/pushapp/tasks/nginx_export.rb
pushapp-0.1.5 lib/pushapp/tasks/nginx_export.rb
pushapp-0.1.4 lib/pushapp/tasks/nginx_export.rb
pushapp-0.1.3 lib/pushapp/tasks/nginx_export.rb
pushapp-0.1.2 lib/pushapp/tasks/nginx_export.rb
pushapp-0.1.1 lib/pushapp/tasks/nginx_export.rb