foreman 0.29.0 → 0.30.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -115,7 +115,7 @@ private ######################################################################
115
115
  print "#{Time.now.strftime("%H:%M:%S")} #{pad_process_name(name)} | "
116
116
  print Term::ANSIColor.reset
117
117
  print message.chomp
118
- puts
118
+ puts ""
119
119
  end
120
120
 
121
121
  def print(message=nil)
@@ -27,9 +27,21 @@ class Foreman::Process
27
27
 
28
28
  private
29
29
 
30
+ def fork_with_io(command)
31
+ io = case RUBY_VERSION
32
+ when /^1\.9\./
33
+ IO.popen([Foreman.runner, replace_command_env(command)], "w+")
34
+ when /^1\.8\./
35
+ full_command = replace_command_env(command).gsub("'", "\\'")
36
+ IO.popen("#{Foreman.runner} '#{full_command}'", "w+")
37
+ else
38
+ raise "Unknown Ruby version: #{RUBY_VERSION}"
39
+ end
40
+ [ io, io.pid ]
41
+ end
42
+
30
43
  def run_process(command, pipe)
31
- io = IO.popen([Foreman.runner, replace_command_env(command)], "w+")
32
- @pid = io.pid
44
+ io, @pid = fork_with_io(command)
33
45
  trap("SIGTERM") { "got sigterm for %d" % @pid }
34
46
  output pipe, "started with pid %d" % @pid
35
47
  Thread.new do
@@ -1,5 +1,5 @@
1
1
  module Foreman
2
2
 
3
- VERSION = "0.29.0"
3
+ VERSION = "0.30.0"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,45 +1,59 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: foreman
3
- version: !ruby/object:Gem::Version
4
- version: 0.29.0
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 30
8
+ - 0
9
+ version: 0.30.0
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - David Dollar
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
- date: 2011-12-22 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: term-ansicolor
16
- requirement: &70244540418780 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
16
+
17
+ date: 2011-12-22 00:00:00 -05:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ version_requirements: &id001 !ruby/object:Gem::Requirement
22
+ requirements:
19
23
  - - ~>
20
- - !ruby/object:Gem::Version
24
+ - !ruby/object:Gem::Version
25
+ segments:
26
+ - 1
27
+ - 0
28
+ - 5
21
29
  version: 1.0.5
22
- type: :runtime
30
+ requirement: *id001
31
+ name: term-ansicolor
23
32
  prerelease: false
24
- version_requirements: *70244540418780
25
- - !ruby/object:Gem::Dependency
26
- name: thor
27
- requirement: &70244540415120 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: 0.13.6
33
33
  type: :runtime
34
+ - !ruby/object:Gem::Dependency
35
+ version_requirements: &id002 !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ segments:
40
+ - 0
41
+ - 13
42
+ - 6
43
+ version: 0.13.6
44
+ requirement: *id002
45
+ name: thor
34
46
  prerelease: false
35
- version_requirements: *70244540415120
47
+ type: :runtime
36
48
  description: Process manager for applications with multiple components
37
49
  email: ddollar@gmail.com
38
- executables:
50
+ executables:
39
51
  - foreman
40
52
  extensions: []
53
+
41
54
  extra_rdoc_files: []
42
- files:
55
+
56
+ files:
43
57
  - bin/foreman
44
58
  - bin/runner
45
59
  - data/example/error
@@ -91,35 +105,35 @@ files:
91
105
  - spec/resources/export/upstart/app-bravo.conf
92
106
  - spec/resources/export/upstart/app.conf
93
107
  - spec/spec_helper.rb
94
- - man/foreman.1
108
+ has_rdoc: true
95
109
  homepage: http://github.com/ddollar/foreman
96
110
  licenses: []
111
+
97
112
  post_install_message:
98
113
  rdoc_options: []
99
- require_paths:
114
+
115
+ require_paths:
100
116
  - lib
101
- required_ruby_version: !ruby/object:Gem::Requirement
102
- none: false
103
- requirements:
104
- - - ! '>='
105
- - !ruby/object:Gem::Version
106
- version: '0'
107
- segments:
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ segments:
108
122
  - 0
