From 47d908eda28ab3abab43f6147af652bcb70c4fbf Mon Sep 17 00:00:00 2001 From: taivop Date: Thu, 6 Oct 2016 11:41:06 +0200 Subject: [PATCH] work on #38 --- scripts/py/deployer.py | 8 ++++---- scripts/py/test_deployment.py | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/py/deployer.py b/scripts/py/deployer.py index a29c290..1a61233 100644 --- a/scripts/py/deployer.py +++ b/scripts/py/deployer.py @@ -10,6 +10,7 @@ class Deployer(object): def __init__(self, user_email, user_password, subscription_id, resource_group, template_path, parameters): self.resource_group = resource_group + self.deployment_name = "taivo_foo_deployment" self.template_path = template_path self.parameters = parameters @@ -23,7 +24,7 @@ def deploy(self): """Deploy the template to a resource group.""" logging.info("Initializing Deployer class with resource group '{}' and template at '{}'." - .format(self.resource_group, self.template_path)) + .format(self.resource_group, self.template_path)) logging.info("Parameters: " + str(self.parameters)) self.client.resource_groups.create_or_update( @@ -35,16 +36,15 @@ def deploy(self): parameters = {k: {'value': v} for k, v in self.parameters.items()} - # TODO review deployment mode -- what do I want? deployment_properties = { - 'mode': DeploymentMode.incremental, + 'mode': DeploymentMode.complete, # Deployment modes: https://azure.microsoft.com/en-us/documentation/articles/resource-group-template-deploy/#incremental-and-complete-deployments 'template': template, 'parameters': parameters } deployment_async_operation = self.client.deployments.create_or_update( self.resource_group, - 'azure-sample', # TODO what is this parameter? + self.deployment_name, deployment_properties ) deployment_async_operation.wait() diff --git a/scripts/py/test_deployment.py b/scripts/py/test_deployment.py index cbf65e1..de05230 100644 --- a/scripts/py/test_deployment.py +++ b/scripts/py/test_deployment.py @@ -31,8 +31,6 @@ # Deploy the template my_deployment = deployer.deploy() - -print("Done deploying!\n\nConnect via: `ssh azureSample@{}.westeurope.cloudapp.azure.com`".format(dns_label_prefix)) # endregion # Destroy the resource group which contains the deployment