lib/negroku/tasks/eye.rake in negroku-2.0.0.pre7 vs lib/negroku/tasks/eye.rake in negroku-2.0.0
- old
+ new
@@ -10,10 +10,14 @@
## eye template variables
# Local path to look for custom config template
set :eye_application_template, -> { "config/deploy/#{fetch(:stage)}/eye.rb.erb" }
+ # Application level notifications
+ set :eye_notification_contact, -> { :monitor }
+ set :eye_notification_level, -> { :error }
+
# Add eye to :rbenv_map_bins
fetch(:rbenv_map_bins) << 'eye'
end
end
@@ -21,32 +25,24 @@
namespace :eye do
desc "Loads eye config and starts monitoring"
task :load do
on release_roles fetch(:eye_roles) do
- within "#{current_path}" do
+ within current_path do
execute :eye, :load, "#{shared_path}/config/eye.rb"
end
end
end
[:start,:restart, :info, :stop].each do |cmd|
- # Single process
- desc "Calls eye's #{cmd.to_s} on a process"
- task "#{cmd}:process", [:name] do |t, args|
- on release_roles fetch(:eye_roles) do
- within "#{current_path}" do
- execute :eye, cmd, "#{args[:name]}"
- end
- end
- end
- #
desc "Calls eye's #{cmd.to_s} on the whole app"
- task cmd do |t, args|
+ task cmd, [:mask] do |t, args|
on release_roles fetch(:eye_roles) do
- within "#{current_path}" do
- execute :eye, cmd, "#{fetch(:application)}"
+ within current_path do
+ mask = fetch(:application)
+ mask += ":#{args[:mask]}" if args[:mask]
+ execute :eye, cmd, mask
end
end
end
end
end
@@ -56,11 +52,11 @@
namespace :negroku do
namespace :eye do
desc "Upload eye configuration file"
- task :setup do
+ task :setup => 'eye:watch_process' do
on release_roles fetch(:eye_roles) do
within "#{shared_path}/config" do
processes = fetch(:eye_watched_processes, {})
template_path = fetch(:eye_application_template)
@@ -76,10 +72,10 @@
execute :mv, '/tmp/application.eye', 'eye.rb'
end
end
end
- after "deploy:published", "negroku:eye:setup"
+ before "deploy:published", "negroku:eye:setup"
after "negroku:eye:setup", "eye:load"
define_logs(:eye, {
app: 'eye.log'
})