109
- hash: -705079765555919501
110
- required_rubygems_version: !ruby/object:Gem::Requirement
111
- none: false
112
- requirements:
113
- - - ! '>='
114
- - !ruby/object:Gem::Version
115
- version: '0'
116
- segments:
123
+ version: "0"
124
+ required_rubygems_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ segments:
117
129
  - 0
118
- hash: -705079765555919501
130
+ version: "0"
119
131
  requirements: []
132
+
120
133
  rubyforge_project:
121
- rubygems_version: 1.8.10
134
+ rubygems_version: 1.3.6
122
135
  signing_key:
123
136
  specification_version: 3
124
137
  summary: Process manager for applications with multiple components
125
138
  test_files: []
139
+
data/man/foreman.1 DELETED
@@ -1,218 +0,0 @@
1
- .\" generated with Ronn/v0.7.3
2
- .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
- .
4
- .TH "FOREMAN" "1" "November 2011" "Foreman 0.26.0" "Foreman Manual"
5
- .
6
- .SH "NAME"
7
- \fBforeman\fR \- manage Procfile\-based applications
8
- .
9
- .SH "SYNOPSIS"
10
- \fBforeman start [process]\fR
11
- .
12
- .br
13
- \fBforeman export <format> [location]\fR
14
- .
15
- .SH "DESCRIPTION"
16
- \fBForeman\fR is a manager for Procfile\-based applications\. Its aim is to abstract away the details of the Procfile format, and allow you to either run your application directly or export it to some other process management format\.
17
- .
18
- .SH "RUNNING"
19
- \fBforeman start\fR is used to run your application directly from the command line\.
20
- .
21
- .P
22
- If no additional parameters are passed, foreman will run one instance of each type of process defined in your Procfile\.
23
- .
24
- .P
25
- If a parameter is passed, foreman will run one instance of the specified application type\.
26
- .
27
- .P
28
- The following options control how the application is run:
29
- .
30
- .TP
31
- \fB\-c\fR, \fB\-\-concurrency\fR
32
- Specify the number of each process type to run\. The value passed in should be in the format \fBprocess=num,process=num\fR
33
- .
34
- .TP
35
- \fB\-p\fR, \fB\-\-port\fR
36
- Specify which port to use as the base for this application\. Should be a multiple of 1000\.
37
- .
38
- .SH "EXPORTING"
39
- \fBforeman export\fR is used to export your application to another process management format\.
40
- .
41
- .P
42
- An location to export can be passed as an argument\. This argument may be either required or optional depending on the export format\.
43
- .
44
- .P
45
- The following options control how the application is run:
46
- .
47
- .TP
48
- \fB\-a\fR, \fB\-\-app\fR
49
- Use this name rather than the application\'s root directory name as the name of the application when exporting\.
50
- .
51
- .TP
52
- \fB\-c\fR, \fB\-\-concurrency\fR
53
- Specify the number of each process type to run\. The value passed in should be in the format \fBprocess=num,process=num\fR
54
- .
55
- .TP
56
- \fB\-l\fR, \fB\-\-log\fR
57
- Specify the directory to place process logs in\.
58
- .
59
- .TP
60
- \fB\-p\fR, \fB\-\-port\fR
61
- Specify which port to use as the base for this application\. Should be a multiple of 1000\.
62
- .
63
- .TP
64
- \fB\-u\fR, \fB\-\-user\fR
65
- Specify the user the application should be run as\. Defaults to the app name
66
- .
67
- .SH "OPTIONS"
68
- These options control all modes of foreman\'s operation\.
69
- .
70
- .TP
71
- \fB\-e\fR, \fB\-\-env\fR
72
- Specify an alternate environment file\. You can specify more than one file by using: \fB\-\-env file1,file2\fR\.
73
- .
74
- .TP
75
- \fB\-f\fR, \fB\-\-procfile\fR
76
- Specify an alternate location for the application\'s Procfile\. This file\'s containing directory will be assumed to be the root directory of the application\.
77
- .
78
- .SH "EXPORT FORMATS"
79
- foreman currently supports the following output formats:
80
- .
81
- .IP "\(bu" 4
82
- bluepill
83
- .
84
- .IP "\(bu" 4
85
- inittab
86
- .
87
- .IP "\(bu" 4
88
- runit
89
- .
90
- .IP "\(bu" 4
91
- upstart
92
- .
93
- .IP "" 0
94
- .
95
- .SH "INITTAB EXPORT"
96
- Will export a chunk of inittab\-compatible configuration:
97
- .
98
- .IP "" 4
99
- .
100
- .nf
101
-
102
- # \-\-\-\-\- foreman example processes \-\-\-\-\-
103
- EX01:4:respawn:/bin/su \- example \-c \'PORT=5000 bundle exec thin start >> /var/log/web\-1\.log 2>&1\'
104
- EX02:4:respawn:/bin/su \- example \-c \'PORT=5100 bundle exec rake jobs:work >> /var/log/job\-1\.log 2>&1\'
105
- # \-\-\-\-\- end foreman example processes \-\-\-\-\-
106
- .
107
- .fi
108
- .
109
- .IP "" 0
110
- .
111
- .SH "UPSTART EXPORT"
112
- Will create a series of upstart scripts in the location you specify\. Scripts will be structured to make the following commands valid:
113
- .
114
- .P
115
- \fBstart appname\fR
116
- .
117
- .P
118
- \fBstop appname\-processname\fR
119
- .
120
- .P
121
- \fBrestart appname\-processname\-3\fR
122
- .
123
- .SH "PROCFILE"
124
- A Procfile should contain both a name for the process and the command used to run it\.
125
- .
126
- .IP "" 4
127
- .
128
- .nf
129
-
130
- web: bundle exec thin start
131
- job: bundle exec rake jobs:work
132
- .
133
- .fi
134
- .
135
- .IP "" 0
136
- .
137
- .P
138
- A process name may contain letters, numbers amd the underscore character\. You can validate your Procfile format using the \fBcheck\fR command:
139
- .
140
- .IP "" 4
141
- .
142
- .nf
143
-
144
- $ foreman check
145
- .
146
- .fi
147
- .
148
- .IP "" 0
149
- .
150
- .SH "ENVIRONMENT"
151
- If a \fB\.env\fR file exists in the current directory, the default environment will be read from it\. This file should contain key/value pairs, separated by \fB=\fR, with one key/value pair per line\.
152
- .
153
- .IP "" 4
154
- .
155
- .nf
156
-
157
- FOO=bar
158
- BAZ=qux
159
- .
160
- .fi
161
- .
162
- .IP "" 0
163
- .
164
- .SH "DEFAULT OPTIONS"
165
- If a \fB\.foreman\fR file exists in the current directory, default options will be read from it\. This file should be in YAML format with the long option name as keys\. Example:
166
- .
167
- .IP "" 4
168
- .
169
- .nf
170
-
171
- concurrency: alpha=0,bravo=1
172
- port: 15000
173
- .
174
- .fi
175
- .
176
- .IP "" 0
177
- .
178
- .SH "EXAMPLES"
179
- Start one instance of each process type, interleave the output on stdout:
180
- .
181
- .IP "" 4
182
- .
183
- .nf
184
-
185
- $ foreman start
186
- .
187
- .fi
188
- .
189
- .IP "" 0
190
- .
191
- .P
192
- Export the application in upstart format:
193
- .
194
- .IP "" 4
195
- .
196
- .nf
197
-
198
- $ foreman export upstart /etc/init
199
- .
200
- .fi
201
- .
202
- .IP "" 0
203
- .
204
- .P
205
- Run one process type from the application defined in a specific Procfile:
206
- .
207
- .IP "" 4
208
- .
209
- .nf
210
-
211
- $ foreman start alpha \-p ~/myapp/Procfile
212
- .
213
- .fi
214
- .
215
- .IP "" 0
216
- .
217
- .SH "COPYRIGHT"
218
- Foreman is Copyright (C) 2010 David Dollar \fIhttp://daviddollar\.org\fR