envirobly 0.6.1 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/envirobly/config.rb +11 -14
- data/lib/envirobly/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29cfdb4affffdb5f853e57d37894479e210ee71979e225d73e949cef6f224ab4
|
4
|
+
data.tar.gz: 7ba7f8036944a5c819e5bf5e6ad8322bbe5d2e212828535938445109051b773f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6a725cea2759dcf2b4144b7a50c05a65d933f2b8e445768e160294df3630b523fe63c86e13e6f8dc3cffc60e38044b7237bc43ed90bef1eb40e171b6e59e15e
|
7
|
+
data.tar.gz: 864be10b4d1225342847e6910736d9a1e1b2486428a18295cd29db6c1ca531c2d806d721a005b34d5ba3494c974ea571ee26c46ca27dc3fa5550caf7ec7cffcd
|
data/lib/envirobly/config.rb
CHANGED
@@ -36,7 +36,6 @@ class Envirobly::Config
|
|
36
36
|
@result = @project.slice(:services)
|
37
37
|
set_project_url
|
38
38
|
merge_environment_overrides! unless @environment.nil?
|
39
|
-
transform_env_var_values!
|
40
39
|
append_image_tags!
|
41
40
|
end
|
42
41
|
|
@@ -68,16 +67,6 @@ class Envirobly::Config
|
|
68
67
|
@project_url = dig :project
|
69
68
|
end
|
70
69
|
|
71
|
-
def transform_env_var_values!
|
72
|
-
@result[:services].each do |name, service|
|
73
|
-
service.fetch(:env, {}).each do |key, value|
|
74
|
-
if value.is_a?(Hash) && value.has_key?(:file)
|
75
|
-
@result[:services][name][:env][key] = @commit.file_content(value.fetch(:file)).strip
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
70
|
NON_BUILDABLE_TYPES = %w[ postgres mysql valkey ]
|
82
71
|
BUILD_DEFAULTS = {
|
83
72
|
dockerfile: [ "Dockerfile", :file_exists? ],
|
@@ -134,6 +123,7 @@ class Envirobly::Config
|
|
134
123
|
VALID_SERVICE_KEYS = %i[
|
135
124
|
type
|
136
125
|
image
|
126
|
+
build
|
137
127
|
engine_version
|
138
128
|
instance_type
|
139
129
|
min_instances
|
@@ -149,7 +139,8 @@ class Envirobly::Config
|
|
149
139
|
private
|
150
140
|
aliases
|
151
141
|
]
|
152
|
-
NAME_FORMAT = /\A[a-z0-9\-_]+\z/
|
142
|
+
NAME_FORMAT = /\A[a-z0-9\-_\.\/]+\z/i
|
143
|
+
BUILD_VALUE_FORMAT = /\Av[\d+]\z/
|
153
144
|
def validate_services(services)
|
154
145
|
unless services.is_a?(Hash)
|
155
146
|
@errors << "`services` key must be a hash."
|
@@ -158,7 +149,7 @@ class Envirobly::Config
|
|
158
149
|
|
159
150
|
services.each do |name, service|
|
160
151
|
unless name =~ NAME_FORMAT
|
161
|
-
@errors << "`#{name}` is not a valid service name.
|
152
|
+
@errors << "`#{name}` is not a valid service name. Use aplhanumeric characters, dash, underscore, slash or dot."
|
162
153
|
end
|
163
154
|
|
164
155
|
unless service.is_a?(Hash)
|
@@ -170,6 +161,12 @@ class Envirobly::Config
|
|
170
161
|
unless VALID_SERVICE_KEYS.include?(attribute)
|
171
162
|
@errors << "Service `#{name}` attribute `#{attribute}` is not a valid attribute."
|
172
163
|
end
|
164
|
+
|
165
|
+
if attribute == :build
|
166
|
+
unless value =~ BUILD_VALUE_FORMAT
|
167
|
+
@errors << "Service `#{name}` attribute `#{attribute}` format needs to be a number prefixed with letter \"v\", for example \"v1\"."
|
168
|
+
end
|
169
|
+
end
|
173
170
|
end
|
174
171
|
|
175
172
|
BUILD_DEFAULTS.each do |attribute, options|
|
@@ -201,7 +198,7 @@ class Envirobly::Config
|
|
201
198
|
|
202
199
|
environments.each do |environment, services|
|
203
200
|
unless environment =~ NAME_FORMAT
|
204
|
-
@errors << "`#{environment}` is not a valid environment name.
|
201
|
+
@errors << "`#{environment}` is not a valid environment name. Use aplhanumeric characters, dash, underscore, slash or dot."
|
205
202
|
end
|
206
203
|
|
207
204
|
validate_services services
|
data/lib/envirobly/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: envirobly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Starsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: mocha
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: activesupport
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
165
|
- !ruby/object:Gem::Version
|
152
166
|
version: '0'
|
153
167
|
requirements: []
|
154
|
-
rubygems_version: 3.5.
|
168
|
+
rubygems_version: 3.5.20
|
155
169
|
signing_key:
|
156
170
|
specification_version: 4
|
157
171
|
summary: Envirobly command line interface
|