rake_terraform 0.21.1.pre2 → 0.21.1.pre3

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: 1c854d8b00088bc1f5166fbcc1db70ab2c02dbc91b7b4f34e6d3b2dde12cbaa8
4
- data.tar.gz: caf43fbf3d4273490419145fbc8440a926f4bc3701e18242b6a072385352396f
3
+ metadata.gz: 0eafbb9445ade96e1cf734437df91532c7099a59e8d783d7f858476f983c1626
4
+ data.tar.gz: 3dc39ef6a075ebe0adeaf2b0a5e235616f3589db97be929884049b4e8373605b
5
5
  SHA512:
6
- metadata.gz: e46c65546d40636e6c98250d974007d2660c84ab3cdf73f2f343cc42e5cf224659337a6b71d2d98a67f31e2cbacc3f77720cdc05a2faacc4d96c3a06c9b552b3
7
- data.tar.gz: 287f4206e0f1aa6887e81dbb0d6389c38e7c317734752a552fab5a33cb309c8fed2e0717dc9614119e578b584fd9b30652cbd30726b49e38f4515515f45c7a64
6
+ metadata.gz: 608b122ba644ad677c411913190063658c709e1b5d816773baf38a440b0ce5dda7d4df3c616b0d1d753aaa0a1cb34369548e81db6e70cc26f1f6b03de9608315
7
+ data.tar.gz: c35c3e1c5ed07132ced8140708bcdd72867fc80c92d2b02c7c0c38ae85b9953e36db5bdbf23a22f9fa2e4bd60a03bbab23158f82d1bc2897e89d61f06474b062
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake_terraform (0.21.1.pre2)
4
+ rake_terraform (0.21.1.pre3)
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.pre2"
2
+ VERSION = "0.21.1.pre3"
3
3
  end
@@ -15,6 +15,7 @@ module RakeTerraform
15
15
  namespace = opts[:namespace] || :terraform
16
16
  version = opts[:version] || '0.10.3'
17
17
  path = opts[:path] || File.join('vendor', 'terraform')
18
+ providers = opts[:providers] || []
18
19
 
19
20
  RubyTerraform.configure do |c|
20
21
  c.binary = File.join(path, 'bin', 'terraform')
@@ -55,5 +56,49 @@ module RakeTerraform
55
56
  return true
56
57
  end
57
58
  end
59
+ providers.each do |provider|
60
+ name = provider[:name]
61
+ version = provider[:version]
62
+ path = provider[:path]
63
+ repository = provider[:repository]
64
+ dependency = "terraform-provider-#{name}"
65
+
66
+ Rake.application.in_namespace namespace do
67
+ Rake.application.in_namespace :providers do
68
+ RakeDependencies::Tasks::All.new do |t|
69
+ t.namespace = name
70
+ t.dependency = dependency
71
+ t.version = version
72
+ t.path = path
73
+ t.type = :tar_gz
74
+
75
+ t.os_ids = {mac: 'darwin', linux: 'linux'}
76
+
77
+ t.uri_template =
78
+ "https://github.com/#{repository}/releases/download/" +
79
+ "<%= @version %>/#{dependency}_v<%= @version %>_" +
80
+ "<%= @os_id %>_amd64<%= @ext %>"
81
+ t.file_name_template =
82
+ "#{dependency}_v<%= @version %>_<%= @os_id %>_amd64<%= @ext %>"
83
+
84
+ t.source_binary_name_template = dependency
85
+ t.target_binary_name_template = "#{dependency}_v<%= @version %>"
86
+
87
+ t.installation_directory = "#{ENV['HOME']}/.terraform.d/plugins"
88
+
89
+ t.needs_fetch = lambda do |parameters|
90
+ !File.exists?(
91
+ File.join(
92
+ parameters[:path],
93
+ parameters[:binary_directory],
94
+ "#{dependency}_v#{parameters[:version]}"))
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end
100
+ Rake::Task["#{namespace}:ensure"]
101
+ .enhance(providers.map {|provider|
102
+ "#{namespace}:providers:#{provider[:name]}:ensure"})
58
103
  end
59
104
  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.pre2
4
+ version: 0.21.1.pre3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toby Clemson