added deployment script for mac; ensured managed disks are being used

This commit is contained in:
Scott Nowicki 2017-04-26 14:53:15 -05:00
parent 3a77aafe49
commit 1ce99f6929
9 changed files with 35 additions and 20 deletions

View File

@ -0,0 +1,23 @@
#!/bin/bash
set -o errexit -o nounset
# generate a unique string for CI deployment
export KEY=$(cat /dev/urandom | env LC_CTYPE=C tr -cd 'a-z' | head -c 12)
export PASSWORD=$KEY$(cat /dev/urandom | env LC_CTYPE=C tr -cd 'A-Z' | head -c 2)$(cat /dev/urandom | env LC_CTYPE=C tr -cd '0-9' | head -c 2)
/bin/sh ./deploy.sh
### capture vm image
# docker run --rm -it \
# azuresdk/azure-cli-python \
# sh -c "az login --service-principal -u $ARM_CLIENT_ID -p $ARM_CLIENT_SECRET --tenant $ARM_TENANT_ID; \
# az vm deallocate --name rgvm --resource-group permanent; \
# az vm generalize --name rgvm --resource-group permanent; \
# az image create --name customImage --source rgvm --resource-group permanent"
### cleanup
# docker run --rm -it \
# azuresdk/azure-cli-python \
# sh -c "az login --service-principal -u $ARM_CLIENT_ID -p $ARM_CLIENT_SECRET --tenant $ARM_TENANT_ID; \
# az group delete -y -n $KEY"

View File

@ -52,17 +52,8 @@ resource "azurerm_storage_container" "storc" {
container_access_type = "private"
}
resource "azurerm_managed_disk" "disk1" {
name = "${var.hostname}-osdisk1"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.rg.name}"
storage_account_type = "Standard_LRS"
create_option = "Empty"
disk_size_gb = "30"
}
resource "azurerm_managed_disk" "disk2" {
name = "${var.hostname}-disk2"
resource "azurerm_managed_disk" "datadisk" {
name = "${var.hostname}-datadisk"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.rg.name}"
storage_account_type = "Standard_LRS"
@ -85,17 +76,18 @@ resource "azurerm_virtual_machine" "vm" {
}
storage_os_disk {
name = "${var.hostname}-osdisk1"
vhd_uri = "${azurerm_storage_account.stor.primary_blob_endpoint}${azurerm_storage_container.storc.name}/${var.hostname}-osdisk1.vhd"
name = "${var.hostname}-osdisk"
managed_disk_type = "Standard_LRS"
caching = "ReadWrite"
create_option = "FromImage"
}
storage_data_disk {
name = "${var.hostname}-disk2"
vhd_uri = "${azurerm_storage_account.stor.primary_blob_endpoint}${azurerm_storage_container.storc.name}/${var.hostname}-disk2.vhd"
name = "${var.hostname}-datadisk"
managed_disk_id = "${azurerm_managed_disk.datadisk.id}"
managed_disk_type = "Standard_LRS"
disk_size_gb = "1023"
create_option = "Empty"
create_option = "Attach"
lun = 0
}