blufin-lib 1.7.4 → 1.7.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d670802e60811a458378ed20b28ee75b7691f1d6
4
- data.tar.gz: 4b7ed248efce868e4d904003a7028749ff2b68e2
3
+ metadata.gz: 9d8f337c93f64a6e57950c46e77e5b4afdeda10b
4
+ data.tar.gz: ee830727eece51e807c88e50741635f57cc21ec9
5
5
  SHA512:
6
- metadata.gz: c0319aec4d945f390446cef58804bbaadcad7dd6e8d0d02dfef375745ed2903b1e662b6b94d83f926489a65412f6f40a42f46c2123be2f94db39e10c1a1a0cd4
7
- data.tar.gz: e015f083e35a9255eeffd566997d6e8fca1b90f7c8a0e6a362fa3aed998ccf800eb92544cac27361a276333051cd8f306a5b7b987c231dfb244266c6e34968c6
6
+ metadata.gz: 3d0d4070b66cb5e8cc2a267055f0b921d5c94dcd86897c1bc17204cabc19bc3104877f298189cc84fb5899aaac869981b5761a8f94700583fed1d7dfa0594bf5
7
+ data.tar.gz: 24444e6cca1d8b742d62b66e23a8342133f145157c1b987c543368819d0f9d1732161b3226c4552c1a7e8edd887de1edc80b63b69ea67c3fcd9cc3b547a408d3
data/lib/core/projects.rb CHANGED
@@ -2,7 +2,7 @@ module Blufin
2
2
 
3
3
  class Projects
4
4
 
5
- SCHEMA_FILE = "#{Blufin::Base::get_base_path}#{Blufin::Base::OPT_PATH}/awx/project-schema.yml"
5
+ SCHEMA_FILE = "#{Blufin::Base::get_base_path}#{Blufin::Base::OPT_PATH}/schema/projects.yml"
6
6
  SCRIPT_RUN = 'run'
7
7
  SCRIPT_TEST = 'test'
8
8
  SCRIPT_BUILD = 'build'
@@ -13,8 +13,11 @@ module Blufin
13
13
  ID = 'Id'
14
14
  PROJECT_ID = 'ProjectId'
15
15
  PROJECT = 'Project'
16
+ PROJECT_ROOT = 'ProjectRoot'
16
17
  TYPE = 'Type'
17
18
  REPOSITORY = 'Repository'
19
+ LOCAL = 'Local'
20
+ FILE = 'File'
18
21
  DEPLOYMENT = 'Deployment'
19
22
  DEPLOYMENT_BUCKET = 'Bucket'
20
23
  DEPLOYMENT_FILES = 'Files'
@@ -33,7 +36,7 @@ module Blufin
33
36
  PROJECT_NAME = 'ProjectName'
34
37
  PORT = 'Port'
35
38
  PORTS = 'Ports'
36
- STAGE = 'Stage'
39
+ STAGES = 'Stages'
37
40
  TYPE_ALEXA = 'alexa'
38
41
  TYPE_API = 'api'
39
42
  TYPE_LAMBDA = 'lambda'
@@ -56,11 +59,11 @@ module Blufin
56
59
  # @return void
57
60
  def self.init(projects)
58
61
  raise RuntimeError, 'Cannot run Blufin::Projects::init() more than once.' unless @@projects.nil? && @@scripts.nil?
59
- raise RuntimeError, "Need either a Local or S3Bucket key, found neither: #{projects.keys}" unless projects.has_key?('Local') || projects.has_key?('S3Bucket')
62
+ raise RuntimeError, "Need either a Local or S3Bucket key, found neither: #{projects.keys}" unless projects.has_key?(LOCAL) || projects.has_key?('S3Bucket')
60
63
  @@projects = {}
61
64
  @@scripts = {}
62
- if projects.has_key?('Local')
63
- source_file = File.expand_path(projects['Local']['File'])
65
+ if projects.has_key?(LOCAL)
66
+ source_file = File.expand_path(projects[LOCAL][FILE])
64
67
  # Throw error if source file doesn't exist.
