pvcglue 0.1.35 → 0.1.36

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: eaf12e3960a155eaa657bf6c9df6d4e639f7f831
4
- data.tar.gz: d7c70874016c80251470d75ce16298e41e2e4f6f
3
+ metadata.gz: f3ae17de32dcc278743d0ebdc618bb536b04a2c9
4
+ data.tar.gz: 0ad274d04632897a1f2a1d2e16ea7afa7397a4cf
5
5
  SHA512:
6
- metadata.gz: 66e419dda49cfb9025d1d9c14466f503bc6a88e226d541a2f364cc6219ede59b8e5f7d96aefc43de880b76b41f375a3563a79182b318d3a5f127d6301f7d9fb9
7
- data.tar.gz: 93674c75761f8494b11febd186d2d341faee6200bdcc2ed8b23b12c66b1c73ae96ee80d0b57cc1f5016d1d0a2cbdd131d584627fc44ea4e470be6801c7272365
6
+ metadata.gz: 10f8be4a858a89e2a638465200afb485d5e241036fa96a837ad03e0904027f6b0a775dc50533a553ca09c02fd19642d75976473c928e5b441254c5e89dddbb47
7
+ data.tar.gz: e298fef64b8d26a8df0a97b6561f2fc5294044fb66bddf17d0466c669e940977ebe351e8bfd1b625a90ccd21255e774fcafe7cc23967c0a13f93d2dea5eaea67
@@ -27,6 +27,10 @@ module Pvcglue
27
27
  @current_node
28
28
  end
29
29
 
30
+ def current_node_without_nil_check
31
+ @current_node
32
+ end
33
+
30
34
  def current_node_data
31
35
  current_node.values.first
32
36
  end
@@ -228,10 +232,22 @@ module Pvcglue
228
232
  stage[:domains]
229
233
  end
230
234
 
235
+ def web_nginx_http
236
+ current_node.values.first[:web_nginx_http] || []
237
+ end
238
+
239
+ def web_nginx_server
240
+ current_node.values.first[:web_nginx_server] || []
241
+ end
242
+
231
243
  def ssl_mode
232
244
  stage[:ssl].to_sym || :none
233
245
  end
234
246
 
247
+ def lb_nginx_load_balancing_method
248
+ stage[:lb_nginx_load_balancing_method]
249
+ end
250
+
235
251
  def delayed_job_args
236
252
  stage[:delayed_job_args]
237
253
  end
@@ -4,24 +4,49 @@ module Pvcglue
4
4
  # puts nodes.inspect
5
5
  orca_suite = OrcaSuite.init(package_filter)
6
6
  nodes.each do |node, data|
7
+ old_current_node = ::Pvcglue.cloud.current_node_without_nil_check # this is being called recursively, so keep the original data...kinda a hack for now
7
8
  orca_node = ::Orca::Node.new(node, data[:public_ip], {user: user, port: Pvcglue.cloud.port_in_context(context)})
9
+ # puts "#"*800
10
+ # puts orca_node.name
11
+ # puts package.to_s
12
+ # puts "^"*80
8
13
  ::Pvcglue.cloud.current_node = {node => data}
9
14
  tries = 3
10
15
  begin
11
16
  begin
17
+ # puts "="*800
18
+ # puts orca_node.name
19
+ # puts package.to_s
20
+ # puts "^"*80
12
21
  orca_suite.run(orca_node.name, package.to_s, :apply)
13
22
  ensure
14
- ::Pvcglue.cloud.current_node = nil
23
+ # puts "-"*800
24
+ # puts orca_node.name
25
+ # puts package.to_s
26
+ # puts "^"*80
27
+ ::Pvcglue.cloud.current_node = old_current_node
28
+
29
+ # ::Pvcglue.cloud.current_node = nil
15
30
  ::Pvcglue.cloud.current_hostname = nil
16
31
  end
