foreman-upstart-scaling 0.2 → 0.3
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.
@@ -55,11 +55,14 @@ script
|
|
55
55
|
|
56
56
|
# store ENV, as `sudo -i` don't preserve it
|
57
57
|
|
58
|
-
|
58
|
+
envfile=$(mktemp)
|
59
|
+
echo "PORT=$PORT <%= app.upcase %>_<%= process.name.upcase %>_INSTANCE=$<%= app.upcase %>_<%= process.name.upcase %>_INSTANCE<% engine.environment.each_pair do |var,value| %> <%= var.upcase %>=<%= value %><% end %>" > $envfile
|
60
|
+
chmod 0700 $envfile
|
61
|
+
chown <%= user %> $envfile
|
59
62
|
|
60
63
|
# Run the service in the usual way. Our output is already
|
61
64
|
# going to the fifos; that won't change when the new
|
62
65
|
# program executes.
|
63
|
-
exec sudo -u <%= user %> $(cat
|
66
|
+
exec sudo -u <%= user %> $(envline=$(cat $envfile); rm -f $envfile; echo $envline) -i '<%= process.command %>'
|
64
67
|
end script
|
65
68
|
|
@@ -32,6 +32,7 @@ class Foreman::Export::UpstartScaling < Foreman::Export::Base
|
|
32
32
|
process_instances_config = ERB.new(process_instances_template).result(binding)
|
33
33
|
write_file "#{location}/#{app}-#{process.name}-instances.conf", process_instances_config
|
34
34
|
|
35
|
+
port = self.port
|
35
36
|
process_template = export_template("upstart_scaling", "process.conf.erb", template_root)
|
36
37
|
process_config = ERB.new(process_template).result(binding)
|
37
38
|
write_file "#{location}/#{app}-#{process.name}-instance.conf", process_config
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman-upstart-scaling
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-08 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: foreman
|
16
|
-
requirement: &
|
16
|
+
requirement: &70309399709520 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 0.46.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70309399709520
|
25
25
|
description: Upstart exporter for foreman, that supports worker scaling via env vars.
|
26
26
|
email: fabio.kung@gmail.com
|
27
27
|
executables: []
|