biosphere 0.2.10 → 0.2.11

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
  SHA1:
3
- metadata.gz: 5334e29f8810799170f770884df905fdf69475fb
4
- data.tar.gz: 81106994d0ce532dd43c7353f0380b5d3b886167
3
+ metadata.gz: 647938b02f253417fc66f2c441c07ab40ab6b79e
4
+ data.tar.gz: 48d3703a751c9395c977f7f390b1c7d2db5e24be
5
5
  SHA512:
6
- metadata.gz: 792641b8e3ddda7b06d1a1755e7e3a674d63c36b4ee639cb39dee408cf2246a9c8adaf87ad3237ff9aa9d12b115c294b4175ee0e6351e3ebce6649eea40fd3ed
7
- data.tar.gz: 5ffbf10cd0629e36c6f1f88b5fd64969f0e07cb929f3cf3b1d1aa1ee94df258b697f41cc248c41ad762ac259a53666a62a25295d576d93ddc94419a0e9c1383e
6
+ metadata.gz: c98f1859dba18cbb6f3b75c4ce62757a6c810e102b77e3e5c932b3c8f762df452f63a8f21a4ba228f53d55eaf47343099dd162efa5ca3747a98feb7379677ebc
7
+ data.tar.gz: b555e8c058376a6ab67b41a9561f87761f6004856765c0bfba03198d7db3b06b5b93fde64158c81ee62b31f00ef733c1828ff4953086a6f4903be4734f9908f0
@@ -164,7 +164,7 @@ if ARGV[0] == "build" && options.src
164
164
  count = count + 1
165
165
  end
166
166
 
167
- puts "Wrote #{count} files into #{options.build_dir}"
167
+ puts "Wrote #{count} files under #{options.build_dir}"
168
168
  state.save()
169
169
  s3.save("#{options.build_dir}/state.node") unless localmode
170
170
 
@@ -244,7 +244,7 @@ elsif ARGV[0] == "commit" && options.src
244
244
 
245
245
  s3.set_lock()
246
246
  s3.retrieve("#{options.build_dir}/#{deployment}.tfstate")
247
- tf_plan_str = %x( terraform plan -state=#{options.build_dir}/#{deployment}.tfstate -out #{options.build_dir}/plan #{options.build_dir} )
247
+ tf_plan_str = %x( terraform plan -state=#{options.build_dir}/#{deployment}.tfstate -out #{options.build_dir}/plan #{options.build_dir}/#{deployment} )
248
248
  tfplanning = Biosphere::CLI::TerraformPlanning.new()
249
249
  plan = tfplanning.generate_plan(suite.deployments[deployment], tf_plan_str)
250
250
  if !plan
@@ -278,7 +278,7 @@ elsif ARGV[0] == "commit" && options.src
278
278
  #tf_apply = %x( terraform apply -state=#{state_file} #{options.build_dir})
279
279
  #puts "\n" + tf_apply
280
280
  begin
281
- PTY.spawn("terraform apply #{targets} -state=#{state_file} #{options.build_dir}") do |stdout, stdin, pid|
281
+ PTY.spawn("terraform apply #{targets} -state=#{state_file} #{options.build_dir}/#{deployment}") do |stdout, stdin, pid|
282
282
  begin
283
283
  stdout.each { |line| puts line }
284
284
  rescue Errno::EIO
@@ -292,7 +292,7 @@ elsif ARGV[0] == "commit" && options.src
292
292
  command_output = ""
293
293
  begin
294
294
  puts "Refreshing terraform outputs"
295
- PTY.spawn("terraform refresh -state=#{state_file} #{options.build_dir}") do |stdout, stdin, pid|
295
+ PTY.spawn("terraform refresh -state=#{state_file} #{options.build_dir}/#{deployment}") do |stdout, stdin, pid|
296
296
  begin
297
297
  stdout.each { |line| command_output << line }
298
298
  rescue Errno::EIO
@@ -91,9 +91,14 @@ class Biosphere
91
91
  end
92
92
 
93
93
  @deployments.each do |name, deployment|
94
+ dir = destination_dir + "/" + deployment.name
95
+ if !File.directory?(dir)
96
+ Dir.mkdir(dir)
97
+ end
98
+
94
99
  json_name = deployment.name + ".json.tf"
95
100
  str = deployment.to_json(true) + "\n"
96
- destination_name = destination_dir + "/" + json_name
101
+ destination_name = dir + "/" + json_name
97
102
  File.write(destination_name, str)
98
103
 
99
104
  yield deployment.name, destination_name, str, deployment if block_given?
@@ -1,3 +1,3 @@
1
1
  class Biosphere
2
- Version = "0.2.10"
2
+ Version = "0.2.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biosphere
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juho Mäkinen