Revert "Merge pull request #292 from andrewsmedina/master"

Does not pass tests

This reverts commit 17a8a316b8, reversing
changes made to 9e1d590734.
This commit is contained in:
David Dollar
2013-04-15 15:31:38 -04:00
parent f1c2347680
commit 403d40b277
5 changed files with 0 additions and 137 deletions

View File

@@ -1,25 +0,0 @@
[circus]
check_delay = 5
endpoint = tcp://127.0.0.1:5555
<%
engine.each_process do |name, process|
1.upto(engine.formation[name]) do |num|
port = engine.port_for(process, num)
full_name = "#{app}-#{name}-#{num}"
%>
[watcher:<%= full_name %>]
cmd = <%= process.command %>
working_dir = <%= engine.root %>
uid = <%= user %>
stdout_stream.class = FileStream
stdout_stream.filename = <%= log %>/<%= name %>-<%= num %>.log
stderr_stream.class = FileStream
stderr_stream.filename = <%= log %>/<%= name %>-<%= num %>.error.log
copy_env = True
[env:<%= full_name %>]
PORT = <%= port %>
<%
end
end
%>

View File

@@ -1,16 +0,0 @@
require "erb"
require "foreman/export"
class Foreman::Export::Circus < Foreman::Export::Base
def export
super
Dir["#{location}/#{app}*.ini"].each do |file|
clean file
end
write_template "circus/app.ini.erb", "#{app}.ini", binding
end
end

View File

@@ -1,36 +0,0 @@
require "spec_helper"
require "foreman/engine"
require "foreman/export/circus"
require "tmpdir"
describe Foreman::Export::Circus, :fakefs do
let(:procfile) { FileUtils.mkdir_p("/tmp/app"); write_procfile("/tmp/app/Procfile") }
let(:formation) { nil }
let(:engine) { Foreman::Engine.new(:formation => formation).load_procfile(procfile) }
let(:options) { Hash.new }
let(:circus) { Foreman::Export::Circus.new("/tmp/init", engine, options) }
before(:each) { load_export_templates_into_fakefs("circus") }
before(:each) { stub(circus).say }
it "exports to the filesystem" do
circus.export
File.read("/tmp/init/app.ini").should == example_export_file("circus/app-alpha-1.ini")
end
it "cleans up if exporting into an existing dir" do
mock(FileUtils).rm("/tmp/init/app.ini")
circus.export
circus.export
end
context "with concurrency" do
let(:formation) { "alpha=2" }
it "exports to the filesystem with concurrency" do
circus.export
File.read("/tmp/init/app.ini").should == example_export_file("circus/app-alpha-2.ini")
end
end
end

View File

@@ -1,30 +0,0 @@
[circus]
check_delay = 5
endpoint = tcp://127.0.0.1:5555
[watcher:app-alpha-1]
cmd = ./alpha
working_dir = /tmp/app
uid = app
stdout_stream.class = FileStream
stdout_stream.filename = /var/log/app/alpha-1.log
stderr_stream.class = FileStream
stderr_stream.filename = /var/log/app/alpha-1.error.log
copy_env = True
[env:app-alpha-1]
PORT = 5000
[watcher:app-bravo-1]
cmd = ./bravo
working_dir = /tmp/app
uid = app
stdout_stream.class = FileStream
stdout_stream.filename = /var/log/app/bravo-1.log
stderr_stream.class = FileStream
stderr_stream.filename = /var/log/app/bravo-1.error.log
copy_env = True
[env:app-bravo-1]
PORT = 5100

View File

@@ -1,30 +0,0 @@
[circus]
check_delay = 5
endpoint = tcp://127.0.0.1:5555
[watcher:app-alpha-1]
cmd = ./alpha
working_dir = /tmp/app
uid = app
stdout_stream.class = FileStream
stdout_stream.filename = /var/log/app/alpha-1.log
stderr_stream.class = FileStream
stderr_stream.filename = /var/log/app/alpha-1.error.log
copy_env = True
[env:app-alpha-1]
PORT = 5000
[watcher:app-alpha-2]
cmd = ./alpha
working_dir = /tmp/app
uid = app
stdout_stream.class = FileStream
stdout_stream.filename = /var/log/app/alpha-2.log
stderr_stream.class = FileStream
stderr_stream.filename = /var/log/app/alpha-2.error.log
copy_env = True
[env:app-alpha-2]
PORT = 5001