firespring_dev_commands 2.1.2 → 2.1.3.pre.alpha.1

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
  SHA256:
3
- metadata.gz: 85828d1b6033f43e6ca2829553e2166167e8196d0d48cadafe890baa34efda9f
4
- data.tar.gz: ddc13774c33ec3d87da43d08828798857e728b07a7b411dd96d6771b84f6afb0
3
+ metadata.gz: 99853bd0ded5e80e210af8aba499cc56e82fba9e7c055cc57c2b34a041aa9931
4
+ data.tar.gz: 69deda63901b1338f1e4c1a712fa9b6da8e9c329f32b505a020e907ae2152518
5
5
  SHA512:
6
- metadata.gz: 452d75899c5bd64e57edb48f7e1e18ea3d77a834fa7c8d1909cb5242894c4756b4a72119722c43c83b617b5deb6eafa41da30f76a8ad9d3950a1378b1fc40b1d
7
- data.tar.gz: 2114bb304f9075f646dbf0efab44d8ac5070db797f12130a8c11bbe4cc0374b65f863375ec632b82148eb9d698a49c737fcd8c1606ca489076e7995573d9a6a1
6
+ metadata.gz: bafca03ccf03807edbf6518f0134450701734a5d998c3257207b83a7981c999520d51ea0dd662c7f37b385a81a07ffba13a14b491435d83535f36c3e5e60a5bb
7
+ data.tar.gz: 64d7b998e256508fbfd40fed21e92b15515723ec2d3acde424cad39e4e56b48e3cf63c5b7a72d46c3e8cbac8777c3ab3208509275dc2974ea910725aee44d7ef
@@ -0,0 +1,36 @@
1
+ module Dev
2
+ class Common
3
+ class Platform
4
+ ALLOWED_ARCHITECTURES = %w(arm64 amd64).freeze
5
+
6
+ def determine_compute_architecture
7
+ case RUBY_PLATFORM
8
+ when /x86_64|amd64/
9
+ 'linux/amd64' # 64-bit Intel/AMD architecture
10
+ when /arm|aarch64/
11
+ 'linux/arm64' # ARM architecture
12
+ else
13
+ raise 'Unknown or unsupported architecture'
14
+ end
15
+ end
16
+
17
+ def architecture
18
+ docker_architecture = ENV['DOCKER_ARCHITECTURE'].to_s.strip.downcase
19
+ if docker_architecture.empty?
20
+ determine_compute_architecture
21
+ else
22
+ raise "Missing 'linux/' prefix in DOCKER_ARCHITECTURE: #{docker_architecture}" unless docker_architecture.start_with?('linux/')
23
+
24
+ architecture_name = docker_architecture.split('/')[1]
25
+
26
+ unless ALLOWED_ARCHITECTURES.include?(architecture_name)
27
+ raise "Invalid DOCKER_ARCHITECTURE: #{architecture_name}. Allowed architectures are #{ALLOWED_ARCHITECTURES.join(', ')}"
28
+ end
29
+
30
+ docker_architecture
31
+
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -6,14 +6,11 @@ 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 :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"
9
+ attr_reader :path
16
10
 
11
+ # Allow for custom config path for the application
12
+ def initialize(name, path, exclude: [])
13
+ @path = path
17
14
  super(name, exclude:)
18
15
  end
19
16
 
@@ -21,7 +18,7 @@ module Dev
21
18
  def create_list_task!
22
19
  # Have to set a local variable to be accessible inside of the instance_eval block
23
20
  application = @name
24
- path_prefix = @path_prefix
21
+ path = @path
25
22
  exclude = @exclude
26
23
 
27
24
  DEV_COMMANDS_TOP_LEVEL.instance_eval do
@@ -32,10 +29,8 @@ module Dev
32
29
  desc "List all #{application} configs"
33
30
  task list: %w(init) do
34
31
  puts
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})"
32
+ Dev::Aws::Parameter.new.list(path).each do |it|
33
+ puts " #{it.name} => #{it.value} (#{it.type})"
39
34
  end
40
35
  puts
41
36
  end
@@ -49,8 +44,7 @@ module Dev
49
44
  def create_set_task!
50
45
  # Have to set a local variable to be accessible inside of the instance_eval block
51
46
  application = @name
52
- path_prefix = @path_prefix
53
- key_parameter_path = @key_parameter_path
47
+ path = @path
54
48
  exclude = @exclude
55
49
 
56
50
  DEV_COMMANDS_TOP_LEVEL.instance_eval do
@@ -64,7 +58,7 @@ module Dev
64
58
  "\n\toptionally specify ENCRYPT=true to change a String type to a SecureString type"
65
59
  task set: %w(ensure_aws_credentials) do
66
60
  raise 'NAME is required' if ENV['NAME'].to_s.strip.blank?
67
- raise 'NAME is not found in this apps parameters' if Dev::Aws::Parameter.new.list(path_prefix).none? { |it| it.name == ENV['NAME'] }
61
+ raise 'NAME is not found in this apps parameters' if Dev::Aws::Parameter.new.list(path).none? { |it| it.name == ENV['NAME'] }
68
62
  raise 'VALUE is required' if ENV['VALUE'].to_s.strip.blank?
69
63
 
70
64
  param_path = ENV.fetch('NAME', nil)
@@ -74,7 +68,7 @@ module Dev
74
68
  params = {type: 'String'}
75
69
  if ENV['ENCRYPT'].to_s.strip == 'true' || old_value.type == 'SecureString'
76
70
  params[:type] = 'SecureString'
77
- params[:key_id] = Dev::Aws::Parameter.new.get_value(key_parameter_path)
71
+ params[:key_id] = Dev::Aws::Parameter.new.get_value("#{path}/kms/id")
78
72
  end
79
73
 
80
74
  message = 'This will change '.light_green +
@@ -6,6 +6,6 @@ module Dev
6
6
  # Use 'v.v.v.pre.alpha.v' for pre-release vesions
7
7
  # Use 'v.v.v.beta.v for beta versions
8
8
  # Use semantic versioning for any releases (https://semver.org/)
9
- VERSION = '2.1.2'.freeze
9
+ VERSION = '2.1.3.pre.alpha.1'.freeze
10
10
  end
11
11
  end
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.2
4
+ version: 2.1.3.pre.alpha.1
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-22 00:00:00.000000000 Z
11
+ date: 2023-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -293,6 +293,7 @@ files:
293
293
  - lib/firespring_dev_commands/node/audit.rb
294
294
  - lib/firespring_dev_commands/php.rb
295
295
  - lib/firespring_dev_commands/php/audit.rb
296
+ - lib/firespring_dev_commands/platform.rb
296
297
  - lib/firespring_dev_commands/rake.rb
297
298
  - lib/firespring_dev_commands/ruby.rb
298
299
  - lib/firespring_dev_commands/ruby/audit.rb
@@ -330,9 +331,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
330
331
  version: '3.1'
331
332
  required_rubygems_version: !ruby/object:Gem::Requirement
332
333
  requirements:
333
- - - ">="
334
+ - - ">"
334
335
  - !ruby/object:Gem::Version
335
- version: '0'
336
+ version: 1.3.1
336
337
  requirements: []
337
338
  rubygems_version: 3.4.10
338
339
  signing_key: