Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
work on #38
Browse files Browse the repository at this point in the history
  • Loading branch information
taivop committed Oct 6, 2016
1 parent 9be1740 commit 47d908e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 4 additions & 4 deletions scripts/py/deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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(
Expand All @@ -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()
Expand Down
2 changes: 0 additions & 2 deletions scripts/py/test_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 47d908e

Please sign in to comment.