Sha256: e02e4651ad6e160ec63e8bf53cf306cb3bc13dd112e514f0f240530ed115fbfa

Contents?: true

Size: 584 Bytes

Versions: 7

Compression:

Stored size: 584 Bytes

Contents

namespace :nginx do
  %w(start stop restart reload).each do |task_name|
    desc "#{task } Nginx"
    task task_name do
      on roles(:app), in: :sequence, wait: 5 do
        sudo "/etc/init.d/nginx #{task_name}"
      end
    end
  end

  desc "Remove default Nginx Virtual Host"
  task "remove_default_vhost" do 
    on roles(:app) do
      if test("[ -f /etc/nginx/sites-enabled/default ]")
      sudo "rm /etc/nginx/sites-enabled/default"
      puts "removed default Nginx Virtualhost"
      else
        puts "No default Nginx Virtualhost to remove"
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
meataxe-0.5.0 lib/meataxe/capistrano/tasks/nginx.cap
capistrano-cookbook-0.2.1 lib/capistrano/cookbook/tasks/nginx.cap
capistrano-cookbook-0.2.0 lib/capistrano/cookbook/tasks/nginx.cap
capistrano-cookbook-0.0.5 lib/capistrano/cookbook/tasks/nginx.cap
capistrano-cookbook-0.0.4 lib/capistrano/cookbook/tasks/nginx.cap
capistrano-cookbook-0.0.3 lib/capistrano/cookbook/tasks/nginx.cap
capistrano-cookbook-0.0.2 lib/capistrano/cookbook/tasks/nginx.cap