rake_terraform 0.21.1.pre5 → 0.21.1.pre6

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: 87a3571480484e19664f5acfad96443b34334d9df411c70bf88c0f40c0e7b529
4
- data.tar.gz: a4d35152677843e683f24ac5c2c6f265aebad902e2bc9281f9f2f3f69c71e392
3
+ metadata.gz: f2496bb28d388840a61a8345f5b36da22a211c05f267743fd2ec9efb83721609
4
+ data.tar.gz: fbcfdec0df877019c990b6461dc282cd8210f084283af0acf378c18347f06f82
5
5
  SHA512:
6
- metadata.gz: 3e5b9708013bbf02acb4a9dc1d47579eabf58562307ea9e7c4ccdf2b1342fdba37c935d47a28882f34a729c4d414f3fb19a202077ffac49107d7c4a100bc1729
7
- data.tar.gz: 7132d27d1ea92eb1d164f59b30a432b4f5ac1f9cc4f2b5ec1e27658dd37c340030cec0e5665d48132e2b4744a7cfc8c0a690f9c8212fb07b85b46acf1c89dcb3
6
+ metadata.gz: bf1b7431705d1585b4fe174f036ef8028f0938965be0cffb7d49e087914e7956f46109f0ed608e49dab74c5941df280d45907f9a216a6016ad605ae3dbf11312
7
+ data.tar.gz: 17477e27a5f053da9e4f685972b0622bcc8f56cb5eaa1dd9fbed4fa03dda4f63c7a9ed94776f66efbc8ab5193e5099aeb7d548b7a0333f92049e2d77d313f738
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake_terraform (0.21.1.pre5)
4
+ rake_terraform (0.21.1.pre6)
5
5
  colored2 (~> 3.1)
6
6
  rake_dependencies (~> 0.18)
7
7
  ruby-terraform (>= 0.11.2)
@@ -1,3 +1,3 @@
1
1
  module RakeTerraform
2
- VERSION = "0.21.1.pre5"
2
+ VERSION = "0.21.1.pre6"
3
3
  end
@@ -13,6 +13,9 @@ module RakeTerraform
13
13
  end
14
14
 
15
15
  def self.define_installation_tasks(opts = {})
16
+ logger = opts[:logger] ||
17
+ Logger.new(STDERR, Logger.const_get(ENV['RKTF_LOG'] || 'WARN'))
18
+
16
19
  namespace = opts[:namespace] || :terraform
17
20
  version = opts[:version] || '0.10.3'
18
21
  path = opts[:path] || File.join('vendor', 'terraform')
@@ -37,16 +40,13 @@ module RakeTerraform
37
40
  'terraform_<%= @version %>_<%= @os_id %>_amd64<%= @ext %>'
38
41
 
39
42
  t.needs_fetch = lambda do |parameters|
40
- logger = Logger.new(STDERR)
41
- logger.level = Logger.const_get(ENV['RKTF_LOG'] || 'WARN')
42
-
43
43
  terraform_binary = File.join(
44
44
  parameters[:path],
45
45
  parameters[:binary_directory],
46
46
  'terraform')
47
47
  version_string = StringIO.new
48
48
 
49
- logger.debug("Terraform binary is at: #{terraform_binary}")
49
+ logger.debug("Terraform binary should be at: #{terraform_binary}")
50
50
 
51
51
  if File.exist?(terraform_binary)
52
52
  command_line = Lino::CommandLineBuilder.for_command(terraform_binary)
@@ -62,9 +62,14 @@ module RakeTerraform
62
62
  logger.debug(
63
63
  "Terraform version information is: \n#{version_string.string}")
64
64
 
65
- if version_string.string.lines.first =~ /#{version}/
66
- return false
67
- end
65
+ version_line = version_string.string.lines.first
66
+ version_is_correct = version_line =~ /#{version}/
67
+
68
+ logger.trace(
69
+ "Version: '#{version}' is in version line: '#{version_line}'?: " +
70
+ "#{version_is_correct}")
71
+
72
+ return !version_is_correct
68
73
  end
69
74
 
70
75
  return true
@@ -101,11 +106,20 @@ module RakeTerraform
101
106
  t.installation_directory = "#{ENV['HOME']}/.terraform.d/plugins"
102
107
 
103
108
  t.needs_fetch = lambda do |parameters|
104
- !File.exists?(
105
- File.join(
106
- parameters[:path],
107
- parameters[:binary_directory],
108
- "#{dependency}_v#{parameters[:version]}"))
109
+ provider_binary = File.join(
110
+ parameters[:path],
111
+ parameters[:binary_directory],
112
+ "#{dependency}_v#{parameters[:version]}")
113
+
114
+ logger.debug(
115
+ "Terraform provider binary for: #{name} should be at: " +
116
+ terraform_binary)
117
+
118
+ binary_exists = File.exists?(provider_binary)
119
+
120
+ logger.trace("Provider file exists?: #{binary_exists}")
121
+
122
+ !binary_exists
109
123
  end
110
124
  end
111
125
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_terraform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.1.pre5
4
+ version: 0.21.1.pre6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toby Clemson