kitchen-azurerm 0.3.6 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen/driver/azurerm.rb +26 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9f153a4b352fb5ef9eb8edd2dfc00dab39c347b
|
4
|
+
data.tar.gz: dc46267e446c5b303dc774e78f30c1ceab4c109d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af13581cd2ff6742c723f8f6e6dabb63aa11571b9b0b773bc4b89fd5cbdfe92f0978c65662d84b840cdcfbfe1594efb1d23ebf471b1bb27f44f7ed82b69f4644
|
7
|
+
data.tar.gz: 1eba0d2e9c41544480ffdd03f4366610d6ada09409e92d3712f6bcb26e9dea6ba9acf81d094df5c3096ce36c61fa1800a066d1737e9d906c36866719400e97c5
|
@@ -51,9 +51,16 @@ module Kitchen
|
|
51
51
|
'https://management.azure.com'
|
52
52
|
end
|
53
53
|
|
54
|
+
default_config(:pre_deployment_template) do |_config|
|
55
|
+
''
|
56
|
+
end
|
57
|
+
|
58
|
+
default_config(:pre_deployment_parameters) do |_config|
|
59
|
+
{}
|
60
|
+
end
|
61
|
+
|
54
62
|
def create(state)
|
55
63
|
state = validate_state(state)
|
56
|
-
|
57
64
|
image_publisher, image_offer, image_sku, image_version = config[:image_urn].split(':', 4)
|
58
65
|
deployment_parameters = {
|
59
66
|
location: config[:location],
|
@@ -93,8 +100,14 @@ module Kitchen
|
|
93
100
|
|
94
101
|
# Execute deployment steps
|
95
102
|
begin
|
103
|
+
if File.file?(config[:pre_deployment_template])
|
104
|
+
pre_deployment_name = "pre-deploy-#{state[:uuid]}"
|
105
|
+
info "Creating deployment: #{pre_deployment_name}"
|
106
|
+
resource_management_client.deployments.create_or_update(state[:azure_resource_group_name], pre_deployment_name, pre_deployment(config[:pre_deployment_template], config[:pre_deployment_parameters])).value!
|
107
|
+
follow_deployment_until_end_state(state[:azure_resource_group_name], pre_deployment_name)
|
108
|
+
end
|
96
109
|
deployment_name = "deploy-#{state[:uuid]}"
|
97
|
-
info "Creating
|
110
|
+
info "Creating deployment: #{deployment_name}"
|
98
111
|
resource_management_client.deployments.create_or_update(state[:azure_resource_group_name], deployment_name, deployment(deployment_parameters)).value!
|
99
112
|
rescue ::MsRestAzure::AzureOperationError => operation_error
|
100
113
|
rest_error = operation_error.body['error']
|
@@ -183,6 +196,17 @@ module Kitchen
|
|
183
196
|
output.strip
|
184
197
|
end
|
185
198
|
|
199
|
+
def pre_deployment(pre_deployment_template_filename, pre_deployment_parameters)
|
200
|
+
pre_deployment_template = ::File.read(pre_deployment_template_filename)
|
201
|
+
pre_deployment = ::Azure::ARM::Resources::Models::Deployment.new
|
202
|
+
pre_deployment.properties = ::Azure::ARM::Resources::Models::DeploymentProperties.new
|
203
|
+
pre_deployment.properties.mode = Azure::ARM::Resources::Models::DeploymentMode::Incremental
|
204
|
+
pre_deployment.properties.template = JSON.parse(pre_deployment_template)
|
205
|
+
pre_deployment.properties.parameters = parameters_in_values_format(pre_deployment_parameters)
|
206
|
+
debug(pre_deployment.properties.template)
|
207
|
+
pre_deployment
|
208
|
+
end
|
209
|
+
|
186
210
|
def deployment(parameters)
|
187
211
|
template = template_for_transport_name
|
188
212
|
deployment = ::Azure::ARM::Resources::Models::Deployment.new
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-azurerm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stuart Preston
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inifile
|
@@ -182,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
182
|
version: '0'
|
183
183
|
requirements: []
|
184
184
|
rubyforge_project:
|
185
|
-
rubygems_version: 2.6.
|
185
|
+
rubygems_version: 2.6.4
|
186
186
|
signing_key:
|
187
187
|
specification_version: 4
|
188
188
|
summary: Test Kitchen driver for Azure Resource Manager.
|