rsm 0.1.10 → 0.1.11
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/CHANGES.md +5 -0
- data/VERSION +1 -1
- data/lib/tasks/install/rails.rb +25 -1
- data/lib/tasks/thin/restart.rb +1 -1
- data/lib/tasks/thin/start.rb +1 -1
- data/lib/tasks/thin/stop.rb +1 -1
- data/templates/rsm/install/rails/unicorn.rb.erb +4 -2
- metadata +2 -2
data/CHANGES.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.11
|
data/lib/tasks/install/rails.rb
CHANGED
@@ -2,6 +2,8 @@ module Rsm
|
|
2
2
|
module Install
|
3
3
|
class Rails < Rsm::Base
|
4
4
|
|
5
|
+
attr_reader :socket, :host, :port
|
6
|
+
|
5
7
|
class_option :user, :aliases => "-u", :default => "git", :desc => "Owners's user"
|
6
8
|
class_option :group, :aliases => "-g", :default => "git", :desc => "Owners's group"
|
7
9
|
|
@@ -9,6 +11,10 @@ module Rsm
|
|
9
11
|
class_option :tgz, :desc => "Install from TGZ (tar.gz)"
|
10
12
|
class_option :tbz2, :desc => "Install from TBZ2 (tar.bz2)"
|
11
13
|
|
14
|
+
class_option :socket, :aliases => "-S", :type => :boolean, :defualt => false, :desc => "Use socket"
|
15
|
+
class_option :host, :aliases => "-h", :default => "127.0.0.1", :desc => "Application server host binding"
|
16
|
+
class_option :port, :aliases => "-p", :default => 3000, :desc => "Application server port binding"
|
17
|
+
|
12
18
|
def download
|
13
19
|
empty_directory "."
|
14
20
|
inside application_root do
|
@@ -26,14 +32,32 @@ module Rsm
|
|
26
32
|
end
|
27
33
|
end
|
28
34
|
|
35
|
+
def define_vars
|
36
|
+
@socket = options[:socket]
|
37
|
+
@host = options[:host]
|
38
|
+
@port = options[:port]
|
39
|
+
end
|
40
|
+
|
29
41
|
def unicorn_config
|
30
42
|
template "unicorn.rb.erb", "config/unicorn.rb"
|
31
43
|
end
|
32
44
|
remove_task :unicorn_config
|
33
45
|
|
34
46
|
def thin_config
|
47
|
+
env = options[:environment]
|
35
48
|
inside "." do
|
36
|
-
|
49
|
+
cmd = "thin config -C config/thin.#{env}.yml -s #{options[:worker_processes]} -e #{env} -l log/thin.#{env}.log -P tmp/pids/thin.#{env}.pid"
|
50
|
+
if socket
|
51
|
+
cmd << " -S tmp/sockets/thin.#{env}.sock"
|
52
|
+
else
|
53
|
+
if host
|
54
|
+
cmd << " -a #{host}"
|
55
|
+
end
|
56
|
+
if port
|
57
|
+
cmd << " -p #{port}"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
run_with_bundler cmd
|
37
61
|
end
|
38
62
|
end
|
39
63
|
remove_task :thin_config
|
data/lib/tasks/thin/restart.rb
CHANGED
data/lib/tasks/thin/start.rb
CHANGED
data/lib/tasks/thin/stop.rb
CHANGED
@@ -27,8 +27,10 @@ working_directory "<%= application_root %>/" # available in 0.94.0+
|
|
27
27
|
|
28
28
|
# listen on both a Unix domain socket and a TCP port,
|
29
29
|
# we use a shorter backlog for quicker failover when busy
|
30
|
-
|
31
|
-
|
30
|
+
|
31
|
+
<%- if socket -%>listen "<%= application_root %>/tmp/sockets/unicorn.#{environment}.sock", :backlog => 64
|
32
|
+
<%- else -%>listen "<%= host %>:<%= port %>", :tcp_nopush => true
|
33
|
+
<%- end -%>
|
32
34
|
|
33
35
|
# nuke workers after 30 seconds instead of 60 seconds (the default)
|
34
36
|
timeout 30
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rsm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.11
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Oleksandr Ulianytskyi
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-10-
|
13
|
+
date: 2011-10-31 00:00:00 +02:00
|
14
14
|
default_executable: rsm
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|