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 +4 -4
- data/README.md +13 -7
- data/bin/pvc +4 -3
- data/lib/pvcglue.rb +3 -0
- data/lib/pvcglue/cli.rb +4 -0
- data/lib/pvcglue/local.rb +8 -8
- data/lib/pvcglue/manager.rb +6 -0
- data/lib/pvcglue/packages.rb +17 -4
- data/lib/pvcglue/templates/database.yml.erb +4 -0
- data/lib/pvcglue/templates/timezone.erb +1 -1
- data/lib/pvcglue/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08d6aad383e99c18d8c2b5bad479d8b6d601fd76
|
4
|
+
data.tar.gz: 240473fa85d1e22f130117e0ab779491d98d57a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
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 }}"
|
data/lib/pvcglue.rb
CHANGED
data/lib/pvcglue/cli.rb
CHANGED
@@ -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
|
data/lib/pvcglue/local.rb
CHANGED
@@ -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 '
|
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(
|
24
|
-
system_live_out(
|
25
|
-
system_live_out(
|
26
|
-
system_live_out(
|
27
|
-
system_live_out(
|
28
|
-
system_live_out(
|
29
|
-
system_live_out(
|
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
|
data/lib/pvcglue/manager.rb
CHANGED
@@ -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)
|
data/lib/pvcglue/packages.rb
CHANGED
@@ -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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
@@ -1 +1 @@
|
|
1
|
-
<%= "#{Pvcglue.cloud.timezone}\n" %>
|
1
|
+
<%= "#{Pvcglue.cloud.timezone}\n" %>
|
data/lib/pvcglue/version.rb
CHANGED
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.
|
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-
|
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.
|
312
|
+
rubygems_version: 2.4.3
|
313
313
|
signing_key:
|
314
314
|
specification_version: 4
|
315
315
|
summary: PVC_Glue summary
|