belt 0.3.35 → 0.3.36

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: b880627c5b6f7d73fe1957bfeff61f0b601d8520f3b57053193bef5891b2ef9c
4
- data.tar.gz: 2069b8d810cc8bf3ef0ec8cd4c15b2baf95719bc7f546875b3dc0987e26ca8d3
3
+ metadata.gz: 2e326b668a9c84c05be3a8b67b079fe62477131ea5d6bf7f641cc791c9ecf484
4
+ data.tar.gz: 1d7d72326e7941a6fccb5474a9e659f72f62120e5b3212d0331c7d2229e99ab9
5
5
  SHA512:
6
- metadata.gz: 1e2583c0ec4320dc90e00a72c48b8f04d208cfc0f4dc561306b6630495456ca9cf81c18d396804f4bbf9267ac6512238187ac864e5af6c1e2559c2a2bfccf89b
7
- data.tar.gz: 9cf50f3894ef696c965183d9b45f572cc4cc245817e9b6f30ae3fdefe67613b0b3ba762f78bb34dc68587c22fc3f01eb1cbf44c5c8a817c3cb6d26aa5dd24d15
6
+ metadata.gz: 2a5f09abb9d336b745fb4387b980c099436cf7b5a170b7ac48b0bce1e8104c964cb565213b1cd959edc498c8d1fbba491bd0066cf0d6dae45ef2ff89eaa9c31a
7
+ data.tar.gz: 4ae1253f78503c66853b54de458f577e25c13a95e3616021264c25cbc7090ec389ec6aef7b2fc5bd6bbb28256509bda6a4e2b1a008b936969807efc35c7da9dd
@@ -4,8 +4,10 @@ require 'shellwords'
4
4
  require 'open3'
5
5
  require_relative 'app_detection'
6
6
  require_relative 'env_resolver'
7
+ require_relative 'environment_config'
7
8
  require_relative 'frontend_env_map'
8
9
  require_relative 'frontend_registry'
10
+ require_relative 'terraform_command'
9
11
 
10
12
  module Belt
11
13
  module CLI
@@ -54,11 +56,13 @@ module Belt
54
56
  def initialize(env, frontend: nil)
55
57
  @env = env
56
58
  @app_name = detect_app_name
57
- @env_dir = "infrastructure/#{@env}"
59
+ @infra_dir = TerraformCommand.find_infrastructure_dir || 'infrastructure'
60
+ @env_dir = File.join(@infra_dir, @env)
58
61
  @frontend = frontend || FrontendRegistry.new.resolve!
59
62
  end
60
63
 
61
64
  def run
65
+ load_and_apply_env_config!
62
66
  validate!
63
67
  puts "━━━ #{@frontend.label} (#{@frontend.path}/) ━━━"
64
68
  build_frontend
@@ -71,6 +75,12 @@ module Belt
71
75
 
72
76
  private
73
77
 
78
+ def load_and_apply_env_config!
79
+ env_config = EnvironmentConfig.load(@env, infra_dir: @infra_dir)
80
+ env_config.apply!
81
+ puts " 🔑 Using AWS profile: #{env_config.aws_profile}" if env_config.aws_profile?
82
+ end
83
+
74
84
  def validate!
75
85
  unless Dir.exist?(@frontend.path)
76
86
  abort "Error: No #{@frontend.path}/ directory found. " \
data/lib/belt/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Belt
4
- VERSION = '0.3.35'
4
+ VERSION = '0.3.36'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: belt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.35
4
+ version: 0.3.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stowzilla