iapi-idlc-sdk-deploy 1.0.6 → 1.0.8

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: 37c9b1cca12ba910348121048b91a626fafe9e654e7a5fba2b4410395e204ee0
4
- data.tar.gz: de378b63e09f7ad9f6cb7aa0ca3c638a46afb60cff3d2acee2afe3df7f639c8c
3
+ metadata.gz: 8277a90f587392851f9153c900ce9b32adcb3a9c0921919fd0bc1586687f0cd1
4
+ data.tar.gz: 74575497a250b9f25070d070694b22eb20ae8580127d97d6636ec8f25301a755
5
5
  SHA512:
6
- metadata.gz: daaefe7f537645c9a306a4e7a78c9b7915a402276a41faf433109ae91cf92fd55924c180653d0294c9ee3095afceda1057e494386fc1b3b1c8ff53f89dae34b3
7
- data.tar.gz: 30f678947eeb625ad754581cd86f78253f828a734d589f0e75a15580bd7f4a4740f794f066a3b191d9e3f375666942dede6e55c1651cc7db783471b6ec1433ba
6
+ metadata.gz: '0487b4a0c18f7336202b05d05c7922ba44d28a9e03098f7f02e3ca2735bcc469760f5d05a508a500fa75fc7a165f61a3819d7c95efa2cffe9469bbc13baa5f52'
7
+ data.tar.gz: c94d655c82840373d1673f5f21871fccccacf4ef8eb6be52d1d9a9f29b1d7d4943d544381bef0c2e35d48d705323305afb5105d5b6ef5e9386fd21414f123986
@@ -159,7 +159,8 @@ module Idlc
159
159
  tf_version = Terraform::Binary::config.version.split('.')
160
160
 
161
161
  configure_tfstatev8(bucket, sub_bucket, working_directory) if tf_version[0].to_i == 0 && tf_version[1].to_i <= 8
162
- configure_tfstatev9(bucket, sub_bucket, working_directory) if tf_version[0].to_i >= 0 && tf_version[1].to_i > 8
162
+ configure_tfstatev9(bucket, sub_bucket, working_directory) if tf_version[0].to_i == 0 && tf_version[1].to_i > 8
163
+ configure_tfstatev10(bucket, sub_bucket, working_directory) if tf_version[0].to_i > 0
163
164
  end
164
165
 
165
166
  def parse(config_file)
@@ -203,6 +204,16 @@ module Idlc
203
204
  Terraform::Binary.init("#{args.join(' ')} #{working_directory}")
204
205
  end
205
206
 
207
+ def configure_tfstatev10(bucket, sub_bucket, working_directory)
208
+ args = []
209
+ args << "-backend-config=\"bucket=#{bucket}\""
210
+ args << "-backend-config=\"key=#{sub_bucket}/terraform.tfstate\""
211
+ args << "-backend-config=\"region=#{@region}\""
212
+ args << "-force-copy"
213
+
214
+ Terraform::Binary.init("#{args.join(' ')} -chdir #{working_directory}")
215
+ end
216
+
206
217
  def validate_environment
207
218
  %w[
208
219
  TF_VAR_tfstate_bucket
@@ -10,9 +10,14 @@ module Idlc
10
10
  private_key_file = "#{outdir}/private_key.pem"
11
11
  public_key_file = "#{outdir}/public_key.pem"
12
12
 
13
- return if File.exist? private_key_file
13
+ rsa_key = if File.exist? private_key_file
14
+ return if File.exist? public_key_file
15
+ private_key_data = File.read(private_key_file)
16
+ SSHKey.new(private_key_data)
17
+ else
18
+ SSHKey.generate
19
+ end
14
20
 
15
- rsa_key = SSHKey.generate
16
21
  private_key = rsa_key.private_key
17
22
  public_key = rsa_key.ssh_public_key
18
23
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iapi-idlc-sdk-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Cazell
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-11-28 00:00:00.000000000 Z
12
+ date: 2024-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler