capistrano-unicorn-nginx 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/capistrano/dsl/nginx_paths.rb +0 -4
- data/lib/capistrano/dsl/unicorn_paths.rb +0 -4
- data/lib/capistrano/tasks/nginx.rake +3 -4
- data/lib/capistrano/tasks/unicorn.rake +3 -4
- data/lib/capistrano/unicorn_nginx/helpers.rb +10 -3
- data/lib/capistrano/unicorn_nginx/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 7b24ca75112ef51965b402453911b78ad2464cb7
         | 
| 4 | 
            +
              data.tar.gz: dcf24a353ca4264baeed850c4869b29867ce4b81
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 9960a5da13b29a0be460ffc64b58b05344b129646771972258f4174a274ff317425d92ecd9ae5ded81922bf50a4180ec9e2ebc13537b1d394f28f6ac7aea55e2
         | 
| 7 | 
            +
              data.tar.gz: 3f67ac584a2ac65d6b85557b36b1ecfe3305405389935e61aba1b9267228a65489675bcd012c8d7d1a8fc35fc21ab293df8cd99b8c0102f4cab35b12243b5787
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    
| @@ -34,8 +34,7 @@ namespace :nginx do | |
| 34 34 | 
             
              task :setup do
         | 
| 35 35 | 
             
                on roles :web do
         | 
| 36 36 | 
             
                  next if file_exists? nginx_sites_available_file
         | 
| 37 | 
            -
                  template | 
| 38 | 
            -
                  sudo :mv, nginx_config_tmp_file, nginx_sites_available_file
         | 
| 37 | 
            +
                  sudo_upload! template('nginx_conf.erb'), nginx_sites_available_file
         | 
| 39 38 | 
             
                  sudo :ln, '-fs', nginx_sites_available_file, nginx_sites_enabled_file
         | 
| 40 39 | 
             
                end
         | 
| 41 40 | 
             
              end
         | 
| @@ -46,8 +45,8 @@ namespace :nginx do | |
| 46 45 | 
             
                on roles :web do
         | 
| 47 46 | 
             
                  next if file_exists?(nginx_ssl_cert_file) && file_exists?(nginx_ssl_cert_key_file)
         | 
| 48 47 | 
             
                  if fetch(:nginx_upload_local_cert)
         | 
| 49 | 
            -
                     | 
| 50 | 
            -
                     | 
| 48 | 
            +
                    sudo_upload! fetch(:nginx_ssl_cert_local_path), nginx_ssl_cert_file
         | 
| 49 | 
            +
                    sudo_upload! fetch(:nginx_ssl_cert_key_local_path), nginx_ssl_cert_key_file
         | 
| 51 50 | 
             
                  end
         | 
| 52 51 | 
             
                  sudo :chown, 'root:root', nginx_ssl_cert_file
         | 
| 53 52 | 
             
                  sudo :chown, 'root:root', nginx_ssl_cert_key_file
         | 
| @@ -29,9 +29,8 @@ namespace :unicorn do | |
| 29 29 | 
             
              task :setup_initializer do
         | 
| 30 30 | 
             
                on roles :app do
         | 
| 31 31 | 
             
                  next if file_exists? unicorn_initd_file
         | 
| 32 | 
            -
                  template | 
| 33 | 
            -
                  execute :chmod, '+x',  | 
| 34 | 
            -
                  sudo :mv, unicorn_initd_tmp_file, unicorn_initd_file
         | 
| 32 | 
            +
                  sudo_upload! template('unicorn_init.erb'), unicorn_initd_file
         | 
| 33 | 
            +
                  execute :chmod, '+x', unicorn_initd_file
         | 
| 35 34 | 
             
                  sudo 'update-rc.d', '-f', fetch(:unicorn_service), 'defaults'
         | 
| 36 35 | 
             
                end
         | 
| 37 36 | 
             
              end
         | 
| @@ -40,7 +39,7 @@ namespace :unicorn do | |
| 40 39 | 
             
              task :setup_app_config do
         | 
| 41 40 | 
             
                on roles :app do
         | 
| 42 41 | 
             
                  next if file_exists? fetch(:unicorn_config)
         | 
| 43 | 
            -
                  template | 
| 42 | 
            +
                  upload! template('unicorn.rb.erb'), fetch(:unicorn_config)
         | 
| 44 43 | 
             
                end
         | 
| 45 44 | 
             
              end
         | 
| 46 45 |  | 
| @@ -8,14 +8,13 @@ module Capistrano | |
| 8 8 | 
             
                    SSHKit::Command.new(:bundle, :exec, :unicorn, args).to_command
         | 
| 9 9 | 
             
                  end
         | 
| 10 10 |  | 
| 11 | 
            -
                  def template(template_name | 
| 11 | 
            +
                  def template(template_name)
         | 
| 12 12 | 
             
                    config_file = "#{fetch(:templates_path)}/#{template_name}"
         | 
| 13 13 | 
             
                    # if no customized file, proceed with default
         | 
| 14 14 | 
             
                    unless File.exists?(config_file)
         | 
| 15 15 | 
             
                      config_file = File.join(File.dirname(__FILE__), "../../generators/capistrano/unicorn_nginx/templates/#{template_name}")
         | 
| 16 16 | 
             
                    end
         | 
| 17 | 
            -
                     | 
| 18 | 
            -
                    upload! config_stream, target
         | 
| 17 | 
            +
                    StringIO.new(ERB.new(File.read(config_file)).result(binding))
         | 
| 19 18 | 
             
                  end
         | 
| 20 19 |  | 
| 21 20 | 
             
                  def file_exists?(path)
         | 
| @@ -26,6 +25,14 @@ module Capistrano | |
| 26 25 | 
             
                    capture :id, '-un'
         | 
| 27 26 | 
             
                  end
         | 
| 28 27 |  | 
| 28 | 
            +
                  def sudo_upload!(from, to)
         | 
| 29 | 
            +
                    filename = File.basename(to)
         | 
| 30 | 
            +
                    to_dir = File.dirname(to)
         | 
| 31 | 
            +
                    tmp_file = "#{fetch(:tmp_dir)}/#{filename}"
         | 
| 32 | 
            +
                    upload! from, tmp_file
         | 
| 33 | 
            +
                    sudo :mv, tmp_file, to_dir
         | 
| 34 | 
            +
                  end
         | 
| 35 | 
            +
             | 
| 29 36 | 
             
                end
         | 
| 30 37 | 
             
              end
         | 
| 31 38 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: capistrano-unicorn-nginx
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.0. | 
| 4 | 
            +
              version: 1.0.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Bruno Sutic
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2014-03- | 
| 11 | 
            +
            date: 2014-03-30 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: capistrano
         |