Sha256: 07850bcf2755dfa337850393083278cc373711805c85b9d79db487acfd05f667

Contents?: true

Size: 1.51 KB

Versions: 5

Compression:

Stored size: 1.51 KB

Contents

namespace :load do

  task :defaults do
    set :eye_config, -> { "config/eye.yml" }
    set :eye_bin, -> { "eye-patch" }
    set :eye_roles, -> { :app }
    set :eye_env, -> { {} }

    set :rvm_map_bins, fetch(:rvm_map_bins, []).push(fetch(:eye_bin))
    set :rbenv_map_bins, fetch(:rbenv_map_bins, []).push(fetch(:eye_bin))
    set :bundle_bins, fetch(:bundle_bins, []).push(fetch(:eye_bin))
  end
end

namespace :eye do

  desc "Start eye with the desired configuration file"
  task :load_config do
    on roles(fetch(:eye_roles)) do
      within current_path do
        with fetch(:eye_env) do
          execute fetch(:eye_bin), "quit"
          execute fetch(:eye_bin), "load #{fetch(:eye_config)}"
        end
      end
    end
  end

  desc "Start eye with the desired configuration file"
  task :start, :load_config

  desc "Stop eye and all of its monitored tasks"
  task :stop do
    on roles(fetch(:eye_roles)) do
      within current_path do
        with fetch(:eye_env) do
          execute fetch(:eye_bin), "stop all"
          execute fetch(:eye_bin), "quit"
        end
      end
    end
  end

  desc "Restart all tasks monitored by eye"
  task restart: :load_config do
    on roles(fetch(:eye_roles)) do
      within current_path do
        with fetch(:eye_env) do
          execute fetch(:eye_bin), "restart all"
        end
      end
    end
  end
end

if fetch(:eye_default_hooks, true)
  after "deploy:publishing", "deploy:restart"

  namespace :deploy do
    task :restart do
      invoke "eye:restart"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
eye-patch-0.5.1 lib/eye/patch/capistrano3.rb
eye-patch-0.5.0 lib/eye/patch/capistrano3.rb
eye-patch-0.4.2 lib/eye/patch/capistrano3.rb
eye-patch-0.4.1 lib/eye/patch/capistrano3.rb
eye-patch-0.4.0 lib/eye/patch/capistrano3.rb