Sha256: 27c9fdd7f9154917218d00231235a41dace4a243e259bd1cf13af897dab8bf8a

Contents?: true

Size: 875 Bytes

Versions: 8

Compression:

Stored size: 875 Bytes

Contents

git_plugin = self

namespace :puma do
  desc 'Setup nginx configuration'
  task :nginx_config do
    on roles(fetch(:puma_nginx, :web)) do |role|
      git_plugin.puma_switch_user(role) do
        git_plugin.template_puma('nginx_conf', "/tmp/nginx_#{fetch(:nginx_config_name)}", role)
        sudo :mv, "/tmp/nginx_#{fetch(:nginx_config_name)} #{fetch(:nginx_sites_available_path)}/#{fetch(:nginx_config_name)}"
        sudo :ln, '-fs', "#{fetch(:nginx_sites_available_path)}/#{fetch(:nginx_config_name)} #{fetch(:nginx_sites_enabled_path)}/#{fetch(:nginx_config_name)}"
      end
    end
  end

  desc 'Generate nginx configuration locally'
  task :generate_nginx_config_locally do
    fake_role = Struct.new(:hostname)
    run_locally do
      File.write('nginx.conf', git_plugin.compiled_template_puma("nginx_conf", fake_role.new("example.com")).string)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
capistrano3-puma-6.0.0.beta.1 lib/capistrano/tasks/nginx.rake
capistrano3-puma-6.0.0.alpha.4 lib/capistrano/tasks/nginx.rake
capistrano3-puma-6.0.0.alpha.3 lib/capistrano/tasks/nginx.rake
capistrano3-puma-6.0.0.alpha.2 lib/capistrano/tasks/nginx.rake
capistrano3-puma-6.0.0.alpha.1 lib/capistrano/tasks/nginx.rake
capistrano3-puma-5.2.0 lib/capistrano/tasks/nginx.rake
capistrano3-puma-5.1.1 lib/capistrano/tasks/nginx.rake
capistrano3-puma-5.1.0 lib/capistrano/tasks/nginx.rake