65
68
  Blufin::Terminal::error("Cannot find source file: #{Blufin::Terminal::format_directory(source_file)}") unless Blufin::Files::file_exists(source_file)
66
69
  # Validate the source file against the expected schema.
@@ -71,6 +74,8 @@ module Blufin
71
74
  # TODO - Whatever file we validate should be available on disk locally.
72
75
  # TODO - If the source is an S3 bucket, pull it down into a /tmp folder (on EC2 instance) and validate from there.
73
76
 
77
+ raise RuntimeError, 'Reading projects.yml from S3 is not yet implemented!'
78
+
74
79
  end
75
80
  end
76
81
 
@@ -255,15 +260,18 @@ module Blufin
255
260
  Blufin::Terminal::error("#{project_id} \xe2\x80\x94 Missing property: #{Blufin::Terminal::format_highlight(LAMBDA)}", "This property is required for project(s) with type: #{LAMBDA}", true) unless project.has_key?(LAMBDA)
256
261
  # Validate keys are in specific order.
257
262
  expected = {
258
- PORT => true,
259
- STAGE => true
263
+ TITLE => true,
264
+ ALIAS => true,
265
+ PORT => true,
266
+ STAGES => true
260
267
  }
261
268
  Blufin::Validate::assert_valid_keys(expected, project[LAMBDA].keys, source_file)
262
269
  validate_ports([project[LAMBDA][PORT]], project_id, used_ports)
263
270
  # Add ports to used_ports.
264
271
  used_ports[project[LAMBDA][PORT]] = project_id
265
272
  @@lambdas = {} if @@lambdas.nil?
266
- @@lambdas[project[PROJECT_ID]] = project[LAMBDA]
273
+ Blufin::Terminal::error("Duplicate Lambda project: #{Blufin::Terminal::format_invalid(project[PROJECT_ID])}") if @@lambdas.has_key?(project[PROJECT_ID])
274
+ @@lambdas[project[PROJECT_ID]] = project
267
275
  else
268
276
  # Make sure we DON'T have the Lambda key.
269
277
  Blufin::Terminal::error("#{project_id} \xe2\x80\x94 Property not supported: #{Blufin::Terminal::format_invalid(LAMBDA)}", "This property is only allowed for project(s) with type: #{LAMBDA}", true) if project.has_key?(LAMBDA)
data/lib/version.rb CHANGED
@@ -1 +1 @@
1
- BLUFIN_LIB_VERSION = '1.7.4'
1
+ BLUFIN_LIB_VERSION = '1.7.5'
@@ -50,6 +50,7 @@ mapping:
50
50
  required: yes
51
51
  Repository:
52
52
  type: map
53
+ required: yes
53
54
  mapping:
54
55
  Local:
55
56
  Remote:
@@ -125,8 +126,15 @@ mapping:
125
126
  Lambda:
126
127
  type: map
127
128
  mapping:
129
+ Title:
130
+ required: yes
131
+ Alias:
132
+ required: yes
128
133
  Port:
129
134
  type: number
130
135
  required: yes
131
- Stage:
132
- required: yes
136
+ Stages:
137
+ type: seq
138
+ required: yes
139
+ sequence:
140
+ - type: str
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blufin-lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.4
4
+ version: 1.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Albert Rannetsperger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-11 00:00:00.000000000 Z
11
+ date: 2019-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -146,7 +146,7 @@ files:
146
146
  - lib/core/validate.rb
147
147
  - lib/core/versioning.rb
148
148
  - lib/version.rb
149
- - opt/awx/project-schema.yml
149
+ - opt/schema/projects.yml
150
150
  homepage: https://github.com/alb3rtuk
151
151
  licenses:
152
152
  - MIT
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  version: '0'
168
168
  requirements: []
169
169
  rubyforge_project:
170
- rubygems_version: 2.6.12
170
+ rubygems_version: 2.5.1
171
171
  signing_key:
172
172
  specification_version: 4
173
173
  summary: Blufin Lib