Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
501bc138c5 | ||
|
|
df8c05cd6c | ||
|
|
edcc4f3567 | ||
|
|
3759dbb463 | ||
|
|
b673931c05 | ||
|
|
137e43b040 | ||
|
|
79211d9bbf | ||
|
|
16d4b84a5d | ||
|
|
5ea4537046 | ||
|
|
d51433ff82 | ||
|
|
54ab74d305 | ||
|
|
e8b8f34f41 | ||
|
|
7535f1d3d8 | ||
|
|
3af0dfb4ae | ||
|
|
78547b8175 | ||
|
|
976fbc0bb0 | ||
|
|
28a9aa774f | ||
|
|
51f5ff3842 | ||
|
|
e1e18f62bb | ||
|
|
0a09117328 | ||
|
|
c3df12746f | ||
|
|
2ec6a23fb3 | ||
|
|
0d6b784de1 | ||
|
|
2dcd2c03db | ||
|
|
9d6d0bbb7d |
@@ -1,4 +1,5 @@
|
|||||||
/.bundle
|
/.bundle
|
||||||
|
/.rbenv-version
|
||||||
/coverage
|
/coverage
|
||||||
/example/log/*
|
/example/log/*
|
||||||
/man/*.html
|
/man/*.html
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
script: bundle exec rake spec
|
script: bundle exec rake spec
|
||||||
|
|
||||||
env: JRUBY_OPTS="--debug -X+O"
|
|
||||||
|
|
||||||
rvm:
|
rvm:
|
||||||
- 1.8.7
|
- 1.8.7
|
||||||
- 1.9.2
|
- 1.9.2
|
||||||
- 1.9.3
|
- 1.9.3
|
||||||
- jruby-head
|
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
## 0.38.0 (2012-02-02)
|
||||||
|
|
||||||
|
* bring back single process starting [David Dollar]
|
||||||
|
* more attempts at getting ci working with jruby [David Dollar]
|
||||||
|
* ignore .rbenv-version [David Dollar]
|
||||||
|
* force to binary encoding if supported [David Dollar]
|
||||||
|
|
||||||
## 0.37.2 (2012-01-29)
|
## 0.37.2 (2012-01-29)
|
||||||
|
|
||||||
* handle directories with spaces in runner [David Dollar]
|
* handle directories with spaces in runner [David Dollar]
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ platform :jruby do
|
|||||||
end
|
end
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
|
gem 'aws-s3'
|
||||||
gem 'parka'
|
gem 'parka'
|
||||||
gem 'rake'
|
gem 'rake'
|
||||||
gem 'ronn'
|
gem 'ronn'
|
||||||
|
|||||||
+10
-3
@@ -1,18 +1,23 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
foreman (0.37.2)
|
foreman (0.39.0)
|
||||||
term-ansicolor (~> 1.0.7)
|
term-ansicolor (~> 1.0.7)
|
||||||
thor (>= 0.13.6)
|
thor (>= 0.13.6)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: http://rubygems.org/
|
remote: http://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
|
aws-s3 (0.6.2)
|
||||||
|
builder
|
||||||
|
mime-types
|
||||||
|
xml-simple
|
||||||
|
builder (3.0.0)
|
||||||
crack (0.1.8)
|
crack (0.1.8)
|
||||||
diff-lcs (1.1.3)
|
diff-lcs (1.1.3)
|
||||||
fakefs (0.3.2)
|
fakefs (0.3.2)
|
||||||
hpricot (0.8.2)
|
hpricot (0.8.6)
|
||||||
hpricot (0.8.2-java)
|
hpricot (0.8.6-java)
|
||||||
mime-types (1.16)
|
mime-types (1.16)
|
||||||
multi_json (1.0.4)
|
multi_json (1.0.4)
|
||||||
mustache (0.11.2)
|
mustache (0.11.2)
|
||||||
@@ -45,6 +50,7 @@ GEM
|
|||||||
term-ansicolor (1.0.7)
|
term-ansicolor (1.0.7)
|
||||||
thor (0.14.6)
|
thor (0.14.6)
|
||||||
win32console (1.3.0-x86-mingw32)
|
win32console (1.3.0-x86-mingw32)
|
||||||
|
xml-simple (1.0.15)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
java
|
java
|
||||||
@@ -52,6 +58,7 @@ PLATFORMS
|
|||||||
x86-mingw32
|
x86-mingw32
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
|
aws-s3
|
||||||
fakefs (~> 0.3.2)
|
fakefs (~> 0.3.2)
|
||||||
foreman!
|
foreman!
|
||||||
parka
|
parka
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ Manage Procfile-based applications
|
|||||||
David Dollar
|
David Dollar
|
||||||
|
|
||||||
#### Patches contributed by
|
#### Patches contributed by
|
||||||
Adam Wiggins, Chris Continanza, Chris Lowder, Craig R Webster, Dan Farina, Dan Peterson, David Dollar, Fletcher Nichol, Florian Apolloner, Gabriel Burt, Gamaliel Toro, Greg Reinacker, Hugues Le Gendre, Hunter Nield, Iain Hecker, Jay Zeschin, Keith Rarick, Khaja Minhajuddin, Lincoln Stoll, Marcos Muino Garcia, Mark McGranaghan, Matt Griffin, Matt Haynes, Matthijs Langenberg, Michael Dwan, Michael van Rooijen, Mike Javorski, Nathan Broadbent, Nathan L Smith, Nick Zadrozny, Phil Hagelberg, Ricardo Chimal, Jr, Thom May, Tom Ward, brainopia, clifff, jc00ke
|
Adam Wiggins, Chris Continanza, Chris Lowder, Craig R Webster, Dan Farina, Dan Peterson, David Dollar, Fletcher Nichol, Florian Apolloner, Gabriel Burt, Gamaliel Toro, Greg Reinacker, Hugues Le Gendre, Hunter Nield, Iain Hecker, Jay Zeschin, John Firebaugh, Keith Rarick, Khaja Minhajuddin, Lincoln Stoll, Marcos Muino Garcia, Mark McGranaghan, Matt Griffin, Matt Haynes, Matthijs Langenberg, Michael Dwan, Michael van Rooijen, Mike Javorski, Nathan Broadbent, Nathan L Smith, Nick Zadrozny, Phil Hagelberg, Ricardo Chimal, Jr, Thom May, Tom Ward, brainopia, clifff, jc00ke
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
$:.unshift File.expand_path("../lib", __FILE__)
|
$:.unshift File.expand_path("../lib", __FILE__)
|
||||||
require "foreman"
|
require "foreman"
|
||||||
|
|
||||||
|
require "bundler/setup"
|
||||||
|
|
||||||
Dir[File.expand_path("../tasks/*.rake", __FILE__)].each do |task|
|
Dir[File.expand_path("../tasks/*.rake", __FILE__)].each do |task|
|
||||||
load task
|
load task
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
#/ Usage: runner [-d <dir>] <command>
|
#/ Usage: foreman-runner [-d <dir>] <command>
|
||||||
#/
|
#/
|
||||||
#/ Run a command with exec, optionally changing directory first
|
#/ Run a command with exec, optionally changing directory first
|
||||||
|
|
||||||
Vendored
+1
-1
@@ -4,7 +4,7 @@ file pkg("/apt-#{version}/foreman-#{version}.deb") => distribution_files("deb")
|
|||||||
assemble_distribution
|
assemble_distribution
|
||||||
assemble_gems
|
assemble_gems
|
||||||
assemble resource("deb/foreman"), "bin/foreman", 0755
|
assemble resource("deb/foreman"), "bin/foreman", 0755
|
||||||
File.chmod 0755, "bin/runner"
|
File.chmod 0755, "bin/foreman-runner"
|
||||||
end
|
end
|
||||||
|
|
||||||
assemble resource("deb/control"), "control"
|
assemble resource("deb/control"), "control"
|
||||||
|
|||||||
Vendored
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
file pkg("foreman-#{version}-jruby.gem") => distribution_files do |t|
|
file pkg("foreman-#{version}-jruby.gem") => distribution_files do |t|
|
||||||
sh "env PLATFORM=java gem build foreman.gemspec"
|
Bundler.with_clean_env do
|
||||||
|
sh "env PLATFORM=java gem build foreman.gemspec"
|
||||||
|
end
|
||||||
sh "mv foreman-#{version}-java.gem #{t.name}"
|
sh "mv foreman-#{version}-java.gem #{t.name}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Vendored
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
file pkg("foreman-#{version}-mingw32.gem") => distribution_files do |t|
|
file pkg("foreman-#{version}-mingw32.gem") => distribution_files do |t|
|
||||||
sh "env PLATFORM=mingw32 gem build foreman.gemspec"
|
Bundler.with_clean_env do
|
||||||
|
sh "env PLATFORM=mingw32 gem build foreman.gemspec"
|
||||||
|
end
|
||||||
sh "mv foreman-#{version}-mingw32.gem #{t.name}"
|
sh "mv foreman-#{version}-mingw32.gem #{t.name}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Vendored
+8
-7
@@ -13,7 +13,7 @@ file pkg("foreman-#{version}.pkg") => distribution_files do |t|
|
|||||||
|
|
||||||
mkdir_p "pkg"
|
mkdir_p "pkg"
|
||||||
mkdir_p "pkg/Resources"
|
mkdir_p "pkg/Resources"
|
||||||
mkdir_p "pkg/foreman-#{version}.pkg"
|
mkdir_p "pkg/foreman.pkg"
|
||||||
|
|
||||||
dist = File.read(resource("pkg/Distribution.erb"))
|
dist = File.read(resource("pkg/Distribution.erb"))
|
||||||
dist = ERB.new(dist).result(binding)
|
dist = ERB.new(dist).result(binding)
|
||||||
@@ -21,20 +21,21 @@ file pkg("foreman-#{version}.pkg") => distribution_files do |t|
|
|||||||
|
|
||||||
dist = File.read(resource("pkg/PackageInfo.erb"))
|
dist = File.read(resource("pkg/PackageInfo.erb"))
|
||||||
dist = ERB.new(dist).result(binding)
|
dist = ERB.new(dist).result(binding)
|
||||||
File.open("pkg/foreman-#{version}.pkg/PackageInfo", "w") { |f| f.puts dist }
|
File.open("pkg/foreman.pkg/PackageInfo", "w") { |f| f.puts dist }
|
||||||
|
|
||||||
mkdir_p "pkg/foreman-#{version}.pkg/Scripts"
|
mkdir_p "pkg/foreman.pkg/Scripts"
|
||||||
cp resource("pkg/postinstall"), "pkg/foreman-#{version}.pkg/Scripts/postinstall"
|
cp resource("pkg/postinstall"), "pkg/foreman.pkg/Scripts/postinstall"
|
||||||
chmod 0755, "pkg/foreman-#{version}.pkg/Scripts/postinstall"
|
chmod 0755, "pkg/foreman.pkg/Scripts/postinstall"
|
||||||
|
|
||||||
sh %{ mkbom -s foreman pkg/foreman-#{version}.pkg/Bom }
|
sh %{ mkbom -s foreman pkg/foreman.pkg/Bom }
|
||||||
|
|
||||||
Dir.chdir("foreman") do
|
Dir.chdir("foreman") do
|
||||||
sh %{ pax -wz -x cpio . > ../pkg/foreman-#{version}.pkg/Payload }
|
sh %{ pax -wz -x cpio . > ../pkg/foreman.pkg/Payload }
|
||||||
end
|
end
|
||||||
|
|
||||||
sh %{ pkgutil --flatten pkg foreman-#{version}.pkg }
|
sh %{ pkgutil --flatten pkg foreman-#{version}.pkg }
|
||||||
|
|
||||||
|
FileUtils.mkdir_p(File.dirname(t.name))
|
||||||
cp_r "foreman-#{version}.pkg", t.name
|
cp_r "foreman-#{version}.pkg", t.name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Vendored
+3
-3
@@ -10,14 +10,14 @@
|
|||||||
]]></script>
|
]]></script>
|
||||||
<choices-outline>
|
<choices-outline>
|
||||||
<line choice="git"/>
|
<line choice="git"/>
|
||||||
<line choice="foreman-<%= version %>"/>
|
<line choice="foreman"/>
|
||||||
</choices-outline>
|
</choices-outline>
|
||||||
<choice id="git" title="git" start_selected="false" start_enabled="false" selected="needs_git()" enabled="needs_git()">
|
<choice id="git" title="git" start_selected="false" start_enabled="false" selected="needs_git()" enabled="needs_git()">
|
||||||
<pkg-ref id="git.pkg" />
|
<pkg-ref id="git.pkg" />
|
||||||
</choice>
|
</choice>
|
||||||
<choice id="foreman-<%= version %>" title="foreman">
|
<choice id="foreman" title="foreman">
|
||||||
<pkg-ref id="io.foreman.installer"/>
|
<pkg-ref id="io.foreman.installer"/>
|
||||||
</choice>
|
</choice>
|
||||||
<pkg-ref id="io.foreman.installer" installKBytes="<%= kbytes %>" version="<%= version %>" auth="Root">#foreman-<%= version %>.pkg</pkg-ref>
|
<pkg-ref id="io.foreman.installer" installKBytes="<%= kbytes %>" version="<%= version %>" auth="Root">#foreman.pkg</pkg-ref>
|
||||||
</installer-script>
|
</installer-script>
|
||||||
|
|
||||||
|
|||||||
Vendored
-1
@@ -4,4 +4,3 @@
|
|||||||
<postinstall file="./postinstall"/>
|
<postinstall file="./postinstall"/>
|
||||||
</scripts>
|
</scripts>
|
||||||
</pkg-info>
|
</pkg-info>
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -3,7 +3,7 @@ file pkg("foreman-#{version}.tgz") => distribution_files do |t|
|
|||||||
mkchdir("foreman") do
|
mkchdir("foreman") do
|
||||||
assemble_distribution
|
assemble_distribution
|
||||||
assemble_gems
|
assemble_gems
|
||||||
rm_rf "bin"
|
rm_f "bin/foreman"
|
||||||
assemble resource("tgz/foreman"), "foreman", 0755
|
assemble resource("tgz/foreman"), "foreman", 0755
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ module Foreman
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.runner
|
def self.runner
|
||||||
File.expand_path("../../bin/runner", __FILE__)
|
File.expand_path("../../bin/foreman-runner", __FILE__)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.jruby?
|
def self.jruby?
|
||||||
|
|||||||
+3
-2
@@ -10,7 +10,7 @@ class Foreman::CLI < Thor
|
|||||||
|
|
||||||
class_option :procfile, :type => :string, :aliases => "-f", :desc => "Default: Procfile"
|
class_option :procfile, :type => :string, :aliases => "-f", :desc => "Default: Procfile"
|
||||||
|
|
||||||
desc "start", "Start the application"
|
desc "start [PROCESS]", "Start the application (or a specific PROCESS)"
|
||||||
|
|
||||||
class_option :procfile, :type => :string, :aliases => "-f", :desc => "Default: Procfile"
|
class_option :procfile, :type => :string, :aliases => "-f", :desc => "Default: Procfile"
|
||||||
class_option :app_root, :type => :string, :aliases => "-d", :desc => "Default: Procfile directory"
|
class_option :app_root, :type => :string, :aliases => "-d", :desc => "Default: Procfile directory"
|
||||||
@@ -27,8 +27,9 @@ class Foreman::CLI < Thor
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def start
|
def start(process=nil)
|
||||||
check_procfile!
|
check_procfile!
|
||||||
|
engine.options[:concurrency] = "#{process}=1" if process
|
||||||
engine.start
|
engine.start
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class Foreman::Engine
|
|||||||
def initialize(procfile, options={})
|
def initialize(procfile, options={})
|
||||||
@procfile = Foreman::Procfile.new(procfile)
|
@procfile = Foreman::Procfile.new(procfile)
|
||||||
@directory = options[:app_root] || File.expand_path(File.dirname(procfile))
|
@directory = options[:app_root] || File.expand_path(File.dirname(procfile))
|
||||||
@options = options
|
@options = options.dup
|
||||||
@environment = read_environment_files(options[:env])
|
@environment = read_environment_files(options[:env])
|
||||||
@output_mutex = Mutex.new
|
@output_mutex = Mutex.new
|
||||||
end
|
end
|
||||||
@@ -99,6 +99,7 @@ private ######################################################################
|
|||||||
(rs || []).each do |r|
|
(rs || []).each do |r|
|
||||||
data = r.gets
|
data = r.gets
|
||||||
next unless data
|
next unless data
|
||||||
|
data.force_encoding("BINARY") if data.respond_to?(:force_encoding)
|
||||||
ps, message = data.split(",", 2)
|
ps, message = data.split(",", 2)
|
||||||
color = colors[ps.split(".").first]
|
color = colors[ps.split(".").first]
|
||||||
info message, ps, color
|
info message, ps, color
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
module Foreman
|
module Foreman
|
||||||
|
|
||||||
VERSION = "0.37.2"
|
VERSION = "0.39.0"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ require "foreman/cli"
|
|||||||
|
|
||||||
describe "Foreman::CLI", :fakefs do
|
describe "Foreman::CLI", :fakefs do
|
||||||
subject { Foreman::CLI.new }
|
subject { Foreman::CLI.new }
|
||||||
|
let(:engine) { subject.send(:engine) }
|
||||||
|
let(:entries) { engine.procfile.entries.inject({}) { |h,e| h.update(e.name => e) } }
|
||||||
|
|
||||||
describe "start" do
|
describe "start" do
|
||||||
describe "with a non-existent Procfile" do
|
describe "with a non-existent Procfile" do
|
||||||
@@ -22,6 +24,15 @@ describe "Foreman::CLI", :fakefs do
|
|||||||
mock.instance_of(Foreman::Engine).start
|
mock.instance_of(Foreman::Engine).start
|
||||||
subject.start
|
subject.start
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "can run a single process" do
|
||||||
|
dont_allow(subject).error
|
||||||
|
stub(engine).watch_for_output
|
||||||
|
stub(engine).watch_for_termination
|
||||||
|
mock(entries["alpha"]).spawn(1, is_a(IO), engine.directory, {}, 5000) { [] }
|
||||||
|
mock(entries["bravo"]).spawn(0, is_a(IO), engine.directory, {}, 5100) { [] }
|
||||||
|
subject.start("alpha")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ require "foreman/engine"
|
|||||||
describe "Foreman::Engine", :fakefs do
|
describe "Foreman::Engine", :fakefs do
|
||||||
subject { Foreman::Engine.new("Procfile", {}) }
|
subject { Foreman::Engine.new("Procfile", {}) }
|
||||||
|
|
||||||
|
before do
|
||||||
|
any_instance_of(Foreman::Engine) do |engine|
|
||||||
|
stub(engine).proctitle
|
||||||
|
stub(engine).termtitle
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "initialize" do
|
describe "initialize" do
|
||||||
describe "without an existing Procfile" do
|
describe "without an existing Procfile" do
|
||||||
it "raises an error" do
|
it "raises an error" do
|
||||||
@@ -95,7 +102,7 @@ describe "Foreman::Engine", :fakefs do
|
|||||||
stub(subject).watch_for_output
|
stub(subject).watch_for_output
|
||||||
stub(subject).watch_for_termination
|
stub(subject).watch_for_termination
|
||||||
subject.start
|
subject.start
|
||||||
sleep 1
|
Process.waitall
|
||||||
mock(subject).info(/started with pid \d+/, "utf8.1", anything)
|
mock(subject).info(/started with pid \d+/, "utf8.1", anything)
|
||||||
mock(subject).info("\xff\x03\n", "utf8.1", anything)
|
mock(subject).info("\xff\x03\n", "utf8.1", anything)
|
||||||
subject.send(:poll_readers)
|
subject.send(:poll_readers)
|
||||||
|
|||||||
Reference in New Issue
Block a user