luban 0.6.1 → 0.6.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: aad609d3b76333f4673f7851c43f1d5412d36edd
4
- data.tar.gz: 45e4da3e1f8f785320562b414f62fff7d100e048
3
+ metadata.gz: 226a7a454e9e2362810972688ba0c29d44a0efd5
4
+ data.tar.gz: 773a1081ce6c7ccdc380114d51a3c1f01dae99ac
5
5
  SHA512:
6
- metadata.gz: 8cc42f3e6cf39cb53af1e1ff023d4e883358e3243bafaa44666f09350b1be4e7daccfc90e27d9a8636c74a559b64d3112b26a726b66521b75e60125ffb712ddc
7
- data.tar.gz: c687a78ff0a2f69ba6765fc821c982a4a62850bfffb081041455f6d126b40383e6d75928adb35bf043509ab55ac8c9f0791a516ac30b17b488d4879c3ebb71e8
6
+ metadata.gz: 53f78a7483a74750790f11e02440332bafcdb6dadb688deff9ce044ac8fc8d4d344d2d0ef26a48e212f60cf5c9cfaffae0ddfccd9491345ee453b3c0f2b3e881
7
+ data.tar.gz: 973ba8cce91e3df4d9248c8f6e50c9defeaadd58f1efc38923cbb7296a03fff5c48526b3669cb30389480c985d042cc653f116b1b70af37c02832a1fe83dcaf1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Change log
2
2
 
3
+ ## Version 0.6.2 (Jul 14, 2016)
4
+
5
+ New features:
6
+ * Automatically reload process monitor before start any apps/services to ensure process monitor has the most updated process monitoring configurations
7
+
8
+ Minor enhancements:
9
+ * Added convenient methods to look up project/application instances
10
+ * Added a convenient method to get current app path/symlink
11
+
12
+ Bug fixes:
13
+ * Checked versions ONLY when the application has source code
14
+
3
15
  ## Version 0.6.1 (Jul 11, 2016)
4
16
 
5
17
  New features:
@@ -10,6 +10,11 @@ module Luban
10
10
  attr_reader :packages
11
11
  attr_reader :services
12
12
 
13
+ def find_project; parent; end
14
+ def find_application(name = nil)
15
+ name.nil? ? self : find_project.apps[name.to_sym]
16
+ end
17
+
13
18
  def has_source?; !source.empty?; end
14
19
  def has_profile?; !profile.empty?; end
15
20
  def has_packages?; !packages.empty?; end
@@ -119,7 +124,7 @@ module Luban
119
124
  cleanup: :constructor }.each_pair do |action, worker|
120
125
  alias_method "#{action}_packages!", "#{action}!"
121
126
  define_method("#{action}!") do |args:, opts:|
122
- send("#{action}_application!", args: args, opts: opts)
127
+ send("#{action}_application!", args: args, opts: opts) if has_source?
123
128
  send("#{action}_packages!", args: args, opts: opts)
124
129
  end
125
130
  protected "#{action}!"
@@ -13,7 +13,7 @@ module Luban
13
13
  end
14
14
 
15
15
  def release_path
16
- @release_path ||= Pathname.new(readlink(app_path.join('app')))
16
+ @release_path ||= Pathname.new(readlink(current_app_path))
17
17
  end
18
18
 
19
19
  def releases_path
@@ -71,6 +71,11 @@ module Luban
71
71
  include Luban::Deployment::Parameters::Application
72
72
  include Luban::Deployment::Command::Tasks::Install
73
73
 
74
+ def find_project; parent.parent; end
75
+ def find_application(name = nil)
76
+ name.nil? ? parent : find_project.apps[name.to_sym]
77
+ end
78
+
74
79
  attr_reader :current_version
75
80
 
76
81
  def package_options; @package_options ||= {}; end
@@ -45,6 +45,10 @@ module Luban
45
45
  @unmonitor_command ||= "#{monitor_executable} unmonitor #{service_entry}"
46
46
  end
47
47
 
48
+ def reload_monitor_command
49
+ @reload_monitor_command ||= "#{monitor_executable} reload"
50
+ end
51
+
48
52
  def start_process
49
53
  if process_started?
50
54
  update_result "Skipped! Already started #{service_full_name}", status: :skipped
@@ -152,11 +156,25 @@ module Luban
152
156
  end
153
157
  end
154
158
 
159
+ def reload_monitor_process
160
+ if process_monitor_defined?
161
+ if reload_monitor_process!
162
+ info "Reloaded process monitor for #{service_entry}"
163
+ else
164
+ info "Failed to reload process monitor for #{service_entry}"
165
+ end
166
+ end
167
+ end
168
+
155
169
  def default_pending_seconds; 30; end
156
170
  def default_pending_interval; 1; end
157
171
 
158
172
  protected
159
173
 
174
+ def before_start_process
175
+ reload_monitor_process
176
+ end
177
+
160
178
  def check_until(pending_seconds: default_pending_seconds,
161
179
  pending_interval: default_pending_interval)
162
180
  succeeded = false
@@ -179,7 +197,7 @@ module Luban
179
197
  if pid_file_missing?
180
198
  "#{service_full_name}: started but PID file(s) do NOT exist in #{pids_path}"
181
199
  elsif process_started?
182
- "#{service_full_name}: started - PID(s) #{pid})"
200
+ "#{service_full_name}: started - PID(s) #{pid}"
183
201
  elsif pid_file_orphaned?
184
202
  "#{service_full_name}: stopped but PID file(s) exist in #{pids_path}"
185
203
  else
@@ -217,6 +235,10 @@ module Luban
217
235
  def unmonitor_process!
218
236
  test("#{unmonitor_command} 2>&1")
219
237
  end
238
+
239
+ def reload_monitor_process!
240
+ test("#{reload_monitor_command} 2>&1")
241
+ end
220
242
  end
221
243
 
222
244
  module Cluster
@@ -1,5 +1,5 @@
1
1
  module Luban
2
2
  module Deployment
3
- VERSION = "0.6.1"
3
+ VERSION = "0.6.2"
4
4
  end
5
5
  end
@@ -45,6 +45,10 @@ module Luban
45
45
  @app_path ||= project_path.join(application)
46
46
  end
47
47
 
48
+ def current_app_path
49
+ @app_symlink ||= app_path.join('app')
50
+ end
51
+
48
52
  def app_bin_path
49
53
  @app_bin_path ||= app_path.join('bin')
50
54
  end
@@ -76,4 +80,4 @@ module Luban
76
80
  end
77
81
  end
78
82
  end
79
- end
83
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luban
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rubyist Lei
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-11 00:00:00.000000000 Z
11
+ date: 2016-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: luban-cli