foreman 0.51.0-java → 0.52.0-java
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.
- data/bin/foreman-runner +15 -3
- data/data/export/upstart/master.conf.erb +3 -0
- data/lib/foreman/process.rb +12 -15
- data/lib/foreman/version.rb +1 -1
- data/spec/resources/export/upstart/app.conf +3 -0
- metadata +6 -6
data/bin/foreman-runner
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#!/bin/
|
1
|
+
#!/bin/bash
|
2
2
|
#
|
3
|
-
#/ Usage: foreman-runner [-d <dir>] <command> [<args>...]
|
3
|
+
#/ Usage: foreman-runner [-d <dir>] [-p] <command> [<args>...]
|
4
4
|
#/
|
5
5
|
#/ Run a command with exec, optionally changing directory first
|
6
6
|
|
@@ -16,9 +16,12 @@ usage() {
|
|
16
16
|
exit
|
17
17
|
}
|
18
18
|
|
19
|
-
|
19
|
+
read_profiled=""
|
20
|
+
|
21
|
+
while getopts ":hd:p" OPT; do
|
20
22
|
case $OPT in
|
21
23
|
d) cd "$OPTARG" ;;
|
24
|
+
p) read_profiled="1" ;;
|
22
25
|
h) usage ;;
|
23
26
|
\?) error "invalid option: -$OPTARG" ;;
|
24
27
|
:) error "option -$OPTARG requires an argument" ;;
|
@@ -29,4 +32,13 @@ shift $((OPTIND-1))
|
|
29
32
|
|
30
33
|
[ -z "$1" ] && usage
|
31
34
|
|
35
|
+
if [ "$read_profiled" == "1" ]; then
|
36
|
+
shopt -s nullglob
|
37
|
+
for script in .profile.d/*; do
|
38
|
+
echo "sourcing $script"
|
39
|
+
source $script
|
40
|
+
done
|
41
|
+
shopt -u nullglob
|
42
|
+
fi
|
43
|
+
|
32
44
|
exec "$@"
|
data/lib/foreman/process.rb
CHANGED
@@ -43,23 +43,20 @@ class Foreman::Process
|
|
43
43
|
Process.spawn env, expanded_command, :out => output, :err => output
|
44
44
|
end
|
45
45
|
elsif Foreman.jruby?
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
end
|
46
|
+
require "posix/spawn"
|
47
|
+
wrapped_command = "#{Foreman.runner} -d '#{cwd}' -p -- #{command}"
|
48
|
+
POSIX::Spawn.spawn env, wrapped_command, :out => output, :err => output
|
50
49
|
elsif Foreman.ruby_18?
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
end
|
50
|
+
fork do
|
51
|
+
$stdout.reopen output
|
52
|
+
$stderr.reopen output
|
53
|
+
env.each { |k,v| ENV[k] = v }
|
54
|
+
wrapped_command = "#{Foreman.runner} -d '#{cwd}' -p -- #{command}"
|
55
|
+
exec wrapped_command
|
58
56
|
end
|
59
57
|
else
|
60
|
-
|
61
|
-
|
62
|
-
end
|
58
|
+
wrapped_command = "#{Foreman.runner} -d '#{cwd}' -p -- #{command}"
|
59
|
+
Process.spawn env, wrapped_command, :out => output, :err => output
|
63
60
|
end
|
64
61
|
end
|
65
62
|
|
@@ -96,7 +93,7 @@ class Foreman::Process
|
|
96
93
|
private
|
97
94
|
|
98
95
|
def cwd
|
99
|
-
@options[:cwd] || "."
|
96
|
+
File.expand_path(@options[:cwd] || ".")
|
100
97
|
end
|
101
98
|
|
102
99
|
end
|
data/lib/foreman/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.52.0
|
5
5
|
prerelease:
|
6
6
|
platform: java
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
16
|
-
requirement: &
|
16
|
+
requirement: &70211491658580 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.13.6
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70211491658580
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: posix-spawn
|
27
|
-
requirement: &
|
27
|
+
requirement: &70211491674340 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 0.3.6
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70211491674340
|
36
36
|
description: Process manager for applications with multiple components
|
37
37
|
email: ddollar@gmail.com
|
38
38
|
executables:
|