vara 0.17.2 → 0.17.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vara/product_metadata_processor.rb +32 -5
- data/lib/vara/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: 6ce2c2e730b28154e9a4dec7266f2ea1e35113e6
|
4
|
+
data.tar.gz: f5304de651d5f0d8ab77168af2477d0e00b36c97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67043f52e18867c3dc258d89125df22884be362d09e42d62c3c209e2ae66bcc463f2ea71ae8ad1dd7efdcd6a079ff7ce38f904b8055ee07fd675bfdc9679a908
|
7
|
+
data.tar.gz: b88c30cf4ced4e267fd5b95d1c808b9609f624c8b5fce4a0ae683d75557f28c65cabd2f13f121425b7d544303d6881097ca2f80aa4ba449883bacf065f050927
|
@@ -31,7 +31,9 @@ module Vara
|
|
31
31
|
|
32
32
|
attr_reader :product_dir, :versioner, :external_release_paths
|
33
33
|
|
34
|
-
|
34
|
+
REQUIRED_RELEASE_KEYS = %w(file name md5 version)
|
35
|
+
EXCLUSIVE_KEYS = %w(url aws)
|
36
|
+
REQUIRED_AWS_KEYS = %w(access_key_id secret_access_key bucket_name region filename)
|
35
37
|
|
36
38
|
def merged_metadata
|
37
39
|
binaries_path = File.join(product_dir, 'metadata_parts', 'binaries.yml')
|
@@ -63,13 +65,38 @@ module Vara
|
|
63
65
|
end
|
64
66
|
end
|
65
67
|
|
68
|
+
# rubocop:disable CyclomaticComplexity
|
66
69
|
def validate_release(external_release, external_release_path)
|
67
|
-
missing_keys =
|
68
|
-
|
69
|
-
|
70
|
-
fail
|
70
|
+
missing_keys = REQUIRED_RELEASE_KEYS - external_release.keys.to_a
|
71
|
+
specified_release = "Specified release #{File.basename(external_release_path)} "
|
72
|
+
|
73
|
+
fail specified_release + "is missing required keywords: #{missing_keys}" unless missing_keys.empty?
|
74
|
+
|
75
|
+
exclusive_key_count = (EXCLUSIVE_KEYS - external_release.keys.to_a).length
|
76
|
+
case
|
77
|
+
when exclusive_key_count < 1
|
78
|
+
fail specified_release + "contains more than one of the following keys, but only one is allowed: #{EXCLUSIVE_KEYS}"
|
79
|
+
when exclusive_key_count > 1
|
80
|
+
fail specified_release + "requires one of the following keys: #{EXCLUSIVE_KEYS}"
|
81
|
+
end
|
82
|
+
|
83
|
+
if external_release.key?('aws')
|
84
|
+
missing_aws_keys = missing_aws_keys(external_release)
|
85
|
+
|
86
|
+
fail specified_release + "is missing required aws hash keywords: #{missing_aws_keys}" unless missing_aws_keys.empty?
|
87
|
+
end
|
88
|
+
|
89
|
+
extra_keys = external_release.keys.to_a - REQUIRED_RELEASE_KEYS - EXCLUSIVE_KEYS
|
90
|
+
fail specified_release + "has extra keywords: #{extra_keys}" unless extra_keys.empty?
|
71
91
|
external_release
|
72
92
|
end
|
93
|
+
# rubocop:enable CyclomaticComplexity
|
94
|
+
|
95
|
+
def missing_aws_keys(external_release)
|
96
|
+
REQUIRED_AWS_KEYS.select do |required_aws_key|
|
97
|
+
!external_release['aws'].key?(required_aws_key)
|
98
|
+
end
|
99
|
+
end
|
73
100
|
|
74
101
|
def save_processed_metadata(processed_metadata_hash)
|
75
102
|
product_name = processed_metadata_hash.fetch('name').tr('-', '_')
|
data/lib/vara/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CF Release Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -205,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
205
|
version: '0'
|
206
206
|
requirements: []
|
207
207
|
rubyforge_project:
|
208
|
-
rubygems_version: 2.
|
208
|
+
rubygems_version: 2.2.2
|
209
209
|
signing_key:
|
210
210
|
specification_version: 4
|
211
211
|
summary: Vara starts with a product git repository that meets specific requirements.
|