17
- rescue
32
+ rescue Exception => e
18
33
  tries -= 1
19
34
  if tries > 0
35
+ puts "\n"*10
36
+ puts "*"*80
37
+ puts "ERROR, retrying..."
38
+ puts e.message
39
+ puts "*"*80
20
40
  retry
21
41
  else
22
42
  puts "\n"*10
23
43
  puts "*"*80
24
- puts "ERROR, retrying..."
44
+ puts "ERROR, not retrying, fatal."
45
+ puts e.message
46
+ e.backtrace.each { |line| puts line }
47
+ puts e.message
48
+ puts node.inspect
49
+ puts data.inspect
25
50
  puts "*"*80
26
51
  end
27
52
  end
@@ -3,7 +3,7 @@ package 'monit-web' do
3
3
 
4
4
  apply do
5
5
  #include /etc/monit/conf.d/*
6
- sudo "ln -s #{Pvcglue.cloud.deploy_to_app_current_dir}/monitrc.#{Pvcglue.cloud.stage_name} /etc/monit/conf.d/#{Pvcglue.cloud.app_name}_#{Pvcglue.cloud.stage_name}.conf"
6
+ sudo "ln -sf #{Pvcglue.cloud.deploy_to_app_current_dir}/monitrc.#{Pvcglue.cloud.stage_name} /etc/monit/conf.d/#{Pvcglue.cloud.app_name}_#{Pvcglue.cloud.stage_name}.conf"
7
7
  # sudo 'service monit restart'
8
8
  end
9
9
  end
@@ -1,6 +1,9 @@
1
1
  upstream <%= Pvcglue.cloud.app_and_stage_name %>_application {
2
- <% Pvcglue.cloud.nodes_in_stage('web').each do |_, node_config| %>
3
- server <%= node_config[:private_ip] %> max_fails=1 fail_timeout=10s;
2
+ <% if Pvcglue.cloud.lb_nginx_load_balancing_method.present? %>
3
+ <%= Pvcglue.cloud.lb_nginx_load_balancing_method %>;
4
+ <% end %>
5
+ <% Pvcglue.cloud.nodes_in_stage('web').each do |_, node_config| %>
6
+ server <%= node_config[:private_ip] %> <%= node_config[:lb_nginx_upstream_server]%>;
4
7
  <% end %>
5
8
  }
6
9
 
@@ -78,6 +78,10 @@ http {
78
78
  return 444;
79
79
  }
80
80
 
81
+ <% Pvcglue.cloud.web_nginx_http.each do |option| %>
82
+ <%= " #{option};\n" %>
83
+ <% end %>
84
+
81
85
  include /etc/nginx/conf.d/*.conf;
82
86
  include /etc/nginx/sites-enabled/*;
83
87
  }
@@ -5,4 +5,11 @@ server {
5
5
  server_name <%= Pvcglue.cloud.domains.join(' ') %>;
6
6
  rails_env <%= Pvcglue.cloud.stage_name %>;
7
7
  root <%= Pvcglue.cloud.deploy_to_app_current_public_dir %>;
8
+
9
+ # Custom options from web_nginx_server
10
+
11
+ <% Pvcglue.cloud.web_nginx_server.each do |option| %>
12
+ <%= " #{option};\n" %>
13
+ <% end %>
14
+
8
15
  }
@@ -1,3 +1,3 @@
1
1
  module Pvcglue
2
- VERSION = "0.1.35"
2
+ VERSION = "0.1.36"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pvcglue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.35
4
+ version: 0.1.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Lyric
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-08 00:00:00.000000000 Z
11
+ date: 2016-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -309,7 +309,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
309
309
  version: '0'
310
310
  requirements: []
311
311
  rubyforge_project:
312
- rubygems_version: 2.4.8
312
+ rubygems_version: 2.4.3
313
313
  signing_key:
314
314
  specification_version: 4
315
315
  summary: PVC_Glue summary