overman 0.87.3 → 0.88.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -15
- data/lib/foreman/cli.rb +7 -2
- data/lib/foreman/engine/cli.rb +2 -2
- data/lib/foreman/export/base.rb +7 -8
- data/lib/foreman/procfile.rb +8 -2
- data/lib/foreman/vendor/thor/lib/thor/line_editor/readline.rb +5 -5
- data/lib/foreman/version.rb +1 -1
- data/man/overman.1 +8 -111
- data/spec/foreman/cli_spec.rb +5 -5
- data/spec/foreman/export/daemon_spec.rb +1 -1
- data/spec/foreman/export/upstart_spec.rb +1 -1
- data/spec/foreman/process_spec.rb +0 -1
- data/spec/foreman/procfile_spec.rb +8 -0
- data/spec/spec_helper.rb +17 -4
- metadata +5 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 828a70837c20d213185724cba5c6b4702b37e4bfc96cf8516770476018e10730
|
4
|
+
data.tar.gz: 4a8db098531760ea4c68907b21fb511a824ee09258eef6e6dfd47da6d0102340
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45249bb47e28383d07c9dc4aef53c4986e467be76b2e7df55ab97104a1d1a29fbd433b5de8c78b4e26b5ee5cf9ffd7871e687d5549f0b0352378c177cdfda5eb
|
7
|
+
data.tar.gz: 4d0ed5f17ae9ac2c5db6bfd530ed28844a6342d97b7e65db3914541344290a89b1bb1fd82853a604400c57e3af9452eea6fd25fdcafbd54c84465b25fd923fff
|
data/README.md
CHANGED
@@ -8,11 +8,11 @@ Manage Procfile-based applications
|
|
8
8
|
|
9
9
|
$ gem install overman
|
10
10
|
|
11
|
-
Ruby users should take care
|
11
|
+
Ruby users should take care _not_ to install foreman in their project's `Gemfile`. See this [wiki article](https://github.com/ddollar/foreman/wiki/Don't-Bundle-Foreman) for more details.
|
12
12
|
|
13
13
|
## Getting Started
|
14
14
|
|
15
|
-
|
15
|
+
- http://blog.daviddollar.org/2011/05/06/introducing-foreman.html
|
16
16
|
|
17
17
|
## Supported Ruby versions
|
18
18
|
|
@@ -20,29 +20,31 @@ See [ci.yml](.github/workflows/ci.yml) for a list of Ruby versions against which
|
|
20
20
|
|
21
21
|
## Documentation
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
- [man page](http://ddollar.github.io/foreman/)
|
24
|
+
- [wiki](https://github.com/ddollar/foreman/wiki)
|
25
|
+
- [changelog](https://github.com/ddollar/foreman/blob/main/Changelog.md)
|
26
26
|
|
27
27
|
## Ports
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
29
|
+
- [forego](https://github.com/ddollar/forego) - Go
|
30
|
+
- [node-foreman](https://github.com/strongloop/node-foreman) - Node.js
|
31
|
+
- [gaffer](https://github.com/jingweno/gaffer) - Java/JVM
|
32
|
+
- [goreman](https://github.com/mattn/goreman) - Go
|
33
|
+
- [honcho](https://github.com/nickstenning/honcho) - python
|
34
|
+
- [proclet](https://github.com/kazeburo/Proclet) - Perl
|
35
|
+
- [shoreman](https://github.com/chrismytton/shoreman) - shell
|
36
|
+
- [crank](https://github.com/arktisklada/crank) - Crystal
|
37
|
+
- [houseman](https://github.com/fujimura/houseman) - Haskell
|
38
|
+
- [spm](https://github.com/bytegust/spm) - Go
|
39
39
|
|
40
40
|
## Authors
|
41
41
|
|
42
42
|
#### Created and maintained by
|
43
|
+
|
43
44
|
David Dollar
|
44
45
|
|
45
46
|
#### Patches contributed by
|
47
|
+
|
46
48
|
[Contributor List](https://github.com/ddollar/foreman/contributors)
|
47
49
|
|
48
50
|
## License
|
data/lib/foreman/cli.rb
CHANGED
@@ -40,6 +40,8 @@ class Foreman::CLI < Foreman::Thor
|
|
40
40
|
engine.load_procfile(procfile)
|
41
41
|
engine.options[:formation] = "#{process}=1" if process
|
42
42
|
engine.start
|
43
|
+
rescue Foreman::Procfile::EmptyFileError
|
44
|
+
error "no processes defined"
|
43
45
|
end
|
44
46
|
|
45
47
|
desc "export FORMAT LOCATION", "Export the application to another process management format"
|
@@ -60,7 +62,7 @@ class Foreman::CLI < Foreman::Thor
|
|
60
62
|
engine.load_procfile(procfile)
|
61
63
|
formatter = Foreman::Export.formatter(format)
|
62
64
|
formatter.new(location, engine, options).export
|
63
|
-
rescue Foreman::Export::Exception => ex
|
65
|
+
rescue Foreman::Export::Exception, Foreman::Procfile::EmptyFileError => ex
|
64
66
|
error ex.message
|
65
67
|
end
|
66
68
|
|
@@ -69,8 +71,9 @@ class Foreman::CLI < Foreman::Thor
|
|
69
71
|
def check
|
70
72
|
check_procfile!
|
71
73
|
engine.load_procfile(procfile)
|
72
|
-
error "no processes defined" unless engine.processes.length > 0
|
73
74
|
puts "valid procfile detected (#{engine.process_names.join(', ')})"
|
75
|
+
rescue Foreman::Procfile::EmptyFileError
|
76
|
+
error "no processes defined"
|
74
77
|
end
|
75
78
|
|
76
79
|
desc "run COMMAND [ARGS...]", "Run a command using your application's environment"
|
@@ -105,6 +108,8 @@ class Foreman::CLI < Foreman::Thor
|
|
105
108
|
Process.wait(pid)
|
106
109
|
exit $?.exitstatus || 0
|
107
110
|
rescue Interrupt
|
111
|
+
rescue Foreman::Procfile::EmptyFileError
|
112
|
+
error "no processes defined"
|
108
113
|
end
|
109
114
|
|
110
115
|
desc "version", "Display Foreman gem version"
|
data/lib/foreman/engine/cli.rb
CHANGED
@@ -49,7 +49,7 @@ class Foreman::Engine::CLI < Foreman::Engine
|
|
49
49
|
|
50
50
|
def startup
|
51
51
|
@colors = map_colors
|
52
|
-
proctitle "foreman:
|
52
|
+
proctitle "foreman: main" unless Foreman.windows?
|
53
53
|
Color.enable($stdout, options[:color])
|
54
54
|
end
|
55
55
|
|
@@ -77,7 +77,7 @@ private
|
|
77
77
|
@name_padding ||= begin
|
78
78
|
index_padding = @names.values.map { |n| formation[n] }.max.to_s.length + 1
|
79
79
|
name_padding = @names.values.map { |n| n.length + index_padding }.sort.last
|
80
|
-
[ 6, name_padding ].max
|
80
|
+
[ 6, name_padding.to_i ].max
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
data/lib/foreman/export/base.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require "foreman/export"
|
2
|
-
require "ostruct"
|
3
2
|
require "pathname"
|
4
3
|
require "shellwords"
|
5
4
|
|
@@ -35,7 +34,7 @@ class Foreman::Export::Base
|
|
35
34
|
def @engine.procfile
|
36
35
|
Foreman::Export::Base.warn_deprecation!
|
37
36
|
@processes.map do |process|
|
38
|
-
|
37
|
+
Struct.new(
|
39
38
|
:name => @names[process],
|
40
39
|
:process => process
|
41
40
|
)
|
@@ -74,8 +73,8 @@ private ######################################################################
|
|
74
73
|
puts "WARNING: Using deprecated exporter interface. Please update your exporter"
|
75
74
|
puts "the interface shown in the upstart exporter:"
|
76
75
|
puts
|
77
|
-
puts "https://github.com/ddollar/foreman/blob/
|
78
|
-
puts "https://github.com/ddollar/foreman/blob/
|
76
|
+
puts "https://github.com/ddollar/foreman/blob/main/lib/foreman/export/upstart.rb"
|
77
|
+
puts "https://github.com/ddollar/foreman/blob/main/data/export/upstart/process.conf.erb"
|
79
78
|
puts
|
80
79
|
@@deprecation_warned = true
|
81
80
|
end
|
@@ -83,7 +82,7 @@ private ######################################################################
|
|
83
82
|
def chown user, dir
|
84
83
|
FileUtils.chown user, nil, dir
|
85
84
|
rescue
|
86
|
-
error("Could not chown #{dir} to #{user}") unless File.writable?(dir) || ! File.
|
85
|
+
error("Could not chown #{dir} to #{user}") unless File.writable?(dir) || ! File.exist?(dir)
|
87
86
|
end
|
88
87
|
|
89
88
|
def error(message)
|
@@ -95,13 +94,13 @@ private ######################################################################
|
|
95
94
|
end
|
96
95
|
|
97
96
|
def clean(filename)
|
98
|
-
return unless File.
|
97
|
+
return unless File.exist?(filename)
|
99
98
|
say "cleaning up: #{filename}"
|
100
99
|
FileUtils.rm(filename)
|
101
100
|
end
|
102
101
|
|
103
102
|
def clean_dir(dirname)
|
104
|
-
return unless File.
|
103
|
+
return unless File.exist?(dirname)
|
105
104
|
say "cleaning up directory: #{dirname}"
|
106
105
|
FileUtils.rm_r(dirname)
|
107
106
|
end
|
@@ -130,7 +129,7 @@ private ######################################################################
|
|
130
129
|
matchers << File.join(options[:template], name_without_first) if options[:template]
|
131
130
|
matchers << File.expand_path("~/.foreman/templates/#{name}")
|
132
131
|
matchers << File.expand_path("../../../../data/export/#{name}", __FILE__)
|
133
|
-
File.read(matchers.detect { |m| File.
|
132
|
+
File.read(matchers.detect { |m| File.exist?(m) })
|
134
133
|
end
|
135
134
|
end
|
136
135
|
|
data/lib/foreman/procfile.rb
CHANGED
@@ -4,12 +4,14 @@ require "foreman"
|
|
4
4
|
#
|
5
5
|
# A valid Procfile entry is captured by this regex:
|
6
6
|
#
|
7
|
-
# /^([A-Za-z0-9_]+):\s*(.+)$/
|
7
|
+
# /^([A-Za-z0-9_-]+):\s*(.+)$/
|
8
8
|
#
|
9
9
|
# All other lines are ignored.
|
10
10
|
#
|
11
11
|
class Foreman::Procfile
|
12
12
|
|
13
|
+
EmptyFileError = Class.new(StandardError)
|
14
|
+
|
13
15
|
# Initialize a Procfile
|
14
16
|
#
|
15
17
|
# @param [String] filename (nil) An optional filename to read from
|
@@ -60,7 +62,11 @@ class Foreman::Procfile
|
|
60
62
|
# @param [String] filename The filename of the +Procfile+ to load
|
61
63
|
#
|
62
64
|
def load(filename)
|
63
|
-
|
65
|
+
parse_data = parse(filename)
|
66
|
+
|
67
|
+
raise EmptyFileError if parse_data.empty?
|
68
|
+
|
69
|
+
@entries.replace parse_data
|
64
70
|
end
|
65
71
|
|
66
72
|
# Save a Procfile to a file
|
@@ -1,12 +1,12 @@
|
|
1
|
-
begin
|
2
|
-
require "readline"
|
3
|
-
rescue LoadError
|
4
|
-
end
|
5
|
-
|
6
1
|
class Foreman::Thor
|
7
2
|
module LineEditor
|
8
3
|
class Readline < Basic
|
9
4
|
def self.available?
|
5
|
+
begin
|
6
|
+
require "readline"
|
7
|
+
rescue LoadError
|
8
|
+
end
|
9
|
+
|
10
10
|
Object.const_defined?(:Readline)
|
11
11
|
end
|
12
12
|
|
data/lib/foreman/version.rb
CHANGED
data/man/overman.1
CHANGED
@@ -1,284 +1,181 @@
|
|
1
|
-
.\" generated with Ronn/v0.
|
2
|
-
.\" http://github.com/
|
3
|
-
.
|
4
|
-
.TH "FOREMAN" "1" "April 2020" "Foreman 0.87.2" "Foreman Manual"
|
5
|
-
.
|
1
|
+
.\" generated with Ronn-NG/v0.10.1
|
2
|
+
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
|
3
|
+
.TH "FOREMAN" "1" "April 2024" "Foreman 0.88.1" "Foreman Manual"
|
6
4
|
.SH "NAME"
|
7
5
|
\fBforeman\fR \- manage Procfile\-based applications
|
8
|
-
.
|
9
6
|
.SH "SYNOPSIS"
|
10
7
|
\fBforeman start [process]\fR
|
11
|
-
.
|
12
8
|
.br
|
13
9
|
\fBforeman run <command>\fR
|
14
|
-
.
|
15
10
|
.br
|
16
11
|
\fBforeman export <format> [location]\fR
|
17
|
-
.
|
18
12
|
.SH "DESCRIPTION"
|
19
13
|
Foreman 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\.
|
20
|
-
.
|
21
14
|
.SH "RUNNING"
|
22
15
|
\fBforeman start\fR is used to run your application directly from the command line\.
|
23
|
-
.
|
24
16
|
.P
|
25
17
|
If no additional parameters are passed, foreman will run one instance of each type of process defined in your Procfile\.
|
26
|
-
.
|
27
18
|
.P
|
28
19
|
If a parameter is passed, foreman will run one instance of the specified application type\.
|
29
|
-
.
|
30
20
|
.P
|
31
21
|
The following options control how the application is run:
|
32
|
-
.
|
33
22
|
.TP
|
34
23
|
\fB\-m\fR, \fB\-\-formation\fR
|
35
24
|
Specify the number of each process type to run\. The value passed in should be in the format \fBprocess=num,process=num\fR
|
36
|
-
.
|
37
25
|
.TP
|
38
26
|
\fB\-e\fR, \fB\-\-env\fR
|
39
27
|
Specify one or more \.env files to load
|
40
|
-
.
|
41
28
|
.TP
|
42
29
|
\fB\-f\fR, \fB\-\-procfile\fR
|
43
30
|
Specify an alternate Procfile to load, implies \fB\-d\fR at the Procfile root\.
|
44
|
-
.
|
45
31
|
.TP
|
46
32
|
\fB\-p\fR, \fB\-\-port\fR
|
47
33
|
Specify which port to use as the base for this application\. Should be a multiple of 1000\.
|
48
|
-
.
|
49
34
|
.TP
|
50
35
|
\fB\-t\fR, \fB\-\-timeout\fR
|
51
36
|
Specify the amount of time (in seconds) processes have to shutdown gracefully before receiving a SIGKILL, defaults to 5\.
|
52
|
-
.
|
53
37
|
.P
|
54
38
|
\fBforeman run\fR is used to run one\-off commands using the same environment as your defined processes\.
|
55
|
-
.
|
56
39
|
.SH "EXPORTING"
|
57
40
|
\fBforeman export\fR is used to export your application to another process management format\.
|
58
|
-
.
|
59
41
|
.P
|
60
42
|
A location to export can be passed as an argument\. This argument may be either required or optional depending on the export format\.
|
61
|
-
.
|
62
43
|
.P
|
63
44
|
The following options control how the application is run:
|
64
|
-
.
|
65
45
|
.TP
|
66
46
|
\fB\-a\fR, \fB\-\-app\fR
|
67
|
-
Use this name rather than the application
|
68
|
-
.
|
47
|
+
Use this name rather than the application's root directory name as the name of the application when exporting\.
|
69
48
|
.TP
|
70
49
|
\fB\-m\fR, \fB\-\-formation\fR
|
71
50
|
Specify the number of each process type to run\. The value passed in should be in the format \fBprocess=num,process=num\fR
|
72
|
-
.
|
73
51
|
.TP
|
74
52
|
\fB\-l\fR, \fB\-\-log\fR
|
75
53
|
Specify the directory to place process logs in\.
|
76
|
-
.
|
77
54
|
.TP
|
78
55
|
\fB\-p\fR, \fB\-\-port\fR
|
79
56
|
Specify which port to use as the base for this application\. Should be a multiple of 1000\.
|
80
|
-
.
|
81
57
|
.TP
|
82
58
|
\fB\-t\fR, \fB\-\-template\fR
|
83
59
|
Specify an alternate template to use for creating export files\. See \fIhttps://github\.com/ddollar/foreman/tree/master/data/export\fR for examples\.
|
84
|
-
.
|
85
60
|
.TP
|
86
61
|
\fB\-u\fR, \fB\-\-user\fR
|
87
62
|
Specify the user the application should be run as\. Defaults to the app name
|
88
|
-
.
|
89
63
|
.SH "GLOBAL OPTIONS"
|
90
|
-
These options control all modes of foreman
|
91
|
-
.
|
64
|
+
These options control all modes of foreman's operation\.
|
92
65
|
.TP
|
93
66
|
\fB\-d\fR, \fB\-\-root\fR
|
94
67
|
Specify an alternate application root\. This defaults to the directory containing the Procfile\.
|
95
|
-
.
|
96
68
|
.TP
|
97
69
|
\fB\-e\fR, \fB\-\-env\fR
|
98
70
|
Specify an alternate environment file\. You can specify more than one file by using: \fB\-\-env file1,file2\fR\.
|
99
|
-
.
|
100
71
|
.TP
|
101
72
|
\fB\-f\fR, \fB\-\-procfile\fR
|
102
|
-
Specify an alternate location for the application
|
103
|
-
.
|
73
|
+
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\.
|
104
74
|
.SH "EXPORT FORMATS"
|
105
75
|
foreman currently supports the following output formats:
|
106
|
-
.
|
107
76
|
.IP "\(bu" 4
|
108
77
|
bluepill
|
109
|
-
.
|
110
78
|
.IP "\(bu" 4
|
111
79
|
inittab
|
112
|
-
.
|
113
80
|
.IP "\(bu" 4
|
114
81
|
launchd
|
115
|
-
.
|
116
82
|
.IP "\(bu" 4
|
117
83
|
runit
|
118
|
-
.
|
119
84
|
.IP "\(bu" 4
|
120
85
|
supervisord
|
121
|
-
.
|
122
86
|
.IP "\(bu" 4
|
123
87
|
systemd
|
124
|
-
.
|
125
88
|
.IP "\(bu" 4
|
126
89
|
upstart
|
127
|
-
.
|
128
90
|
.IP "" 0
|
129
|
-
.
|
130
91
|
.SH "INITTAB EXPORT"
|
131
92
|
Will export a chunk of inittab\-compatible configuration:
|
132
|
-
.
|
133
93
|
.IP "" 4
|
134
|
-
.
|
135
94
|
.nf
|
136
|
-
|
137
95
|
# \-\-\-\-\- foreman example processes \-\-\-\-\-
|
138
|
-
EX01:4:respawn:/bin/su \- example \-c
|
139
|
-
EX02:4:respawn:/bin/su \- example \-c
|
96
|
+
EX01:4:respawn:/bin/su \- example \-c 'PORT=5000 bundle exec thin start >> /var/log/web\-1\.log 2>&1'
|
97
|
+
EX02:4:respawn:/bin/su \- example \-c 'PORT=5100 bundle exec rake jobs:work >> /var/log/job\-1\.log 2>&1'
|
140
98
|
# \-\-\-\-\- end foreman example processes \-\-\-\-\-
|
141
|
-
.
|
142
99
|
.fi
|
143
|
-
.
|
144
100
|
.IP "" 0
|
145
|
-
.
|
146
101
|
.SH "SYSTEMD EXPORT"
|
147
102
|
Will create a series of systemd scripts in the location you specify\. Scripts will be structured to make the following commands valid:
|
148
|
-
.
|
149
103
|
.P
|
150
104
|
\fBsystemctl start appname\.target\fR
|
151
|
-
.
|
152
105
|
.P
|
153
106
|
\fBsystemctl stop appname\-processname\.target\fR
|
154
|
-
.
|
155
107
|
.P
|
156
108
|
\fBsystemctl restart appname\-processname\-3\.service\fR
|
157
|
-
.
|
158
109
|
.SH "UPSTART EXPORT"
|
159
110
|
Will create a series of upstart scripts in the location you specify\. Scripts will be structured to make the following commands valid:
|
160
|
-
.
|
161
111
|
.P
|
162
112
|
\fBstart appname\fR
|
163
|
-
.
|
164
113
|
.P
|
165
114
|
\fBstop appname\-processname\fR
|
166
|
-
.
|
167
115
|
.P
|
168
116
|
\fBrestart appname\-processname\-3\fR
|
169
|
-
.
|
170
117
|
.SH "PROCFILE"
|
171
118
|
A Procfile should contain both a name for the process and the command used to run it\.
|
172
|
-
.
|
173
119
|
.IP "" 4
|
174
|
-
.
|
175
120
|
.nf
|
176
|
-
|
177
121
|
web: bundle exec thin start
|
178
122
|
job: bundle exec rake jobs:work
|
179
|
-
.
|
180
123
|
.fi
|
181
|
-
.
|
182
124
|
.IP "" 0
|
183
|
-
.
|
184
125
|
.P
|
185
126
|
A process name may contain letters, numbers and the underscore character\. You can validate your Procfile format using the \fBcheck\fR command:
|
186
|
-
.
|
187
127
|
.IP "" 4
|
188
|
-
.
|
189
128
|
.nf
|
190
|
-
|
191
129
|
$ foreman check
|
192
|
-
.
|
193
130
|
.fi
|
194
|
-
.
|
195
131
|
.IP "" 0
|
196
|
-
.
|
197
132
|
.P
|
198
133
|
The special environment variables \fB$PORT\fR and \fB$PS\fR are available within the Procfile\. \fB$PORT\fR is the port selected for that process\. \fB$PS\fR is the name of the process for the line\.
|
199
|
-
.
|
200
134
|
.P
|
201
135
|
The \fB$PORT\fR value starts as the base port as specified by \fB\-p\fR, then increments by 100 for each new process line\. Multiple instances of the same process are assigned \fB$PORT\fR values that increment by 1\.
|
202
|
-
.
|
203
136
|
.SH "ENVIRONMENT"
|
204
137
|
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\.
|
205
|
-
.
|
206
138
|
.IP "" 4
|
207
|
-
.
|
208
139
|
.nf
|
209
|
-
|
210
140
|
FOO=bar
|
211
141
|
BAZ=qux
|
212
|
-
.
|
213
142
|
.fi
|
214
|
-
.
|
215
143
|
.IP "" 0
|
216
|
-
.
|
217
144
|
.SH "DEFAULT OPTIONS"
|
218
145
|
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:
|
219
|
-
.
|
220
146
|
.IP "" 4
|
221
|
-
.
|
222
147
|
.nf
|
223
|
-
|
224
148
|
formation: alpha=0,bravo=1
|
225
149
|
port: 15000
|
226
|
-
.
|
227
150
|
.fi
|
228
|
-
.
|
229
151
|
.IP "" 0
|
230
|
-
.
|
231
152
|
.SH "EXAMPLES"
|
232
153
|
Start one instance of each process type, interleave the output on stdout:
|
233
|
-
.
|
234
154
|
.IP "" 4
|
235
|
-
.
|
236
155
|
.nf
|
237
|
-
|
238
156
|
$ foreman start
|
239
|
-
.
|
240
157
|
.fi
|
241
|
-
.
|
242
158
|
.IP "" 0
|
243
|
-
.
|
244
159
|
.P
|
245
160
|
Export the application in upstart format:
|
246
|
-
.
|
247
161
|
.IP "" 4
|
248
|
-
.
|
249
162
|
.nf
|
250
|
-
|
251
163
|
$ foreman export upstart /etc/init
|
252
|
-
.
|
253
164
|
.fi
|
254
|
-
.
|
255
165
|
.IP "" 0
|
256
|
-
.
|
257
166
|
.P
|
258
167
|
Run one process type from the application defined in a specific Procfile:
|
259
|
-
.
|
260
168
|
.IP "" 4
|
261
|
-
.
|
262
169
|
.nf
|
263
|
-
|
264
170
|
$ foreman start alpha \-f ~/myapp/Procfile
|
265
|
-
.
|
266
171
|
.fi
|
267
|
-
.
|
268
172
|
.IP "" 0
|
269
|
-
.
|
270
173
|
.P
|
271
174
|
Start all processes except the one named worker:
|
272
|
-
.
|
273
175
|
.IP "" 4
|
274
|
-
.
|
275
176
|
.nf
|
276
|
-
|
277
177
|
$ foreman start \-m all=1,worker=0
|
278
|
-
.
|
279
178
|
.fi
|
280
|
-
.
|
281
179
|
.IP "" 0
|
282
|
-
.
|
283
180
|
.SH "COPYRIGHT"
|
284
181
|
Foreman is Copyright (C) 2010 David Dollar \fIhttp://daviddollar\.org\fR
|
data/spec/foreman/cli_spec.rb
CHANGED
@@ -77,15 +77,15 @@ describe "Foreman::CLI", :fakefs do
|
|
77
77
|
|
78
78
|
describe "run" do
|
79
79
|
it "can run a command" do
|
80
|
-
expect(forked_foreman("run echo 1")).to eq("1\n")
|
80
|
+
expect(forked_foreman("run -f #{resource_path("Procfile")} echo 1")).to eq("1\n")
|
81
81
|
end
|
82
82
|
|
83
83
|
it "doesn't parse options for the command" do
|
84
|
-
expect(forked_foreman("run grep -e FOO #{resource_path(".env")}")).to eq("FOO=bar\n")
|
84
|
+
expect(forked_foreman("run -f #{resource_path("Procfile")} grep -e FOO #{resource_path(".env")}")).to eq("FOO=bar\n")
|
85
85
|
end
|
86
86
|
|
87
87
|
it "includes the environment" do
|
88
|
-
expect(forked_foreman("run -e #{resource_path(".env")} #{resource_path("bin/env FOO")}")).to eq("bar\n")
|
88
|
+
expect(forked_foreman("run -f #{resource_path("Procfile")} -e #{resource_path(".env")} #{resource_path("bin/env FOO")}")).to eq("bar\n")
|
89
89
|
end
|
90
90
|
|
91
91
|
it "can run a command from the Procfile" do
|
@@ -93,8 +93,8 @@ describe "Foreman::CLI", :fakefs do
|
|
93
93
|
end
|
94
94
|
|
95
95
|
it "exits with the same exit code as the command" do
|
96
|
-
expect(fork_and_get_exitstatus("run echo 1")).to eq(0)
|
97
|
-
expect(fork_and_get_exitstatus("run date 'invalid_date'")).to eq(1)
|
96
|
+
expect(fork_and_get_exitstatus("run -f #{resource_path("Procfile")} echo 1")).to eq(0)
|
97
|
+
expect(fork_and_get_exitstatus("run -f #{resource_path("Procfile")} date 'invalid_date'")).to eq(1)
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
@@ -60,7 +60,7 @@ describe Foreman::Export::Daemon, :fakefs do
|
|
60
60
|
expect(File.read("/tmp/init/app-alpha.conf")).to eq(example_export_file("daemon/app-alpha.conf"))
|
61
61
|
expect(File.read("/tmp/init/app-alpha-1.conf")).to eq(example_export_file("daemon/app-alpha-1.conf"))
|
62
62
|
expect(File.read("/tmp/init/app-alpha-2.conf")).to eq(example_export_file("daemon/app-alpha-2.conf"))
|
63
|
-
expect(File.
|
63
|
+
expect(File.exist?("/tmp/init/app-bravo-1.conf")).to eq(false)
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
@@ -81,7 +81,7 @@ describe Foreman::Export::Upstart, :fakefs do
|
|
81
81
|
expect(File.read("/tmp/init/app-alpha.conf")).to eq(example_export_file("upstart/app-alpha.conf"))
|
82
82
|
expect(File.read("/tmp/init/app-alpha-1.conf")).to eq(example_export_file("upstart/app-alpha-1.conf"))
|
83
83
|
expect(File.read("/tmp/init/app-alpha-2.conf")).to eq(example_export_file("upstart/app-alpha-2.conf"))
|
84
|
-
expect(File.
|
84
|
+
expect(File.exist?("/tmp/init/app-bravo-1.conf")).to eq(false)
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
@@ -22,6 +22,14 @@ describe Foreman::Procfile, :fakefs do
|
|
22
22
|
expect(procfile["foo_bar"]).to eq("./foo_bar")
|
23
23
|
end
|
24
24
|
|
25
|
+
it "raises an error if Procfile is empty" do
|
26
|
+
write_file "Procfile" do |procfile|
|
27
|
+
procfile.puts
|
28
|
+
end
|
29
|
+
|
30
|
+
expect { Foreman::Procfile.new("Procfile") }.to raise_error described_class::EmptyFileError
|
31
|
+
end
|
32
|
+
|
25
33
|
it 'only creates Procfile entries for lines matching regex' do
|
26
34
|
write_procfile
|
27
35
|
procfile = Foreman::Procfile.new("Procfile")
|
data/spec/spec_helper.rb
CHANGED
@@ -150,7 +150,23 @@ def preserving_env
|
|
150
150
|
end
|
151
151
|
|
152
152
|
def normalize_space(s)
|
153
|
-
|
153
|
+
|
154
|
+
normalized = s.gsub(/\n[\n\s]*/, "\n")
|
155
|
+
|
156
|
+
if RUBY_VERSION >= "3.4"
|
157
|
+
# Hash#inspect changed from Ruby 3.4
|
158
|
+
# used in data/export/bluepill/master.pill.erb
|
159
|
+
#
|
160
|
+
# $ chruby-exec 3.3.7 -- ruby -e 'puts "#{{"PORT"=>"5000"}.inspect}"'
|
161
|
+
# {"PORT"=>"5000"}
|
162
|
+
#
|
163
|
+
# $ chruby-exec 3.4.1 -- ruby -e 'puts "#{{"PORT"=>"5000"}.inspect}"'
|
164
|
+
# {"PORT" => "5000"}
|
165
|
+
|
166
|
+
normalized.gsub(/{"PORT"=>"(\d+)"}/, '{"PORT" => "\1"}')
|
167
|
+
else
|
168
|
+
normalized
|
169
|
+
end
|
154
170
|
end
|
155
171
|
|
156
172
|
def capture_stdout
|
@@ -171,7 +187,4 @@ RSpec.configure do |config|
|
|
171
187
|
config.before(:each) do
|
172
188
|
FileUtils.mkdir_p('/tmp')
|
173
189
|
end
|
174
|
-
config.after(:each) do
|
175
|
-
FileUtils.rm_rf('/tmp')
|
176
|
-
end
|
177
190
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: overman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.88.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Dollar
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-07 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
12
|
description: Process manager for applications with multiple components, fork of ddollar/foreman
|
14
13
|
email: ddollar@gmail.com
|
@@ -151,11 +150,10 @@ files:
|
|
151
150
|
- spec/resources/export/upstart/app-bravo.conf
|
152
151
|
- spec/resources/export/upstart/app.conf
|
153
152
|
- spec/spec_helper.rb
|
154
|
-
homepage: https://github.com/spinels/
|
153
|
+
homepage: https://github.com/spinels/overman
|
155
154
|
licenses:
|
156
155
|
- MIT
|
157
156
|
metadata: {}
|
158
|
-
post_install_message:
|
159
157
|
rdoc_options: []
|
160
158
|
require_paths:
|
161
159
|
- lib
|
@@ -163,15 +161,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
163
161
|
requirements:
|
164
162
|
- - ">="
|
165
163
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
164
|
+
version: 2.3.8
|
167
165
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
166
|
requirements:
|
169
167
|
- - ">="
|
170
168
|
- !ruby/object:Gem::Version
|
171
169
|
version: '0'
|
172
170
|
requirements: []
|
173
|
-
rubygems_version: 3.
|
174
|
-
signing_key:
|
171
|
+
rubygems_version: 3.6.2
|
175
172
|
specification_version: 4
|
176
173
|
summary: Process manager for applications with multiple components, fork of ddollar/foreman
|
177
174
|
test_files: []
|