foreman 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,17 +12,18 @@ http://blog.daviddollar.org/2011/05/06/introducing-foreman.html
12
12
 
13
13
  See the [man page](http://ddollar.github.com/foreman) for usage.
14
14
 
15
- ## Author
15
+ ## Authorship
16
16
 
17
- David Dollar
17
+ Created by David Dollar
18
18
 
19
- ## Contributors
19
+ Patches contributed by:
20
20
 
21
- Adam Wiggins
22
- clifff
23
- Dan Peterson
24
- Keith Rarick
25
- Ricardo Chimal, Jr
21
+ * Adam Wiggins
22
+ * clifff
23
+ * Dan Peterson
24
+ * Jay Zeschin
25
+ * Keith Rarick
26
+ * Ricardo Chimal, Jr
26
27
 
27
28
  ## License
28
29
 
@@ -2,5 +2,4 @@ start on starting <%= app %>-<%= process.name %>
2
2
  stop on stopping <%= app %>-<%= process.name %>
3
3
  respawn
4
4
 
5
- chdir <%= engine.directory %>
6
- exec su <%= user %> -c 'export PORT=<%= port %>; <%= process.command %> >> <%= log_root %>/<%=process.name%>-<%=num%>.log 2>&1'
5
+ exec su - <%= user %> -c 'cd <%= engine.directory %>; export PORT=<%= port %>; <%= process.command %> >> <%= log_root %>/<%=process.name%>-<%=num%>.log 2>&1'
@@ -1,5 +1,5 @@
1
1
  module Foreman
2
2
 
3
- VERSION = "0.16.0"
3
+ VERSION = "0.17.0"
4
4
 
5
5
  end
@@ -1,9 +1,11 @@
1
1
  require "spec_helper"
2
2
  require "foreman/engine"
3
3
  require "foreman/export/upstart"
4
+ require "tmpdir"
4
5
 
5
6
  describe Foreman::Export::Upstart do
6
- let(:engine) { Foreman::Engine.new(write_procfile) }
7
+ let(:procfile) { FileUtils.mkdir_p("/tmp/app"); write_procfile("/tmp/app/Procfile") }
8
+ let(:engine) { Foreman::Engine.new(procfile) }
7
9
  let(:upstart) { Foreman::Export::Upstart.new(engine) }
8
10
 
9
11
  before(:each) { load_export_templates_into_fakefs("upstart") }
@@ -11,12 +13,13 @@ describe Foreman::Export::Upstart do
11
13
 
12
14
  it "exports to the filesystem" do
13
15
  upstart.export("/tmp/init")
16
+ p [:d, Dir["/tmp/init/**"]]
14
17
 
15
- File.read("/tmp/init/foreman.conf").should == example_export_file("upstart/foreman.conf")
16
- File.read("/tmp/init/foreman-alpha.conf").should == example_export_file("upstart/foreman-alpha.conf")
17
- File.read("/tmp/init/foreman-alpha-1.conf").should == example_export_file("upstart/foreman-alpha-1.conf")
18
- File.read("/tmp/init/foreman-alpha-2.conf").should == example_export_file("upstart/foreman-alpha-2.conf")
19
- File.read("/tmp/init/foreman-bravo.conf").should == example_export_file("upstart/foreman.bravo.conf")
20
- File.read("/tmp/init/foreman-bravo-1.conf").should == example_export_file("upstart/foreman-bravo-1.conf")
18
+ File.read("/tmp/init/app.conf").should == example_export_file("upstart/app.conf")
19
+ File.read("/tmp/init/app-alpha.conf").should == example_export_file("upstart/app-alpha.conf")
20
+ File.read("/tmp/init/app-alpha-1.conf").should == example_export_file("upstart/app-alpha-1.conf")
21
+ File.read("/tmp/init/app-alpha-2.conf").should == example_export_file("upstart/app-alpha-2.conf")
22
+ File.read("/tmp/init/app-bravo.conf").should == example_export_file("upstart/app-bravo.conf")
23
+ File.read("/tmp/init/app-bravo-1.conf").should == example_export_file("upstart/app-bravo-1.conf")
21
24
  end
22
25
  end
@@ -0,0 +1,5 @@
1
+ start on starting app-alpha
2
+ stop on stopping app-alpha
3
+ respawn
4
+
5
+ exec su - app -c 'cd /tmp/app; export PORT=5000; ./alpha >> /var/log/app/alpha-1.log 2>&1'
@@ -0,0 +1,5 @@
1
+ start on starting app-alpha
2
+ stop on stopping app-alpha
3
+ respawn
4
+
5
+ exec su - app -c 'cd /tmp/app; export PORT=5001; ./alpha >> /var/log/app/alpha-2.log 2>&1'
@@ -0,0 +1,2 @@
1
+ start on starting app
2
+ stop on stopping app
@@ -0,0 +1,5 @@
1
+ start on starting app-bravo
2
+ stop on stopping app-bravo
3
+ respawn
4
+
5
+ exec su - app -c 'cd /tmp/app; export PORT=5100; ./bravo >> /var/log/app/bravo-1.log 2>&1'
@@ -0,0 +1,2 @@
1
+ start on starting app
2
+ stop on stopping app
@@ -0,0 +1,8 @@
1
+ pre-start script
2
+
3
+ bash << "EOF"
4
+ mkdir -p /var/log/app
5
+ chown -R app /var/log/app
6
+ EOF
7
+
8
+ end script
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: foreman
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.16.0
5
+ version: 0.17.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - David Dollar
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-13 00:00:00 -04:00
13
+ date: 2011-06-02 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -147,12 +147,12 @@ files:
147
147
  - spec/foreman/export_spec.rb
148
148
  - spec/foreman/process_spec.rb
149
149
  - spec/foreman_spec.rb
150
- - spec/resources/export/upstart/foreman-alpha-1.conf
151
- - spec/resources/export/upstart/foreman-alpha-2.conf
152
- - spec/resources/export/upstart/foreman-alpha.conf
153
- - spec/resources/export/upstart/foreman-bravo-1.conf
154
- - spec/resources/export/upstart/foreman.bravo.conf
155
- - spec/resources/export/upstart/foreman.conf
150
+ - spec/resources/export/upstart/app-alpha-1.conf
151
+ - spec/resources/export/upstart/app-alpha-2.conf
152
+ - spec/resources/export/upstart/app-alpha.conf
153
+ - spec/resources/export/upstart/app-bravo-1.conf
154
+ - spec/resources/export/upstart/app-bravo.conf
155
+ - spec/resources/export/upstart/app.conf
156
156
  - spec/spec_helper.rb
157
157
  - man/foreman.1
158
158
  has_rdoc: true
@@ -1,6 +0,0 @@
1
- start on starting foreman-alpha
2
- stop on stopping foreman-alpha
3
- respawn
4
-
5
- chdir /Users/david/Code/foreman
6
- exec su foreman -c 'export PORT=5000; ./alpha >> /var/log/foreman/alpha-1.log 2>&1'
@@ -1,6 +0,0 @@
1
- start on starting foreman-alpha
2
- stop on stopping foreman-alpha
3
- respawn
4
-
5
- chdir /Users/david/Code/foreman
6
- exec su foreman -c 'export PORT=5001; ./alpha >> /var/log/foreman/alpha-2.log 2>&1'
@@ -1,2 +0,0 @@
1
- start on starting foreman
2
- stop on stopping foreman
@@ -1,6 +0,0 @@
1
- start on starting foreman-bravo
2
- stop on stopping foreman-bravo
3
- respawn
4
-
5
- chdir /Users/david/Code/foreman
6
- exec su foreman -c 'export PORT=5100; ./bravo >> /var/log/foreman/bravo-1.log 2>&1'
@@ -1,2 +0,0 @@
1
- start on starting foreman
2
- stop on stopping foreman
@@ -1,8 +0,0 @@
1
- pre-start script
2
-
3
- bash << "EOF"
4
- mkdir -p /var/log/foreman
5
- chown -R foreman /var/log/foreman
6
- EOF
7
-
8
- end script