foreman 0.46.0-mingw32 → 0.50.0-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -0
- data/bin/foreman-runner +3 -7
- data/bin/taskman +8 -0
- data/data/example/Procfile +4 -3
- data/data/example/spawnee +14 -0
- data/data/example/spawner +7 -0
- data/data/export/bluepill/master.pill.erb +11 -10
- data/data/export/launchd/launchd.plist.erb +22 -0
- data/data/export/runit/log/run.erb +7 -0
- data/data/export/runit/run.erb +2 -2
- data/data/export/supervisord/app.conf.erb +12 -12
- data/data/export/upstart/master.conf.erb +2 -2
- data/data/export/upstart/process.conf.erb +3 -3
- data/lib/foreman.rb +4 -0
- data/lib/foreman/cli.rb +59 -23
- data/lib/foreman/engine.rb +233 -147
- data/lib/foreman/engine/cli.rb +105 -0
- data/lib/foreman/env.rb +27 -0
- data/lib/foreman/export.rb +2 -2
- data/lib/foreman/export/base.rb +107 -12
- data/lib/foreman/export/bluepill.rb +3 -17
- data/lib/foreman/export/inittab.rb +8 -11
- data/lib/foreman/export/launchd.rb +15 -0
- data/lib/foreman/export/runit.rb +14 -39
- data/lib/foreman/export/supervisord.rb +3 -13
- data/lib/foreman/export/upstart.rb +9 -27
- data/lib/foreman/process.rb +73 -67
- data/lib/foreman/procfile.rb +59 -25
- data/lib/foreman/version.rb +1 -1
- data/man/foreman.1 +5 -1
- data/spec/foreman/cli_spec.rb +46 -150
- data/spec/foreman/engine_spec.rb +47 -74
- data/spec/foreman/export/base_spec.rb +4 -7
- data/spec/foreman/export/bluepill_spec.rb +7 -6
- data/spec/foreman/export/inittab_spec.rb +7 -7
- data/spec/foreman/export/launchd_spec.rb +21 -0
- data/spec/foreman/export/runit_spec.rb +12 -17
- data/spec/foreman/export/supervisord_spec.rb +7 -56
- data/spec/foreman/export/upstart_spec.rb +22 -21
- data/spec/foreman/process_spec.rb +27 -110
- data/spec/foreman/procfile_spec.rb +26 -16
- data/spec/resources/Procfile +4 -0
- data/spec/resources/bin/echo +2 -0
- data/spec/resources/bin/env +2 -0
- data/spec/resources/bin/test +2 -0
- data/spec/resources/export/bluepill/app-concurrency.pill +6 -4
- data/spec/resources/export/bluepill/app.pill +6 -4
- data/spec/resources/export/launchd/launchd-a.default +22 -0
- data/spec/resources/export/launchd/launchd-b.default +22 -0
- data/spec/resources/export/runit/{app-alpha-1-log-run → app-alpha-1/log/run} +0 -0
- data/spec/resources/export/runit/{app-alpha-1-run → app-alpha-1/run} +0 -0
- data/spec/resources/export/runit/{app-alpha-2-log-run → app-alpha-2/log/run} +0 -0
- data/spec/resources/export/runit/{app-alpha-2-run → app-alpha-2/run} +0 -0
- data/spec/resources/export/runit/{app-bravo-1-log-run → app-bravo-1/log/run} +0 -0
- data/spec/resources/export/runit/{app-bravo-1-run → app-bravo-1/run} +0 -0
- data/spec/resources/export/supervisord/app-alpha-1.conf +24 -0
- data/spec/resources/export/supervisord/app-alpha-2.conf +4 -4
- data/spec/spec_helper.rb +57 -6
- metadata +29 -21
- data/data/export/runit/log_run.erb +0 -7
- data/lib/foreman/color.rb +0 -40
- data/lib/foreman/procfile_entry.rb +0 -26
- data/lib/foreman/utils.rb +0 -18
- data/spec/foreman/color_spec.rb +0 -31
- data/spec/foreman/procfile_entry_spec.rb +0 -13
- data/spec/resources/export/supervisord/app-env-with-comma.conf +0 -24
- data/spec/resources/export/supervisord/app-env.conf +0 -21
- data/spec/resources/export/supervisord/app.conf +0 -24
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.50.0
|
5
5
|
prerelease:
|
6
6
|
platform: mingw32
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
16
|
-
requirement: &
|
16
|
+
requirement: &70204077470000 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.13.6
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70204077470000
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: win32console
|
27
|
-
requirement: &
|
27
|
+
requirement: &70204077467940 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 1.3.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70204077467940
|
36
36
|
description: Process manager for applications with multiple components
|
37
37
|
email: ddollar@gmail.com
|
38
38
|
executables:
|
@@ -42,26 +42,32 @@ extra_rdoc_files: []
|
|
42
42
|
files:
|
43
43
|
- bin/foreman
|
44
44
|
- bin/foreman-runner
|
45
|
+
- bin/taskman
|
45
46
|
- data/example/error
|
46
47
|
- data/example/log/neverdie.log
|
47
48
|
- data/example/Procfile
|
48
49
|
- data/example/Procfile.without_colon
|
50
|
+
- data/example/spawnee
|
51
|
+
- data/example/spawner
|
49
52
|
- data/example/ticker
|
50
53
|
- data/example/utf8
|
51
54
|
- data/export/bluepill/master.pill.erb
|
52
|
-
- data/export/
|
55
|
+
- data/export/launchd/launchd.plist.erb
|
56
|
+
- data/export/runit/log/run.erb
|
53
57
|
- data/export/runit/run.erb
|
54
58
|
- data/export/supervisord/app.conf.erb
|
55
59
|
- data/export/upstart/master.conf.erb
|
56
60
|
- data/export/upstart/process.conf.erb
|
57
61
|
- data/export/upstart/process_master.conf.erb
|
58
62
|
- lib/foreman/cli.rb
|
59
|
-
- lib/foreman/color.rb
|
60
63
|
- lib/foreman/distribution.rb
|
64
|
+
- lib/foreman/engine/cli.rb
|
61
65
|
- lib/foreman/engine.rb
|
66
|
+
- lib/foreman/env.rb
|
62
67
|
- lib/foreman/export/base.rb
|
63
68
|
- lib/foreman/export/bluepill.rb
|
64
69
|
- lib/foreman/export/inittab.rb
|
70
|
+
- lib/foreman/export/launchd.rb
|
65
71
|
- lib/foreman/export/runit.rb
|
66
72
|
- lib/foreman/export/supervisord.rb
|
67
73
|
- lib/foreman/export/upstart.rb
|
@@ -69,48 +75,49 @@ files:
|
|
69
75
|
- lib/foreman/helpers.rb
|
70
76
|
- lib/foreman/process.rb
|
71
77
|
- lib/foreman/procfile.rb
|
72
|
-
- lib/foreman/procfile_entry.rb
|
73
|
-
- lib/foreman/utils.rb
|
74
78
|
- lib/foreman/version.rb
|
75
79
|
- lib/foreman.rb
|
76
80
|
- README.md
|
77
81
|
- spec/foreman/cli_spec.rb
|
78
|
-
- spec/foreman/color_spec.rb
|
79
82
|
- spec/foreman/engine_spec.rb
|
80
83
|
- spec/foreman/export/base_spec.rb
|
81
84
|
- spec/foreman/export/bluepill_spec.rb
|
82
85
|
- spec/foreman/export/inittab_spec.rb
|
86
|
+
- spec/foreman/export/launchd_spec.rb
|
83
87
|
- spec/foreman/export/runit_spec.rb
|
84
88
|
- spec/foreman/export/supervisord_spec.rb
|
85
89
|
- spec/foreman/export/upstart_spec.rb
|
86
90
|
- spec/foreman/export_spec.rb
|
87
91
|
- spec/foreman/helpers_spec.rb
|
88
92
|
- spec/foreman/process_spec.rb
|
89
|
-
- spec/foreman/procfile_entry_spec.rb
|
90
93
|
- spec/foreman/procfile_spec.rb
|
91
94
|
- spec/foreman_spec.rb
|
92
95
|
- spec/helper_spec.rb
|
96
|
+
- spec/resources/bin/echo
|
97
|
+
- spec/resources/bin/env
|
98
|
+
- spec/resources/bin/test
|
93
99
|
- spec/resources/bin/utf8
|
94
100
|
- spec/resources/export/bluepill/app-concurrency.pill
|
95
101
|
- spec/resources/export/bluepill/app.pill
|
96
102
|
- spec/resources/export/inittab/inittab.concurrency
|
97
103
|
- spec/resources/export/inittab/inittab.default
|
98
|
-
- spec/resources/export/
|
99
|
-
- spec/resources/export/
|
100
|
-
- spec/resources/export/runit/app-alpha-
|
101
|
-
- spec/resources/export/runit/app-alpha-
|
102
|
-
- spec/resources/export/runit/app-
|
103
|
-
- spec/resources/export/runit/app-
|
104
|
+
- spec/resources/export/launchd/launchd-a.default
|
105
|
+
- spec/resources/export/launchd/launchd-b.default
|
106
|
+
- spec/resources/export/runit/app-alpha-1/log/run
|
107
|
+
- spec/resources/export/runit/app-alpha-1/run
|
108
|
+
- spec/resources/export/runit/app-alpha-2/log/run
|
109
|
+
- spec/resources/export/runit/app-alpha-2/run
|
110
|
+
- spec/resources/export/runit/app-bravo-1/log/run
|
111
|
+
- spec/resources/export/runit/app-bravo-1/run
|
112
|
+
- spec/resources/export/supervisord/app-alpha-1.conf
|
104
113
|
- spec/resources/export/supervisord/app-alpha-2.conf
|
105
|
-
- spec/resources/export/supervisord/app-env-with-comma.conf
|
106
|
-
- spec/resources/export/supervisord/app-env.conf
|
107
|
-
- spec/resources/export/supervisord/app.conf
|
108
114
|
- spec/resources/export/upstart/app-alpha-1.conf
|
109
115
|
- spec/resources/export/upstart/app-alpha-2.conf
|
110
116
|
- spec/resources/export/upstart/app-alpha.conf
|
111
117
|
- spec/resources/export/upstart/app-bravo-1.conf
|
112
118
|
- spec/resources/export/upstart/app-bravo.conf
|
113
119
|
- spec/resources/export/upstart/app.conf
|
120
|
+
- spec/resources/Procfile
|
114
121
|
- spec/spec_helper.rb
|
115
122
|
- man/foreman.1
|
116
123
|
homepage: http://github.com/ddollar/foreman
|
@@ -138,3 +145,4 @@ signing_key:
|
|
138
145
|
specification_version: 3
|
139
146
|
summary: Process manager for applications with multiple components
|
140
147
|
test_files: []
|
148
|
+
has_rdoc:
|
data/lib/foreman/color.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
require "foreman"
|
2
|
-
|
3
|
-
module Foreman::Color
|
4
|
-
|
5
|
-
ANSI = {
|
6
|
-
:reset => 0,
|
7
|
-
:black => 30,
|
8
|
-
:red => 31,
|
9
|
-
:green => 32,
|
10
|
-
:yellow => 33,
|
11
|
-
:blue => 34,
|
12
|
-
:magenta => 35,
|
13
|
-
:cyan => 36,
|
14
|
-
:white => 37,
|
15
|
-
:bright_black => 30,
|
16
|
-
:bright_red => 31,
|
17
|
-
:bright_green => 32,
|
18
|
-
:bright_yellow => 33,
|
19
|
-
:bright_blue => 34,
|
20
|
-
:bright_magenta => 35,
|
21
|
-
:bright_cyan => 36,
|
22
|
-
:bright_white => 37,
|
23
|
-
}
|
24
|
-
|
25
|
-
def self.enable(io)
|
26
|
-
io.extend(self)
|
27
|
-
end
|
28
|
-
|
29
|
-
def color?
|
30
|
-
return false unless self.respond_to?(:isatty)
|
31
|
-
self.isatty && ENV["TERM"]
|
32
|
-
end
|
33
|
-
|
34
|
-
def color(name)
|
35
|
-
return "" unless color?
|
36
|
-
return "" unless ansi = ANSI[name.to_sym]
|
37
|
-
"\e[#{ansi}m"
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require "foreman"
|
2
|
-
|
3
|
-
class Foreman::ProcfileEntry
|
4
|
-
|
5
|
-
attr_reader :name
|
6
|
-
attr_reader :command
|
7
|
-
attr_accessor :color
|
8
|
-
|
9
|
-
def initialize(name, command)
|
10
|
-
@name = name
|
11
|
-
@command = command
|
12
|
-
end
|
13
|
-
|
14
|
-
def spawn(num, pipe, basedir, environment, base_port)
|
15
|
-
(1..num).to_a.map do |n|
|
16
|
-
process = Foreman::Process.new(self, n, base_port + (n-1))
|
17
|
-
process.run(pipe, basedir, environment)
|
18
|
-
process
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def to_s
|
23
|
-
"#{name}: #{command}"
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|
data/lib/foreman/utils.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
require "foreman"
|
2
|
-
|
3
|
-
class Foreman::Utils
|
4
|
-
|
5
|
-
def self.parse_concurrency(concurrency)
|
6
|
-
begin
|
7
|
-
pairs = concurrency.to_s.gsub(/\s/, "").split(",")
|
8
|
-
|
9
|
-
default = concurrency.nil? ? 1 : 0
|
10
|
-
|
11
|
-
pairs.inject(Hash.new(default)) do |hash, pair|
|
12
|
-
process, amount = pair.split("=")
|
13
|
-
hash.update(process => amount.to_i)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
data/spec/foreman/color_spec.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require "foreman/color"
|
3
|
-
|
4
|
-
describe Foreman::Color do
|
5
|
-
|
6
|
-
let(:io) { Object.new }
|
7
|
-
|
8
|
-
it "should extend an object with colorization" do
|
9
|
-
Foreman::Color.enable(io)
|
10
|
-
io.should respond_to(:color)
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should not colorize if the object does not respond to isatty" do
|
14
|
-
mock(io).respond_to?(:isatty) { false }
|
15
|
-
Foreman::Color.enable(io)
|
16
|
-
io.color(:white).should == ""
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should not colorize if the object is not a tty" do
|
20
|
-
mock(io).isatty { false }
|
21
|
-
Foreman::Color.enable(io)
|
22
|
-
io.color(:white).should == ""
|
23
|
-
end
|
24
|
-
|
25
|
-
it "should colorize if the object is a tty" do
|
26
|
-
mock(io).isatty { true }
|
27
|
-
Foreman::Color.enable(io)
|
28
|
-
io.color(:white).should == "\e[37m"
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'foreman/procfile_entry'
|
3
|
-
require 'pathname'
|
4
|
-
require 'tmpdir'
|
5
|
-
|
6
|
-
describe Foreman::ProcfileEntry do
|
7
|
-
subject { described_class.new('alpha', './alpha') }
|
8
|
-
|
9
|
-
it "stringifies as a Procfile line" do
|
10
|
-
subject.to_s.should == 'alpha: ./alpha'
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
|
2
|
-
[program:app-alpha]
|
3
|
-
command=./alpha
|
4
|
-
autostart=true
|
5
|
-
autorestart=true
|
6
|
-
stopsignal=QUIT
|
7
|
-
stdout_logfile=/var/log/app/alpha-1-out.log
|
8
|
-
stderr_logfile=/var/log/app/alpha-1-err.log
|
9
|
-
user=app
|
10
|
-
directory=/tmp/app
|
11
|
-
environment=QUEUE="fastqueue,slowqueue",VERBOSE="1",PORT="5000"
|
12
|
-
[program:app-bravo]
|
13
|
-
command=./bravo
|
14
|
-
autostart=true
|
15
|
-
autorestart=true
|
16
|
-
stopsignal=QUIT
|
17
|
-
stdout_logfile=/var/log/app/bravo-1-out.log
|
18
|
-
stderr_logfile=/var/log/app/bravo-1-err.log
|
19
|
-
user=app
|
20
|
-
directory=/tmp/app
|
21
|
-
environment=QUEUE="fastqueue,slowqueue",VERBOSE="1",PORT="5100"
|
22
|
-
|
23
|
-
[group:app]
|
24
|
-
programs=app-alpha,app-bravo
|
@@ -1,21 +0,0 @@
|
|
1
|
-
|
2
|
-
[program:app-alpha]
|
3
|
-
command=./alpha
|
4
|
-
autostart=true
|
5
|
-
autorestart=true
|
6
|
-
stopsignal=QUIT
|
7
|
-
stdout_logfile=/var/log/app/alpha-1-out.log
|
8
|
-
stderr_logfile=/var/log/app/alpha-1-err.log
|
9
|
-
user=app
|
10
|
-
directory=/tmp/app
|
11
|
-
environment=FOO="bar",PORT="5000"
|
12
|
-
[program:app-bravo]
|
13
|
-
command=./bravo
|
14
|
-
autostart=true
|
15
|
-
autorestart=true
|
16
|
-
stopsignal=QUIT
|
17
|
-
stdout_logfile=/var/log/app/bravo-1-out.log
|
18
|
-
stderr_logfile=/var/log/app/bravo-1-err.log
|
19
|
-
user=app
|
20
|
-
directory=/tmp/app
|
21
|
-
environment=FOO="bar",PORT="5100"
|
@@ -1,24 +0,0 @@
|
|
1
|
-
|
2
|
-
[program:app-alpha]
|
3
|
-
command=./alpha
|
4
|
-
autostart=true
|
5
|
-
autorestart=true
|
6
|
-
stopsignal=QUIT
|
7
|
-
stdout_logfile=/var/log/app/alpha-1-out.log
|
8
|
-
stderr_logfile=/var/log/app/alpha-1-err.log
|
9
|
-
user=app
|
10
|
-
directory=/tmp/app
|
11
|
-
environment=PORT="5000"
|
12
|
-
[program:app-bravo]
|
13
|
-
command=./bravo
|
14
|
-
autostart=true
|
15
|
-
autorestart=true
|
16
|
-
stopsignal=QUIT
|
17
|
-
stdout_logfile=/var/log/app/bravo-1-out.log
|
18
|
-
stderr_logfile=/var/log/app/bravo-1-err.log
|
19
|
-
user=app
|
20
|
-
directory=/tmp/app
|
21
|
-
environment=PORT="5100"
|
22
|
-
|
23
|
-
[group:app]
|
24
|
-
programs=app-alpha,app-bravo
|