pangea 0.0.22 → 0.0.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pangea/cli/subcommands/config.rb +38 -40
- data/lib/pangea/cli/subcommands/infra.rb +10 -10
- data/lib/pangea/version.rb +1 -1
- metadata +1 -2
- data/lib/pangea/extractors/README.md +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2966c945cd9bacb079a294f296133c5c978589e8c0c0ceb1fd55d11f3d58664
|
4
|
+
data.tar.gz: 10e6fb03aae1ad14486a7f9197c016ff88fd9c5aa0acaf940a0b900527fc9863
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
22
|
+
Usage: pangea config [OPTIONS] SUBCOMMAND
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
Arguments:
|
25
|
+
SUBCOMMAND subcommand for config
|
26
26
|
|
27
|
-
|
28
|
-
|
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
|
-
|
36
|
-
|
35
|
+
true
|
37
36
|
rescue Aws::DynamoDB::Errors::ResourceNotFoundException
|
38
|
-
|
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
|
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
|
-
|
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]
|
105
88
|
|
106
|
-
|
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)
|
117
|
-
end
|
89
|
+
###################################################################
|
90
|
+
# dynamodb table setup
|
91
|
+
###################################################################
|
118
92
|
|
119
|
-
|
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 => e
|
102
|
+
puts e.message.to_s
|
103
|
+
end
|
104
|
+
end
|
120
105
|
|
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
|
-
|
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
|
-
|
91
|
-
|
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
|
|
data/lib/pangea/version.rb
CHANGED
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.
|
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
|