Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c419f8213b | ||
|
|
7f61fb61ea | ||
|
|
577a5c7c5c | ||
|
|
56940c56d9 | ||
|
|
f308ad886d | ||
|
|
55375b9bde | ||
|
|
85fcccffa8 |
@@ -1,7 +1,7 @@
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
foreman (0.16.0)
|
||||
foreman (0.17.0)
|
||||
term-ansicolor (~> 1.0.5)
|
||||
thor (>= 0.13.6)
|
||||
|
||||
|
||||
@@ -12,17 +12,18 @@ http://blog.daviddollar.org/2011/05/06/introducing-foreman.html
|
||||
|
||||
See the [man page](http://ddollar.github.com/foreman) for usage.
|
||||
|
||||
## Author
|
||||
## Authorship
|
||||
|
||||
David Dollar
|
||||
Created by David Dollar
|
||||
|
||||
## Contributors
|
||||
Patches contributed by:
|
||||
|
||||
Adam Wiggins
|
||||
clifff
|
||||
Dan Peterson
|
||||
Keith Rarick
|
||||
Ricardo Chimal, Jr
|
||||
* Adam Wiggins
|
||||
* clifff
|
||||
* Dan Peterson
|
||||
* Jay Zeschin
|
||||
* Keith Rarick
|
||||
* Ricardo Chimal, Jr
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -2,5 +2,4 @@ start on starting <%= app %>-<%= process.name %>
|
||||
stop on stopping <%= app %>-<%= process.name %>
|
||||
respawn
|
||||
|
||||
chdir <%= engine.directory %>
|
||||
exec su <%= user %> -c 'export PORT=<%= port %>; <%= process.command %> >> <%= log_root %>/<%=process.name%>-<%=num%>.log 2>&1'
|
||||
exec su - <%= user %> -c 'cd <%= engine.directory %>; export PORT=<%= port %>; <%= process.command %> >> <%= log_root %>/<%=process.name%>-<%=num%>.log 2>&1'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module Foreman
|
||||
|
||||
VERSION = "0.16.0"
|
||||
VERSION = "0.17.0"
|
||||
|
||||
end
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
require "spec_helper"
|
||||
require "foreman/engine"
|
||||
require "foreman/export/upstart"
|
||||
require "tmpdir"
|
||||
|
||||
describe Foreman::Export::Upstart do
|
||||
let(:engine) { Foreman::Engine.new(write_procfile) }
|
||||
let(:procfile) { FileUtils.mkdir_p("/tmp/app"); write_procfile("/tmp/app/Procfile") }
|
||||
let(:engine) { Foreman::Engine.new(procfile) }
|
||||
let(:upstart) { Foreman::Export::Upstart.new(engine) }
|
||||
|
||||
before(:each) { load_export_templates_into_fakefs("upstart") }
|
||||
@@ -11,12 +13,13 @@ describe Foreman::Export::Upstart do
|
||||
|
||||
it "exports to the filesystem" do
|
||||
upstart.export("/tmp/init")
|
||||
p [:d, Dir["/tmp/init/**"]]
|
||||
|
||||
File.read("/tmp/init/foreman.conf").should == example_export_file("upstart/foreman.conf")
|
||||
File.read("/tmp/init/foreman-alpha.conf").should == example_export_file("upstart/foreman-alpha.conf")
|
||||
File.read("/tmp/init/foreman-alpha-1.conf").should == example_export_file("upstart/foreman-alpha-1.conf")
|
||||
File.read("/tmp/init/foreman-alpha-2.conf").should == example_export_file("upstart/foreman-alpha-2.conf")
|
||||
File.read("/tmp/init/foreman-bravo.conf").should == example_export_file("upstart/foreman.bravo.conf")
|
||||
File.read("/tmp/init/foreman-bravo-1.conf").should == example_export_file("upstart/foreman-bravo-1.conf")
|
||||
File.read("/tmp/init/app.conf").should == example_export_file("upstart/app.conf")
|
||||
File.read("/tmp/init/app-alpha.conf").should == example_export_file("upstart/app-alpha.conf")
|
||||
File.read("/tmp/init/app-alpha-1.conf").should == example_export_file("upstart/app-alpha-1.conf")
|
||||
File.read("/tmp/init/app-alpha-2.conf").should == example_export_file("upstart/app-alpha-2.conf")
|
||||
File.read("/tmp/init/app-bravo.conf").should == example_export_file("upstart/app-bravo.conf")
|
||||
File.read("/tmp/init/app-bravo-1.conf").should == example_export_file("upstart/app-bravo-1.conf")
|
||||
end
|
||||
end
|
||||
|
||||
5
spec/resources/export/upstart/app-alpha-1.conf
Normal file
5
spec/resources/export/upstart/app-alpha-1.conf
Normal file
@@ -0,0 +1,5 @@
|
||||
start on starting app-alpha
|
||||
stop on stopping app-alpha
|
||||
respawn
|
||||
|
||||
exec su - app -c 'cd /tmp/app; export PORT=5000; ./alpha >> /var/log/app/alpha-1.log 2>&1'
|
||||
5
spec/resources/export/upstart/app-alpha-2.conf
Normal file
5
spec/resources/export/upstart/app-alpha-2.conf
Normal file
@@ -0,0 +1,5 @@
|
||||
start on starting app-alpha
|
||||
stop on stopping app-alpha
|
||||
respawn
|
||||
|
||||
exec su - app -c 'cd /tmp/app; export PORT=5001; ./alpha >> /var/log/app/alpha-2.log 2>&1'
|
||||
2
spec/resources/export/upstart/app-alpha.conf
Normal file
2
spec/resources/export/upstart/app-alpha.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
start on starting app
|
||||
stop on stopping app
|
||||
5
spec/resources/export/upstart/app-bravo-1.conf
Normal file
5
spec/resources/export/upstart/app-bravo-1.conf
Normal file
@@ -0,0 +1,5 @@
|
||||
start on starting app-bravo
|
||||
stop on stopping app-bravo
|
||||
respawn
|
||||
|
||||
exec su - app -c 'cd /tmp/app; export PORT=5100; ./bravo >> /var/log/app/bravo-1.log 2>&1'
|
||||
2
spec/resources/export/upstart/app-bravo.conf
Normal file
2
spec/resources/export/upstart/app-bravo.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
start on starting app
|
||||
stop on stopping app
|
||||
8
spec/resources/export/upstart/app.conf
Normal file
8
spec/resources/export/upstart/app.conf
Normal file
@@ -0,0 +1,8 @@
|
||||
pre-start script
|
||||
|
||||
bash << "EOF"
|
||||
mkdir -p /var/log/app
|
||||
chown -R app /var/log/app
|
||||
EOF
|
||||
|
||||
end script
|
||||
@@ -1,6 +0,0 @@
|
||||
start on starting foreman-alpha
|
||||
stop on stopping foreman-alpha
|
||||
respawn
|
||||
|
||||
chdir /Users/david/Code/foreman
|
||||
exec su foreman -c 'export PORT=5000; ./alpha >> /var/log/foreman/alpha-1.log 2>&1'
|
||||
@@ -1,6 +0,0 @@
|
||||
start on starting foreman-alpha
|
||||
stop on stopping foreman-alpha
|
||||
respawn
|
||||
|
||||
chdir /Users/david/Code/foreman
|
||||
exec su foreman -c 'export PORT=5001; ./alpha >> /var/log/foreman/alpha-2.log 2>&1'
|
||||
@@ -1,2 +0,0 @@
|
||||
start on starting foreman
|
||||
stop on stopping foreman
|
||||
@@ -1,6 +0,0 @@
|
||||
start on starting foreman-bravo
|
||||
stop on stopping foreman-bravo
|
||||
respawn
|
||||
|
||||
chdir /Users/david/Code/foreman
|
||||
exec su foreman -c 'export PORT=5100; ./bravo >> /var/log/foreman/bravo-1.log 2>&1'
|
||||
@@ -1,2 +0,0 @@
|
||||
start on starting foreman
|
||||
stop on stopping foreman
|
||||
@@ -1,8 +0,0 @@
|
||||
pre-start script
|
||||
|
||||
bash << "EOF"
|
||||
mkdir -p /var/log/foreman
|
||||
chown -R foreman /var/log/foreman
|
||||
EOF
|
||||
|
||||
end script
|
||||
Reference in New Issue
Block a user