pangea 0.0.21 → 0.0.23

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: d02410a5a76e956f449998d4c33c36a986d51744a7a8e4d081e13e7f0f0735e7
4
- data.tar.gz: 8d9e320bd13423b172b35654df0555ab1e1f4c92e9cc81f374ebe391a8a13999
3
+ metadata.gz: d2966c945cd9bacb079a294f296133c5c978589e8c0c0ceb1fd55d11f3d58664
4
+ data.tar.gz: 10e6fb03aae1ad14486a7f9197c016ff88fd9c5aa0acaf940a0b900527fc9863
5
5
  SHA512:
6
- metadata.gz: 7887604c2d85fdd1000b7f35a6f447c68907a30ddfc40284847a6547b40e1837ec5d9608b95684bf5f2f61e59baf4abb1b2c5870d46c43abdd56c9b18850d3ca
7
- data.tar.gz: a2582b3b5cc3985377670abbcc9e77dac2fde5f40600944a27e10c91201d4768e332d016aa75b6ce469ee1a00acd74069c61d7b83c26ab3a963af1966d944da4
6
+ metadata.gz: dc0aa68ea9d1484f0786d1a184e4b1b5a3c50bb95313deaa7c8d024f42130ac988007bfdf48211c27de6cf64309d470fa90378680a98b25e5e1a0d598e808dc4
7
+ data.tar.gz: 781a981cfbd8d761e0e8bd4cdb3cc22149930ff0cfc1950507384b483d8d70de00c99917a298f431b1a3668dd77f8cec116cb72ac261594ad18f6bef9b7ec87d
@@ -19,23 +19,22 @@ class ConfigCommand < PangeaCommand
19
19
 
20
20
  def help
21
21
  <<~HELP
22
- Usage: pangea config [OPTIONS] SUBCOMMAND
22
+ Usage: pangea config [OPTIONS] SUBCOMMAND
23
23
 
24
- Arguments:
25
- SUBCOMMAND subcommand for config
24
+ Arguments:
25
+ SUBCOMMAND subcommand for config
26
26
 
27
- Options:
28
- -h, --help Print usage
27
+ Options:
28
+ -h, --help Print usage
29
29
  HELP
30
30
  end
31
31
 
32
32
  # check if dynamodb table exists
33
33
  def table_exists?(table_name)
34
34
  dynamodb.describe_table({ table_name: table_name })
35
- return true
36
-
35
+ true
37
36
  rescue Aws::DynamoDB::Errors::ResourceNotFoundException
38
- return false
37
+ false
39
38
  end
40
39
 
41
40
  def s3
@@ -68,7 +67,7 @@ class ConfigCommand < PangeaCommand
68
67
  provisioned_throughput: {
69
68
  read_capacity_units: 5,
70
69
  write_capacity_units: 5
71
- },
70
+ }
72
71
  }
73
72
  end
74
73
 
@@ -78,47 +77,46 @@ class ConfigCommand < PangeaCommand
78
77
  config = Config.resolve_configurations
79
78
  puts JSON.pretty_generate(config)
80
79
  when %(init)
81
- puts "intializing pangea configuration..."
80
+ puts 'intializing pangea configuration...'
82
81
  config = Config.resolve_configurations
83
82
 
84
83
  config[:namespace].each_key do |ns_name|
85
84
  ns = config[:namespace][ns_name]
86
85
  ns.each_key do |ctx_name|
87
86
  ctx = ns[ctx_name]
88
- if ctx[:state_config][:terraform][:s3]
89
- ###################################################################
90
- # dynamodb table setup
91
- ###################################################################
92
-
93
- unless table_exists?(ctx[:state_config][:terraform][:s3][:dynamodb_table])
94
- begin
95
- result = dynamodb.create_table(
96
- dynamodb_terraform_lock_spec(
97
- ctx[:state_config][:terraform][:s3][:dynamodb_table]
98
- )
99
- )
100
- puts "Created table. Status: #{result.table_description.table_status}"
101
- rescue Aws::DynamoDB::Errors::ServiceError => error
102
- puts error.message.to_s
103
- end
104
- end
87
+ next unless ctx[:state_config][:terraform][:s3]
88
+
89
+ ###################################################################
90
+ # dynamodb table setup
91
+ ###################################################################
105
92
 
