firespring_dev_commands 2.1.1 → 2.1.2.pre.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e10ea33dd48edb1c355dbc78a06414bebd91c064765b43de3b3b803402d90296
|
4
|
+
data.tar.gz: d30b398a593794ef99c81781f92ac2494b4f62ecb3f899aed095d7940c319393
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36cdb73c9e42b6ee2088ceded7f9a796a39c5e386f7c6a75f77ed0a0ae84e7f44a0ef647e80e9ddb1f752471889b2114ac8b1d4ca003d89211f7ed4af0940df5
|
7
|
+
data.tar.gz: 860d30fef0495f31400a3674f3a0ace8726c6c4c6e361d9b9e78f988e5fb66981f7a81cf8d3840b560f7d5294c5447a202ed6dccbb5a466984733420d03dfbf8
|
@@ -6,11 +6,14 @@ module Dev
|
|
6
6
|
class Application
|
7
7
|
# Contains rake tasks for displaying and setting application variables in parameter store
|
8
8
|
class Config < Dev::Template::ApplicationInterface
|
9
|
-
attr_reader :
|
9
|
+
attr_reader :path_prefix, :key_parameter_path
|
10
|
+
|
11
|
+
# Allow for custom config path_prefix for the application
|
12
|
+
# Allow for custom key parameter path (otherwise base it off the path prefix)
|
13
|
+
def initialize(name, path_prefix, key_parameter_path: nil, exclude: [])
|
14
|
+
@path_prefix = path_prefix
|
15
|
+
@key_parameter_path = key_parameter_path || "#{path_prefix}/kms/id"
|
10
16
|
|
11
|
-
# Allow for custom config path for the application
|
12
|
-
def initialize(name, path, exclude: [])
|
13
|
-
@path = path
|
14
17
|
super(name, exclude:)
|
15
18
|
end
|
16
19
|
|
@@ -18,7 +21,7 @@ module Dev
|
|
18
21
|
def create_list_task!
|
19
22
|
# Have to set a local variable to be accessible inside of the instance_eval block
|
20
23
|
application = @name
|
21
|
-
|
24
|
+
path_prefix = @path_prefix
|
22
25
|
exclude = @exclude
|
23
26
|
|
24
27
|
DEV_COMMANDS_TOP_LEVEL.instance_eval do
|
@@ -29,8 +32,10 @@ module Dev
|
|
29
32
|
desc "List all #{application} configs"
|
30
33
|
task list: %w(init) do
|
31
34
|
puts
|
32
|
-
|
33
|
-
|
35
|
+
puts "Listing all parameters which start with #{path_prefix}:".light_green
|
36
|
+
puts
|
37
|
+
Dev::Aws::Parameter.new.list(path_prefix).each do |it|
|
38
|
+
puts " #{it.name.light_white} => #{it.value.light_white} (#{it.type})"
|
34
39
|
end
|
35
40
|
puts
|
36
41
|
end
|
@@ -44,7 +49,8 @@ module Dev
|
|
44
49
|
def create_set_task!
|
45
50
|
# Have to set a local variable to be accessible inside of the instance_eval block
|
46
51
|
application = @name
|
47
|
-
|
52
|
+
path_prefix = @path_prefix
|
53
|
+
key_parameter_path = @key_parameter_path
|
48
54
|
exclude = @exclude
|
49
55
|
|
50
56
|
DEV_COMMANDS_TOP_LEVEL.instance_eval do
|
@@ -58,7 +64,7 @@ module Dev
|
|
58
64
|
"\n\toptionally specify ENCRYPT=true to change a String type to a SecureString type"
|
59
65
|
task set: %w(ensure_aws_credentials) do
|
60
66
|
raise 'NAME is required' if ENV['NAME'].to_s.strip.blank?
|
61
|
-
raise 'NAME is not found in this apps parameters' if Dev::Aws::Parameter.new.list(
|
67
|
+
raise 'NAME is not found in this apps parameters' if Dev::Aws::Parameter.new.list(path_prefix).none? { |it| it.name == ENV['NAME'] }
|
62
68
|
raise 'VALUE is required' if ENV['VALUE'].to_s.strip.blank?
|
63
69
|
|
64
70
|
param_path = ENV.fetch('NAME', nil)
|
@@ -68,7 +74,7 @@ module Dev
|
|
68
74
|
params = {type: 'String'}
|
69
75
|
if ENV['ENCRYPT'].to_s.strip == 'true' || old_value.type == 'SecureString'
|
70
76
|
params[:type] = 'SecureString'
|
71
|
-
params[:key_id] = Dev::Aws::Parameter.new.get_value(
|
77
|
+
params[:key_id] = Dev::Aws::Parameter.new.get_value(key_parameter_path)
|
72
78
|
end
|
73
79
|
|
74
80
|
message = 'This will change '.light_green +
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firespring_dev_commands
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2.pre.alpha.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Firespring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -330,9 +330,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
330
330
|
version: '3.1'
|
331
331
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
332
332
|
requirements:
|
333
|
-
- - "
|
333
|
+
- - ">"
|
334
334
|
- !ruby/object:Gem::Version
|
335
|
-
version:
|
335
|
+
version: 1.3.1
|
336
336
|
requirements: []
|
337
337
|
rubygems_version: 3.4.10
|
338
338
|
signing_key:
|