viaduct-archfile 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/vdt-archfile-check +7 -4
- data/lib/viaduct/archfile.rb +34 -0
- data/lib/viaduct/archfile_remote_backend.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48ac37533aedb603d1c873b4254d0a12ffedeaca
|
4
|
+
data.tar.gz: dfd30fd03aa9f228255f8ded1627aa815b4176f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 348fe10acb7fde08b724e35f0acb42a70be1ff9e931a1afd5e19bd7e4ada701d727976363ab5145ff7dcba5112a4e15ae7422e31744ec253251f2c80891c59c1
|
7
|
+
data.tar.gz: 358c65dea51319cac69ac11cc94111567fdc4826a7604e916cd2cf3fec2566a1f6da2683538dbd80628679c3b39698f363494c1ed26a959a3de8c4201aaa60e8
|
data/bin/vdt-archfile-check
CHANGED
@@ -5,9 +5,12 @@ require 'viaduct/archfile'
|
|
5
5
|
begin
|
6
6
|
path = ARGV[0] || './Archfile'
|
7
7
|
if File.exist?(path)
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
yaml = SafeYAML.load(File.read(path))
|
9
|
+
if yaml.is_a?(Hash) && yaml['archfile']
|
10
|
+
yaml = yaml['archfile']
|
11
|
+
end
|
12
|
+
archfile = Viaduct::Archfile.new(yaml)
|
13
|
+
if archfile.valid?
|
11
14
|
puts
|
12
15
|
puts " \e[32mCongratulations. That Archfile looks excellent and should work well!\e[0m"
|
13
16
|
puts
|
@@ -18,7 +21,7 @@ begin
|
|
18
21
|
puts
|
19
22
|
puts " \e[31mOh no. It seems there's a problem with your Archfile!\e[0m"
|
20
23
|
puts
|
21
|
-
errors.each do |field, value|
|
24
|
+
archfile.errors.each do |field, value|
|
22
25
|
puts " * #{field ? field + ' ' : nil}\e[33m#{value}\e[0m"
|
23
26
|
end
|
24
27
|
puts
|
data/lib/viaduct/archfile.rb
CHANGED
@@ -78,6 +78,16 @@ module Viaduct
|
|
78
78
|
def validate
|
79
79
|
@errors = []
|
80
80
|
|
81
|
+
unless spec
|
82
|
+
add_error nil, "Archfile appears to be empty"
|
83
|
+
return @errors
|
84
|
+
end
|
85
|
+
|
86
|
+
if spec && !spec.is_a?(Hash)
|
87
|
+
add_error nil, "File must contain a hash"
|
88
|
+
return @errors
|
89
|
+
end
|
90
|
+
|
81
91
|
#
|
82
92
|
# Ensure we have a stack
|
83
93
|
#
|
@@ -91,6 +101,7 @@ module Viaduct
|
|
91
101
|
ensure_boolean('sleep_inactive_web_processes') if spec['settings'].keys.include?('sleep_inactive_web_processes')
|
92
102
|
ensure_boolean('serve_static_files') if spec['settings'].keys.include?('serve_static_files')
|
93
103
|
ensure_matches(/\A[a-z0-9\_\-\/]+\z/, 'document_root') if spec['settings'].keys.include?('document_root')
|
104
|
+
ensure_inclusion(remote_properties['database_fruits'], 'main_database') if spec['settings'].keys.include?('main_database')
|
94
105
|
end
|
95
106
|
|
96
107
|
#
|
@@ -123,10 +134,19 @@ module Viaduct
|
|
123
134
|
#
|
124
135
|
# Check shared databases
|
125
136
|
#
|
137
|
+
fruits_seen = []
|
126
138
|
if spec['shared_databases'].is_a?(Array)
|
127
139
|
spec['shared_databases'].each_with_index do |db, index|
|
128
140
|
namespace db, 'shared_databases', index
|
129
141
|
ensure_inclusion(remote_properties['shared_database_backends'], 'type')
|
142
|
+
if db['fruit'] && db['fruit'].length > 0
|
143
|
+
ensure_inclusion(remote_properties['database_fruits'], 'fruit')
|
144
|
+
if fruits_seen.include?(db['fruit'])
|
145
|
+
add_error 'fruit', "#{db['fruit']} is already in use in this Archfile"
|
146
|
+
else
|
147
|
+
fruits_seen << db['fruit']
|
148
|
+
end
|
149
|
+
end
|
130
150
|
ensure_string('label')
|
131
151
|
end
|
132
152
|
end
|
@@ -174,6 +194,20 @@ module Viaduct
|
|
174
194
|
end
|
175
195
|
end
|
176
196
|
|
197
|
+
#
|
198
|
+
# Check build cache
|
199
|
+
#
|
200
|
+
if spec['build_cache'].is_a?(Array)
|
201
|
+
spec['build_cache'].each_with_index do |item, index|
|
202
|
+
namespace item, 'build_cache', index
|
203
|
+
unless item =~ PATH_REGEX
|
204
|
+
add_error item, "must be a path"
|
205
|
+
end
|
206
|
+
end
|
207
|
+
elsif spec['build_cache']
|
208
|
+
add_error nil, "build_cache must be an array"
|
209
|
+
end
|
210
|
+
|
177
211
|
errors
|
178
212
|
end
|
179
213
|
|
@@ -11,7 +11,7 @@ module Viaduct
|
|
11
11
|
http = Net::HTTP.new(ENV['VDT_HOST'] || 'my.viaduct.io', ENV['VDT_PORT'] || 443)
|
12
12
|
if http.port == 443
|
13
13
|
http.use_ssl = true
|
14
|
-
http.verify_mode = OpenSSL::SSL::
|
14
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
15
15
|
end
|
16
16
|
|
17
17
|
result = http.request(req)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: viaduct-archfile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: safe_yaml
|