Compare commits

...
10 Commits
Author SHA1 Message Date
David Dollar bda6e30323 0.20.0 2011-08-22 17:27:50 -04:00
David Dollar ffd77312bb Merge pull request #53 from matth/master
Blank line in Procfile breaks Foreman
2011-08-22 14:27:03 -07:00
David Dollar a24c4ce17b Merge pull request #47 from minhajuddin/master
A little convention over configuration love.
2011-08-22 14:23:43 -07:00
David Dollar cf3d7a0b12 Merge pull request #55 from caos/master
Fix for "..../lib/foreman/engine.rb:117:in `eof?': Input/output error - /dev/pts/n (Errno::EIO)" errors
2011-08-22 14:19:40 -07:00
David Dollar 6ad344d214 consistency 2011-08-18 12:54:17 -04:00
David Dollar 3b8fec463d update manual to mention .env 2011-08-18 12:52:03 -04:00
Mike Javorski 4e015b7436 add Errno::EIO to list of rescued exceptions as underlying pts can close before shutdown is complete
Possibly relates to GitHub Issue #40.
2011-08-11 11:59:51 -07:00
Matt Haynes 2042de7732 Fix bug where blank lines in Procfile break Foreman. 2011-07-28 11:40:31 +01:00
Khaja Minhajuddin 64338c5a09 use a dedicated directory (~/.foreman/templates) to store the templates 2011-06-30 22:23:38 +05:30
Khaja Minhajuddin 8cef71766c tweaked the upstart export code so that it looks for templates in ~/.foreman if no template_root is specified. 2011-06-30 21:50:12 +05:30
8 changed files with 50 additions and 10 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
PATH PATH
remote: . remote: .
specs: specs:
foreman (0.19.0) foreman (0.20.0)
term-ansicolor (~> 1.0.5) term-ansicolor (~> 1.0.5)
thor (>= 0.13.6) thor (>= 0.13.6)
@@ -36,7 +36,7 @@ GEM
rspec-expectations (2.6.0) rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2) diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0) rspec-mocks (2.6.0)
term-ansicolor (1.0.5) term-ansicolor (1.0.6)
thor (0.14.6) thor (0.14.6)
PLATFORMS PLATFORMS
+2 -2
View File
@@ -25,7 +25,7 @@ class Foreman::Engine
@processes ||= begin @processes ||= begin
@order = [] @order = []
procfile.split("\n").inject({}) do |hash, line| procfile.split("\n").inject({}) do |hash, line|
next if line.strip == "" next hash if line.strip == ""
name, command = line.split(/ *: +/, 2) name, command = line.split(/ *: +/, 2)
unless command unless command
warn_deprecated_procfile! warn_deprecated_procfile!
@@ -119,7 +119,7 @@ private ######################################################################
end end
end end
end end
rescue PTY::ChildExited, Interrupt rescue PTY::ChildExited, Interrupt, Errno::EIO
begin begin
info "process exiting", process info "process exiting", process
rescue Interrupt rescue Interrupt
+2
View File
@@ -26,6 +26,8 @@ private ######################################################################
def export_template(exporter, file, template_root) def export_template(exporter, file, template_root)
if template_root && File.exist?(file_path = File.join(template_root, file)) if template_root && File.exist?(file_path = File.join(template_root, file))
File.read(file_path) File.read(file_path)
elsif File.exist?(file_path = File.join("~/.foreman/templates", file))
File.read(file_path)
else else
File.read(File.expand_path("../../../../data/export/#{exporter}/#{file}", __FILE__)) File.read(File.expand_path("../../../../data/export/#{exporter}/#{file}", __FILE__))
end end
+1 -1
View File
@@ -1,5 +1,5 @@
module Foreman module Foreman
VERSION = "0.19.0" VERSION = "0.20.0"
end end
+16 -2
View File
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "FOREMAN" "1" "May 2011" "Foreman 0.15.0" "Foreman Manual" .TH "FOREMAN" "1" "August 2011" "Foreman 0.19.0" "Foreman Manual"
. .
.SH "NAME" .SH "NAME"
\fBforeman\fR \- manage Procfile\-based applications \fBforeman\fR \- manage Procfile\-based applications
@@ -69,7 +69,7 @@ These options control all modes of foreman\'s operation\.
. .
.TP .TP
\fB\-e\fR, \fB\-\-env\fR \fB\-e\fR, \fB\-\-env\fR
Specify a file containing the environment that should be set up for each child process\. The file should be key/value pairs separated by \fB=\fR, with one key/value pair per line\. Specify an alternate environment file\.
. .
.TP .TP
\fB\-f\fR, \fB\-\-procfile\fR \fB\-f\fR, \fB\-\-procfile\fR
@@ -141,6 +141,20 @@ $ foreman check
. .
.IP "" 0 .IP "" 0
. .
.SH "ENVIRONMENT"
If a \fB\.env\fR file exists in the current directory, the default environment will be read from it\. This file should contain key/value pairs, separated by \fB=\fR, with one key/value pair per line\.
.
.IP "" 4
.
.nf
FOO=bar
BAZ=qux
.
.fi
.
.IP "" 0
.
.SH "DEFAULT OPTIONS" .SH "DEFAULT OPTIONS"
If a \fB\.foreman\fR file exists in the current directory, default options will be read from it\. This file should be in YAML format with the long option name as keys\. Example: If a \fB\.foreman\fR file exists in the current directory, default options will be read from it\. This file should be in YAML format with the long option name as keys\. Example:
. .
+10 -3
View File
@@ -67,9 +67,7 @@ The following options control how the application is run:
These options control all modes of foreman's operation. These options control all modes of foreman's operation.
* `-e`, `--env`: * `-e`, `--env`:
Specify a file containing the environment that should be set up for each Specify an alternate environment file.
child process. The file should be key/value pairs separated by `=`, with
one key/value pair per line.
* `-f`, `--procfile`: * `-f`, `--procfile`:
Specify an alternate location for the application's Procfile. This file's Specify an alternate location for the application's Procfile. This file's
@@ -116,6 +114,15 @@ You can validate your Procfile format using the `check` command
$ foreman check $ foreman check
## ENVIRONMENT
If a `.env` file exists in the current directory, the default environment will
be read from it. This file should contain key/value pairs, separated by `=`, with
one key/value pair per line.
FOO=bar
BAZ=qux
## DEFAULT OPTIONS ## DEFAULT OPTIONS
If a `.foreman` file exists in the current directory, default options will If a `.foreman` file exists in the current directory, default options will
+16
View File
@@ -36,4 +36,20 @@ describe Foreman::Export::Upstart do
File.read("/tmp/init/app.conf").should == "alternate_template\n" File.read("/tmp/init/app.conf").should == "alternate_template\n"
end end
end end
context "with alternate templates from home dir" do
let(:default_template_root) {File.expand_path("~/.foreman/templates")}
before do
FileUtils.mkdir_p default_template_root
File.open("#{default_template_root}/master.conf.erb", "w") { |f| f.puts "default_alternate_template" }
end
it "can export with alternate template files" do
upstart.export("/tmp/init")
File.read("/tmp/init/app.conf").should == "default_alternate_template\n"
end
end
end end
+1
View File
@@ -27,6 +27,7 @@ end
def write_procfile(procfile="Procfile") def write_procfile(procfile="Procfile")
File.open(procfile, "w") do |file| File.open(procfile, "w") do |file|
file.puts "alpha: ./alpha" file.puts "alpha: ./alpha"
file.puts "\n"
file.puts "bravo: ./bravo" file.puts "bravo: ./bravo"
end end
File.expand_path(procfile) File.expand_path(procfile)