foreman 0.87.2 → 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 +19 -19
- data/lib/foreman/cli.rb +7 -2
- data/lib/foreman/engine/cli.rb +2 -2
- data/lib/foreman/export/base.rb +6 -6
- data/lib/foreman/procfile.rb +8 -2
- data/lib/foreman/version.rb +1 -1
- data/man/foreman.1 +8 -111
- data/spec/foreman/export/daemon_spec.rb +1 -1
- data/spec/foreman/export/upstart_spec.rb +1 -1
- data/spec/foreman/procfile_spec.rb +8 -0
- data/spec/foreman_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -14
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dfe6fcff4e6a0293ccee732ad38fe72e7a05b2beb662ba2bdf8cc54437e7242
|
4
|
+
data.tar.gz: 2abc2ad27e0c30aebf936508467b7a74217d9c6f1fbabeaf80e1c771247f22cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5f8cdb2f096a15c7f83e7ee3d8c870b37d2a3e1c7085af59e8c34810f88110a87d1db30e44e2f4bf5beb4abede9f0976456e675b174512cee5745d4c8223345
|
7
|
+
data.tar.gz: ed5640039e33ef6a492449ddeae69718f8a8a6a333ddce677f21860e707620f730fd124f19cac9687849783372115eba1e846c72d198325346234ed5c146ed4f
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# Foreman
|
2
2
|
|
3
|
-
[![
|
4
|
-
[![Code Climate](https://codeclimate.com/github/ddollar/foreman.svg)](https://codeclimate.com/github/ddollar/foreman)
|
5
|
-
[![Inline docs](http://inch-ci.org/github/ddollar/foreman.svg?branch=master)](http://inch-ci.org/github/ddollar/foreman)
|
3
|
+
[![CI](https://github.com/ddollar/foreman/actions/workflows/ci.yml/badge.svg)](https://github.com/ddollar/foreman/actions/workflows/ci.yml)
|
6
4
|
|
7
5
|
Manage Procfile-based applications
|
8
6
|
|
@@ -10,41 +8,43 @@ Manage Procfile-based applications
|
|
10
8
|
|
11
9
|
$ gem install foreman
|
12
10
|
|
13
|
-
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.
|
14
12
|
|
15
13
|
## Getting Started
|
16
14
|
|
17
|
-
|
15
|
+
- http://blog.daviddollar.org/2011/05/06/introducing-foreman.html
|
18
16
|
|
19
17
|
## Supported Ruby versions
|
20
18
|
|
21
|
-
See [.
|
19
|
+
See [ci.yml](.github/workflows/ci.yml) for a list of Ruby versions against which Foreman is tested.
|
22
20
|
|
23
21
|
## Documentation
|
24
22
|
|
25
|
-
|
26
|
-
|
27
|
-
|
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)
|
28
26
|
|
29
27
|
## Ports
|
30
28
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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
|
41
39
|
|
42
40
|
## Authors
|
43
41
|
|
44
42
|
#### Created and maintained by
|
43
|
+
|
45
44
|
David Dollar
|
46
45
|
|
47
46
|
#### Patches contributed by
|
47
|
+
|
48
48
|
[Contributor List](https://github.com/ddollar/foreman/contributors)
|
49
49
|
|
50
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
@@ -74,8 +74,8 @@ private ######################################################################
|
|
74
74
|
puts "WARNING: Using deprecated exporter interface. Please update your exporter"
|
75
75
|
puts "the interface shown in the upstart exporter:"
|
76
76
|
puts
|
77
|
-
puts "https://github.com/ddollar/foreman/blob/
|
78
|
-
puts "https://github.com/ddollar/foreman/blob/
|
77
|
+
puts "https://github.com/ddollar/foreman/blob/main/lib/foreman/export/upstart.rb"
|
78
|
+
puts "https://github.com/ddollar/foreman/blob/main/data/export/upstart/process.conf.erb"
|
79
79
|
puts
|
80
80
|
@@deprecation_warned = true
|
81
81
|
end
|
@@ -83,7 +83,7 @@ private ######################################################################
|
|
83
83
|
def chown user, dir
|
84
84
|
FileUtils.chown user, nil, dir
|
85
85
|
rescue
|
86
|
-
error("Could not chown #{dir} to #{user}") unless File.writable?(dir) || ! File.
|
86
|
+
error("Could not chown #{dir} to #{user}") unless File.writable?(dir) || ! File.exist?(dir)
|
87
87
|
end
|
88
88
|
|
89
89
|
def error(message)
|
@@ -95,13 +95,13 @@ private ######################################################################
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def clean(filename)
|
98
|
-
return unless File.
|
98
|
+
return unless File.exist?(filename)
|
99
99
|
say "cleaning up: #{filename}"
|
100
100
|
FileUtils.rm(filename)
|
101
101
|
end
|
102
102
|
|
103
103
|
def clean_dir(dirname)
|
104
|
-
return unless File.
|
104
|
+
return unless File.exist?(dirname)
|
105
105
|
say "cleaning up directory: #{dirname}"
|
106
106
|
FileUtils.rm_r(dirname)
|
107
107
|
end
|
@@ -130,7 +130,7 @@ private ######################################################################
|
|
130
130
|
matchers << File.join(options[:template], name_without_first) if options[:template]
|
131
131
|
matchers << File.expand_path("~/.foreman/templates/#{name}")
|
132
132
|
matchers << File.expand_path("../../../../data/export/#{name}", __FILE__)
|
133
|
-
File.read(matchers.detect { |m| File.
|
133
|
+
File.read(matchers.detect { |m| File.exist?(m) })
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
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
|
data/lib/foreman/version.rb
CHANGED
data/man/foreman.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
|
@@ -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/foreman_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,13 +1,3 @@
|
|
1
|
-
# it throws following message:
|
2
|
-
# W, [2018-02-06T18:16:06.360071 #72025] WARN -- : This usage of the Code Climate Test Reporter is now deprecated. Since version
|
3
|
-
# 1.0, we now require you to run `SimpleCov` in your test/spec helper, and then
|
4
|
-
# run the provided `codeclimate-test-reporter` binary separately to report your
|
5
|
-
# results to Code Climate.
|
6
|
-
#
|
7
|
-
# More information here: https://github.com/codeclimate/ruby-test-reporter/blob/master/README.md
|
8
|
-
# require "codeclimate-test-reporter"
|
9
|
-
# CodeClimate::TestReporter.start
|
10
|
-
|
11
1
|
require "simplecov"
|
12
2
|
SimpleCov.start do
|
13
3
|
add_filter "/spec/"
|
@@ -78,7 +68,7 @@ def fork_and_get_exitstatus(args)
|
|
78
68
|
end
|
79
69
|
|
80
70
|
def mock_exit(&block)
|
81
|
-
expect
|
71
|
+
expect { block.call }.to raise_error(SystemExit)
|
82
72
|
end
|
83
73
|
|
84
74
|
def write_foreman_config(app)
|
@@ -181,7 +171,4 @@ RSpec.configure do |config|
|
|
181
171
|
config.before(:each) do
|
182
172
|
FileUtils.mkdir_p('/tmp')
|
183
173
|
end
|
184
|
-
config.after(:each) do
|
185
|
-
FileUtils.rm_rf('/tmp')
|
186
|
-
end
|
187
174
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman
|
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
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Process manager for applications with multiple components
|
14
14
|
email: ddollar@gmail.com
|
@@ -151,7 +151,7 @@ files:
|
|
151
151
|
- spec/resources/export/upstart/app-bravo.conf
|
152
152
|
- spec/resources/export/upstart/app.conf
|
153
153
|
- spec/spec_helper.rb
|
154
|
-
homepage:
|
154
|
+
homepage: https://github.com/ddollar/foreman
|
155
155
|
licenses:
|
156
156
|
- MIT
|
157
157
|
metadata: {}
|
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
170
|
- !ruby/object:Gem::Version
|
171
171
|
version: '0'
|
172
172
|
requirements: []
|
173
|
-
rubygems_version: 3.
|
173
|
+
rubygems_version: 3.4.19
|
174
174
|
signing_key:
|
175
175
|
specification_version: 4
|
176
176
|
summary: Process manager for applications with multiple components
|