support -l to export for specifying log root
This commit is contained in:
@@ -26,6 +26,7 @@ class Foreman::CLI < Thor
|
||||
desc "export FORMAT LOCATION", "Export the application to another process management format"
|
||||
|
||||
method_option :app, :type => :string, :aliases => "-a"
|
||||
method_option :log, :type => :string, :aliases => "-l"
|
||||
method_option :user, :type => :string, :aliases => "-u"
|
||||
method_option :concurrency, :type => :string, :aliases => "-c",
|
||||
:banner => '"alpha=5,bar=3"'
|
||||
@@ -41,6 +42,7 @@ class Foreman::CLI < Thor
|
||||
formatter.new(engine).export(location,
|
||||
:name => options[:app],
|
||||
:user => options[:user],
|
||||
:log => options[:log],
|
||||
:concurrency => options[:concurrency]
|
||||
)
|
||||
rescue Foreman::Export::Exception => ex
|
||||
|
||||
@@ -5,7 +5,9 @@ class Foreman::Export::Inittab < Foreman::Export::Base
|
||||
def export(fname=nil, options={})
|
||||
app = options[:app] || File.basename(engine.directory)
|
||||
user = options[:user] || app
|
||||
log_dir = "/var/log/#{app}"
|
||||
log_root = options[:log] || "/var/log"
|
||||
|
||||
log_dir = "#{log_root}/#{app}"
|
||||
|
||||
concurrency = parse_concurrency(options[:concurrency])
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ class Foreman::Export::Upstart < Foreman::Export::Base
|
||||
|
||||
app = options[:app] || File.basename(engine.directory)
|
||||
user = options[:user] || app
|
||||
log_root = options[:log] || "/var/log"
|
||||
|
||||
Dir["#{location}/#{app}*.conf"].each do |file|
|
||||
say "cleaning up: #{file}"
|
||||
|
||||
Reference in New Issue
Block a user