foreman 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -43,6 +43,9 @@ The following options control how the application is run:
43
43
  Use this name rather than the application's root directory name as the
44
44
  name of the application when exporting.
45
45
 
46
+ * `-l`, `--log`:
47
+ Specify the directory to place process logs in.
48
+
46
49
  * `-c`, `--concurrency`:
47
50
  Specify the number of each process type to run. The value passed in
48
51
  should be in the format `process=num,process=num`
@@ -1,8 +1,8 @@
1
1
  pre-start script
2
2
 
3
3
  bash << "EOF"
4
- mkdir -p /var/log/<%= app %>
5
- chown -R <%= user %> /var/log/<%= app %>
4
+ mkdir -p <%= log_root %>/<%= app %>
5
+ chown -R <%= user %> <%= log_root %>/<%= app %>
6
6
  EOF
7
7
 
8
8
  end script
@@ -3,4 +3,4 @@ stop on stopping <%= app %>-<%= process.name %>
3
3
  respawn
4
4
 
5
5
  chdir <%= engine.directory %>
6
- exec su <%= user %> -c "<%= process.command %> >> /var/log/<%=app%>/<%=process.name%>-<%=num%>.log 2>&1"
6
+ exec su <%= user %> -c "<%= process.command %> >> <%= log_root %>/<%=app%>/<%=process.name%>-<%=num%>.log 2>&1"
data/lib/foreman.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Foreman
2
2
 
3
- VERSION = "0.4.5"
3
+ VERSION = "0.4.6"
4
4
 
5
5
  class AppDoesNotExist < Exception; end
6
6
 
data/lib/foreman/cli.rb CHANGED
@@ -26,6 +26,7 @@ class Foreman::CLI < Thor
26
26
  desc "export FORMAT LOCATION", "Export the application to another process management format"
27
27
 
28
28
  method_option :app, :type => :string, :aliases => "-a"
29
+ method_option :log, :type => :string, :aliases => "-l"
29
30
  method_option :user, :type => :string, :aliases => "-u"
30
31
  method_option :concurrency, :type => :string, :aliases => "-c",
31
32
  :banner => '"alpha=5,bar=3"'
@@ -41,6 +42,7 @@ class Foreman::CLI < Thor
41
42
  formatter.new(engine).export(location,
42
43
  :name => options[:app],
43
44
  :user => options[:user],
45
+ :log => options[:log],
44
46
  :concurrency => options[:concurrency]
45
47
  )
46
48
  rescue Foreman::Export::Exception => ex
@@ -5,7 +5,9 @@ class Foreman::Export::Inittab < Foreman::Export::Base
5
5
  def export(fname=nil, options={})
6
6
  app = options[:app] || File.basename(engine.directory)
7
7
  user = options[:user] || app
8
- log_dir = "/var/log/#{app}"
8
+ log_root = options[:log] || "/var/log"
9
+
10
+ log_dir = "#{log_root}/#{app}"
9
11
 
10
12
  concurrency = parse_concurrency(options[:concurrency])
11
13
 
@@ -10,6 +10,7 @@ class Foreman::Export::Upstart < Foreman::Export::Base
10
10
 
11
11
  app = options[:app] || File.basename(engine.directory)
12
12
  user = options[:user] || app
13
+ log_root = options[:log] || "/var/log"
13
14
 
14
15
  Dir["#{location}/#{app}*.conf"].each do |file|
15
16
  say "cleaning up: #{file}"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 5
10
- version: 0.4.5
9
+ - 6
10
+ version: 0.4.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Dollar