luban-rack 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea13e5a37f9b56a8b1dfe2f174aafda0f1203c09
4
- data.tar.gz: 6422249762e63456d09496618b969614dc4262bd
3
+ metadata.gz: 5db2c3cf756af8c21ed8770721c1b72e286ad866
4
+ data.tar.gz: 1a8cc08f561ed98bff57bc805f935b3237de2dd2
5
5
  SHA512:
6
- metadata.gz: 0c4b899af232c7e531938cc500146b72510fd19095acda952bd03b90594ab6492206ccab86905008349eafcafe3326d422e4538617268fd204864a18c69b1192
7
- data.tar.gz: 4acc29ff54764af13544a825a760ae9dd047ec3e364a17807666627d0c8b6de005b7080c3f798622ecaaf320fca4c2f9a93095b8fc82e72c3a13e5a82f494c6f
6
+ metadata.gz: ed6cbca820f68ec611d7c653cb181aa1b5fbb8317966711bf95fa8e576ed4269252e50f2b727a72f5f2df6ee8f9bbdb6b884c38107776896334cd64678d85e63
7
+ data.tar.gz: 9d5e8a1b8f621f1c0a7a428d3ffa6398dab9d3123efd60b5a27f8c63e9b97f2f80fd6237bf5077ba3295e6721f2cb5471574b68d6c6ac062a12b1e64e4e391ec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change log
2
2
 
3
+ ## Version 0.2.2 (Aug 18, 2016)
4
+
5
+ Minor enhancments:
6
+ * Changed default web server from thin to puma
7
+ * Used #compose_command to support shell setup commands
8
+
3
9
  ## Version 0.2.1 (Aug 05, 2016)
4
10
 
5
11
  Bug fixes:
@@ -9,7 +9,7 @@ module Luban
9
9
 
10
10
  DefaultPort = 3000
11
11
  DefaultVirtualHost = 'localhost'
12
- DefaultWebServer = :thin
12
+ DefaultWebServer = :puma
13
13
 
14
14
  parameter :port
15
15
  parameter :virtual_host
@@ -38,11 +38,11 @@ module Luban
38
38
  end
39
39
 
40
40
  def restart_process!
41
- capture("#{restart_command} 2>&1")
41
+ capture(compose_command(restart_command))
42
42
  end
43
43
 
44
44
  def phased_restart_process!
45
- capture("#{phased_restart_command} 2>&1")
45
+ capture(compose_command(phased_restart_command))
46
46
  end
47
47
  end
48
48
  end
@@ -4,8 +4,8 @@
4
4
  check process <%= service_entry %>
5
5
  with pidfile <%= pid_file_path %>
6
6
  onreboot laststate
7
- start program = "/bin/bash -c 'sleep 1; <%= start_command %>'"
8
- stop program = "/bin/bash -c '<%= stop_command %>'"
7
+ start program = "/bin/bash -c 'sleep 1; <%= compose_command(start_command) %>'"
8
+ stop program = "/bin/bash -c '<%= compose_command(stop_command) %>'"
9
9
  if totalmem is greater than 150.0 MB for 40 cycles then alert
10
10
  <%- if tcp_socket? -%>
11
11
  if failed port <%= opts[:port] %> for 4 times within 8 cycles then restart
@@ -6,8 +6,8 @@ check process <%= service_entry %>.<%= current_web_server %>.<%= n %>
6
6
  with pidfile <%= pid_file_path(n) %>
7
7
  group <%= service_entry %>
8
8
  onreboot laststate
9
- start program = "/bin/bash -c 'sleep 1; <%= start_command %> -o <%=n %>'"
10
- stop program = "/bin/bash -c '<%= stop_command %> -o <%=n %>'"
9
+ start program = "/bin/bash -c 'sleep 1; <%= compose_command(start_command) %> -o <%=n %>'"
10
+ stop program = "/bin/bash -c '<%= compose_command(stop_command) %> -o <%=n %>'"
11
11
  if totalmem is greater than 150.0 MB for 40 cycles then alert
12
12
  <%- if tcp_socket? -%>
13
13
  if failed port <%= opts[:port] + n %> for 4 times within 8 cycles then restart
@@ -2,7 +2,7 @@ module Luban
2
2
  module Deployment
3
3
  module Applications
4
4
  class Rack
5
- VERSION = '0.2.1'
5
+ VERSION = '0.2.2'
6
6
  end
7
7
  end
8
8
  end
@@ -61,11 +61,11 @@ module Luban
61
61
  end
62
62
 
63
63
  def start_command
64
- @start_command ||= "cd #{release_path}; #{puma_command} start"
64
+ @start_command ||= "#{puma_command} start"
65
65
  end
66
66
 
67
67
  def stop_command
68
- @stop_command ||= "cd #{release_path}; #{puma_command} stop"
68
+ @stop_command ||= "#{puma_command} stop"
69
69
  end
70
70
 
71
71
  def process_pattern
@@ -143,11 +143,11 @@ module Luban
143
143
  include Common
144
144
 
145
145
  def restart_command
146
- @restart_command ||= "cd #{release_path}; #{puma_command} restart"
146
+ @restart_command ||= "#{puma_command} restart"
147
147
  end
148
148
 
149
149
  def phased_restart_command
150
- @phased_restart_command ||= "cd #{release_path}; #{puma_command} phased-restart"
150
+ @phased_restart_command ||= "#{puma_command} phased-restart"
151
151
  end
152
152
  end
153
153
  end
@@ -118,11 +118,11 @@ module Luban
118
118
  end
119
119
 
120
120
  def start_command
121
- @start_command ||= "cd #{release_path}; #{thin_command} start"
121
+ @start_command ||= "#{thin_command} start"
122
122
  end
123
123
 
124
124
  def stop_command
125
- @stop_command ||= "cd #{release_path}; #{thin_command} stop"
125
+ @stop_command ||= "#{thin_command} stop"
126
126
  end
127
127
 
128
128
  def process_pattern
@@ -148,11 +148,11 @@ module Luban
148
148
  include Common
149
149
 
150
150
  def restart_command
151
- @restart_command ||= "cd #{release_path}; #{thin_command} restart"
151
+ @restart_command ||= "#{thin_command} restart"
152
152
  end
153
153
 
154
154
  def phased_restart_command
155
- @phased_restart_command ||= "cd #{release_path}; #{thin_command} restart --onebyone"
155
+ @phased_restart_command ||= "#{thin_command} restart --onebyone"
156
156
  end
157
157
  end
158
158
  end
data/luban-rack.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.required_ruby_version = ">= 2.1.0"
23
- spec.add_dependency 'luban', ">= 0.6.8"
23
+ spec.add_dependency 'luban', ">= 0.7.0"
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.12"
26
26
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luban-rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rubyist Chi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-05 00:00:00.000000000 Z
11
+ date: 2016-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: luban
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.6.8
19
+ version: 0.7.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.6.8
26
+ version: 0.7.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement