pvcglue 0.1.26 → 0.1.27

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: 04b3f92f71e7038cd74f78ac832f0d93604cd2dc
4
- data.tar.gz: e4cf248f20b858e705e2f81496f59f1557c0d428
3
+ metadata.gz: 08d6aad383e99c18d8c2b5bad479d8b6d601fd76
4
+ data.tar.gz: 240473fa85d1e22f130117e0ab779491d98d57a6
5
5
  SHA512:
6
- metadata.gz: ad1bd550284cb3b4e7d59e980b7e14b4845d7d8a1185afdd832723914fe12cce6dd1a666e74bb4d6852cadc11e1ddf355cae17963c057291ec760b5cfa233da1
7
- data.tar.gz: 71422b3c7ae4b4396b61018d4bdbb2ca57b1e59072bd3a2289b29523584be371808a0285d04b65bf63ecff05a803d7f1735221ca1a52284a55375a9d1de177e0
6
+ metadata.gz: 60793cba37e6cc407e001d84c3c86a2cbb656f255a037aafab8d053a362d1edb5ce1f7f2d9e7bae2e14747d4ef801432de4c8446678e6c1debb528b2df988d37
7
+ data.tar.gz: a14013284ab16ebb666ff8ddadb705a20220313d3156fef17b245122396743654f5114fd40ce424df34e10974a101c2b87789ae6c18f39ec8f9104b6c9ea5f07
data/README.md CHANGED
@@ -1,3 +1,9 @@
1
+ ###
2
+ There is an issue with gem 'tilt', '>=2.0.0', use
3
+
4
+ gem 'tilt', '<2.0.0'
5
+
6
+ in your project's Gemfile, as a temporary workaournd.
1
7
  # PVC Glue
2
8
 
3
9
  Pico Virtual Cloud Glue creates a tightly integrated (very small) virtual cloud for your Rails application.
@@ -182,7 +188,7 @@ Notes:
182
188
 
183
189
  create main toml file
184
190
 
185
- add maintenance/maintenance.html
191
+ add public/maintenance/maintenance.html
186
192
 
187
193
  pvc alpha bootstrap
188
194
  pvc alpha pvcify
@@ -191,12 +197,12 @@ Notes:
191
197
 
192
198
  modify config/initializers/secret_token.rb to include
193
199
 
194
- if Rails.env.production?
195
- Store::Application.config.secret_token = ENV['RAILS_SECRET_TOKEN'] || raise('No secret token specified. :(')
196
- else
197
- Store::Application.config.secret_token = '1175ba3ce440d59b811fd9464c5657ca09f171535fd885719f263ddec3af6ef5df42c266d96868479357b7959b05cfcac7dd1663a696931c5f347c96665e1623'
198
- end
199
-
200
+ if Rails.env.in?(%w(development test))
201
+ Rails.application.config.secret_token = 'This is insecure, please do not ever use in a publicly available application!'
202
+ else
203
+ Rails.application.config.secret_token = ENV['RAILS_SECRET_TOKEN'] || raise('No secret token specified. :(')
204
+ raise('Secret token is too short. :(') if Rails.application.config.secret_token.length < 30
205
+ end
200
206
 
201
207
 
202
208
 
data/bin/pvc CHANGED
@@ -1,13 +1,14 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'pvcglue/cli'
3
+ require 'benchmark'
3
4
 
4
5
  # Allow use of Capistrano style environment syntax and convert to 'standard' syntax
5
6
  # Example: `pvc production bootstrap` ==> `pvc bootstrap --stage=production`
6
7
  # TODO: refactor to use a list of user specified environments
7
- if ARGV.count >= 2 && %w[local test alpha beta gamma delta preview production staging all].include?(ARGV[0])
8
+ if ARGV.count >= 2 && %w[local vmtest test alpha beta gamma delta preview production staging all].include?(ARGV[0])
8
9
  ARGV[0], ARGV[1] = ARGV[1], "--stage=#{ARGV[0]}"
9
10
  end
10
11
 
11
12
  # puts ARGV.inspect
12
- Pvcglue::CLI.start
13
- puts "----- Done -----"
13
+ # puts Benchmark.measure { Pvcglue::CLI.start }
14
+ puts "----- Done #{Benchmark.measure { Pvcglue::CLI.start }}"
@@ -20,6 +20,9 @@ require "tilt"
20
20
  # puts File.join(File.dirname(__FILE__), 'pvcglue', 'packages', '*.rb')
21
21
 
22
22
  module Pvcglue
23
+ mattr_accessor :command_line_options do
24
+ {}
25
+ end
23
26
 
24
27
  def self.gem_dir
25
28
  Gem::Specification.find_by_name('pvcglue').gem_dir
@@ -5,10 +5,12 @@ require 'pvcglue'
5
5
  module Pvcglue
6
6
 
7
7
  class CLI < Thor
8
+ class_option :cloud_manager_override
8
9
 
9
10
  def initialize(args = [], local_options = {}, config = {})
10
11
  super
11
12
  Pvcglue.cloud.set_stage(options[:stage])
13
+ Pvcglue.command_line_options = options
12
14
  # puts "/\\"*80
13
15
  # puts options.inspect