106
- # dynamodb table setup
107
-
108
- ###################################################################
109
- # s3 bucket setup
110
- ###################################################################
111
- if bucket_exist?(ctx[:state_config][:terraform][:s3][:bucket])
112
- puts "bucket already exists: #{ctx[:state_config][:terraform][:s3][:bucket]}"
113
- else
114
- s3.create_bucket(
115
- bucket: ctx[:state_config][:terraform][:s3][:bucket]
93
+ unless table_exists?(ctx[:state_config][:terraform][:s3][:dynamodb_table])
94
+ begin
95
+ result = dynamodb.create_table(
96
+ dynamodb_terraform_lock_spec(
97
+ ctx[:state_config][:terraform][:s3][:dynamodb_table]
98
+ )
116
99
  )
100
+ puts "Created table. Status: #{result.table_description.table_status}"
101
+ rescue Aws::DynamoDB::Errors::ServiceError => e
102
+ puts e.message.to_s
117
103
  end
104
+ end
118
105
 
119
- # end s3 bucket setup
120
-
106
+ # dynamodb table setup
107
+
108
+ ###################################################################
109
+ # s3 bucket setup
110
+ ###################################################################
111
+ bucket_name =
112
+ ctx[:state_config][:terraform][:s3][:bucket]
113
+ if bucket_exist?(bucket_name)
114
+ puts "bucket already exists: #{bucket_name}"
115
+ else
116
+ s3.create_bucket(bucket: bucket_name)
121
117
  end
118
+
119
+ # end s3 bucket setup
122
120
  end
123
121
  end
124
122
  end
@@ -82,19 +82,19 @@ class InfraCommand < PangeaCommand
82
82
  when :local
83
83
  system %(mkdir -p #{CACHE_DIR}) unless Dir.exist?(CACHE_DIR)
84
84
  PROJECT_SRC_DIRS.each do |src_dir|
85
- if File.exist?(File.join(
85
+ next unless File.exist?(File.join(
86
+ project[:src][:location].to_s,
87
+ %(src),
88
+ src_dir.to_s
89
+ ))
90
+
91
+ synth_files = Dir.glob("#{File.join(
86
92
  project[:src][:location].to_s,
87
93
  %(src),
88
94
  src_dir.to_s
89
- ))
90
- synth_files = Dir.glob("#{File.join(
91
- project[:src][:location].to_s,
92
- %(src),
93
- src_dir.to_s
94
- )}/**/*.rb")
95
- synth_files.each do |synth_file|
96
- synth.synthesize(File.read(synth_file))
97
- end
95
+ )}/**/*.rb")
96
+ synth_files.each do |synth_file|
97
+ synth.synthesize(File.read(synth_file))
98
98
  end
99
99
  end
100
100
 
@@ -1,3 +1,3 @@
1
1
  module Pangea
2
- VERSION = %(0.0.21).freeze
2
+ VERSION = %(0.0.23).freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pangea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - drzthslnt@gmail.com
@@ -301,7 +301,6 @@ files:
301
301
  - lib/pangea/errors/no_infra_target_error.rb
302
302
  - lib/pangea/errors/project_not_found_error.rb
303
303
  - lib/pangea/errors/site_not_found_error.rb
304
- - lib/pangea/extractors/README.md
305
304
  - lib/pangea/log/init.rb
306
305
  - lib/pangea/say/init.rb
307
306
  - lib/pangea/shell/README.md
@@ -1,3 +0,0 @@
1
- # extractors
2
-
3
- take a synthesis and return appropriate hash of namespaces