set port from .env if specified
This commit is contained in:
@@ -84,7 +84,7 @@ private ######################################################################
|
|||||||
end
|
end
|
||||||
|
|
||||||
def base_port
|
def base_port
|
||||||
options[:port] || 5000
|
options[:port] || environment["PORT"] || 5000
|
||||||
end
|
end
|
||||||
|
|
||||||
def kill_all(signal="SIGTERM")
|
def kill_all(signal="SIGTERM")
|
||||||
|
|||||||
@@ -100,6 +100,13 @@ describe "Foreman::Engine", :fakefs do
|
|||||||
engine.start
|
engine.start
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "should set port from .env if specified" do
|
||||||
|
File.open(".env", "w") { |f| f.puts("PORT=8017") }
|
||||||
|
engine = Foreman::Engine.new("Procfile")
|
||||||
|
engine.send(:base_port).should == "8017"
|
||||||
|
engine.start
|
||||||
|
end
|
||||||
|
|
||||||
it "should be loaded relative to the Procfile" do
|
it "should be loaded relative to the Procfile" do
|
||||||
FileUtils.mkdir_p "/some/app"
|
FileUtils.mkdir_p "/some/app"
|
||||||
File.open("/some/app/.env", "w") { |f| f.puts("FOO=qoo") }
|
File.open("/some/app/.env", "w") { |f| f.puts("FOO=qoo") }
|
||||||
|
|||||||
Reference in New Issue
Block a user