14
16
  # puts "*"*80
@@ -24,6 +26,7 @@ module Pvcglue
24
26
 
25
27
  def info
26
28
  puts "Pvcglue version #{Pvcglue::Version.version}"
29
+ puts "Options: #{options}"
27
30
  puts " Manager settings:"
28
31
  Pvcglue.configuration.options.each { |k, v| puts " #{k}=#{v}" }
29
32
  end
@@ -246,4 +249,5 @@ module Pvcglue
246
249
 
247
250
  end
248
251
 
252
+
249
253
  end
@@ -4,7 +4,7 @@ module Pvcglue
4
4
  MACHINES = %w(manager lb web db)
5
5
 
6
6
  def self.vagrant(command)
7
- raise(Thor::Error, "This command can only be used for the 'local' and 'test' stages.") unless Pvcglue.cloud.stage_name.in? %w(local test)
7
+ raise(Thor::Error, "This command can only be used for the 'local' and 'vmtest' stages.") unless Pvcglue.cloud.stage_name.in? %w(local vmtest)
8
8
  raise(Thor::Error, "Vagrant (www.vagrantup.com) does not appear to be installed. :(") unless vagrant_available?
9
9
  Bundler.with_clean_env { system("vagrant #{command}") }
10
10
  end
@@ -20,13 +20,13 @@ module Pvcglue
20
20
 
21
21
  def self.up
22
22
  start
23
- system_live_out('pvc manager bootstrap')
24
- system_live_out('pvc manager push')
25
- system_live_out('pvc local pvcify')
26
- system_live_out('pvc manager push')
27
- system_live_out('pvc local bootstrap')
28
- system_live_out('pvc local build')
29
- system_live_out('pvc local deploy')
23
+ system_live_out("pvc manager bootstrap")
24
+ system_live_out("pvc manager push")
25
+ system_live_out("pvc #{Pvcglue.cloud.stage_name} pvcify")
26
+ system_live_out("pvc manager push")
27
+ system_live_out("pvc #{Pvcglue.cloud.stage_name} bootstrap")
28
+ system_live_out("pvc #{Pvcglue.cloud.stage_name} build")
29
+ system_live_out("pvc #{Pvcglue.cloud.stage_name} deploy")
30
30
  end
31
31
 
32
32
  def self.start
@@ -1,6 +1,7 @@
1
1
  require 'pp'
2
2
 
3
3
  module Pvcglue
4
+
4
5
  class Manager < Thor
5
6
 
6
7
  desc "bootstrap", "bootstrap"
@@ -130,6 +131,11 @@ module Pvcglue
130
131
  end
131
132
 
132
133
  def self.read_cached_cloud_data
134
+ if Pvcglue.command_line_options[:cloud_manager_override]
135
+ data = File.read(Pvcglue.command_line_options[:cloud_manager_override])
136
+ Pvcglue.cloud.data = TOML.parse(data)
137
+ return true
138
+ end
133
139
  return false # disable cache for now
134
140
  # TODO: Expire cache after given interval
135
141
  if File.exists?(Pvcglue.configuration.cloud_cache_file_name)
@@ -6,11 +6,24 @@ module Pvcglue
6
6
  nodes.each do |node, data|
7
7
  orca_node = ::Orca::Node.new(node, data[:public_ip], {user: user, port: Pvcglue.cloud.port_in_context(context)})
8
8
  ::Pvcglue.cloud.current_node = {node => data}
9
+ tries = 3
9
10
  begin
10
- orca_suite.run(orca_node.name, package.to_s, :apply)
11
- ensure
12
- ::Pvcglue.cloud.current_node = nil
13
- ::Pvcglue.cloud.current_hostname = nil
11
+ begin
12
+ orca_suite.run(orca_node.name, package.to_s, :apply)
13
+ ensure
14
+ ::Pvcglue.cloud.current_node = nil
15
+ ::Pvcglue.cloud.current_hostname = nil
16
+ end
17
+ rescue
18
+ tries -= 1
19
+ if tries > 0
20
+ retry
21
+ else
22
+ puts "\n"*10
23
+ puts "*"*80
24
+ puts "ERROR, retrying..."
25
+ puts "*"*80
26
+ end
14
27
  end
15
28
  end
16
29
  end
@@ -59,3 +59,7 @@ production:
59
59
  local:
60
60
  <<: *default_settings
61
61
  database: <%= Pvcglue.cloud.app_name + '_local' %>
62
+
63
+ vmtest:
64
+ <<: *default_settings
65
+ database: <%= Pvcglue.cloud.app_name + '_vmtest' %>
@@ -1 +1 @@
1
- <%= "#{Pvcglue.cloud.timezone}\n" %>
1
+ <%= "#{Pvcglue.cloud.timezone}\n" %>
@@ -1,3 +1,3 @@
1
1
  module Pvcglue
2
- VERSION = "0.1.26"
2
+ VERSION = "0.1.27"
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.26
4
+ version: 0.1.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Lyric
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-17 00:00:00.000000000 Z
11
+ date: 2015-11-17 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.6
312
+ rubygems_version: 2.4.3
313
313
  signing_key:
314
314
  specification_version: 4
315
315
  summary: PVC_Glue summary