[build] update gulp debug logger

This commit is contained in:
2017-12-20 17:53:58 +03:00
parent 69c2b735a0
commit 6345ddcd19
17 changed files with 212 additions and 77 deletions

52
config/service.rb Normal file
View File

@@ -0,0 +1,52 @@
module Service
class Manager
def initialize(env)
@env = env
end
def execute(action, command)
Airbrussh.configure do |config|
config.command_output = true
end
service_role = "service_role_#{action}".to_sym
role = fetch(service_role)
on roles(role) do
execute :sudo, "/bin/systemctl #{command} #{action}"
end
end
end
end
services = %w{tankz}
namespace :service do
task :restart, :param do |task, args|
services = args[:param] ? [args[:param]] : services
services.each { |service|
Service::Manager.new(self).execute(service, 'restart')
}
end
task :stop, :param do |task, args|
services = args[:param] ? [args[:param]] : services
services.each { |service|
Service::Manager.new(self).execute(service, 'stop')
}
end
task :start, :param do |task, args|
services = args[:param] ? [args[:param]] : services
services.each { |service|
Service::Manager.new(self).execute(service, 'start')
}
end
task :status, :param do |task, args|
services = args[:param] ? [args[:param]] : services
services.each { |service|
Service::Manager.new(self).execute(service, 'status')
}
end
end
set :service_role_tankz, :app