зеркало из https://github.com/microsoft/bedrock.git
Родитель
ff44501ac5
Коммит
b295a14886
|
@ -373,10 +373,10 @@ resource "azurerm_template_deployment" "api_mgmt_deployment" {
|
|||
DEPLOY
|
||||
|
||||
# these key-value pairs are passed into the ARM Template's `parameters` block
|
||||
parameters {
|
||||
parameters = {
|
||||
"primary_region_waf_url" = "${var.traffic_manager_fqdn}"
|
||||
|
||||
"service_cust_option1apim_name" = "${var.service_apim_name}"
|
||||
|
||||
}
|
||||
|
||||
deployment_mode = "Incremental"
|
||||
|
|
|
@ -15,9 +15,7 @@ resource "azurerm_key_vault" "keyvault" {
|
|||
resource_group_name = "${azurerm_resource_group.keyvault.name}"
|
||||
tenant_id = "${data.azurerm_client_config.current.tenant_id}"
|
||||
|
||||
sku {
|
||||
name = "${var.keyvault_sku}"
|
||||
}
|
||||
sku_name = "${var.keyvault_sku}"
|
||||
|
||||
network_acls {
|
||||
default_action = "Allow"
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
provider "azurerm" {
|
||||
version = "~>1.29.0"
|
||||
version = "~>1.32.1"
|
||||
}
|
||||
|
||||
# Needed for the traffic manager role assignment
|
||||
provider "azuread" {
|
||||
version = "~>0.3.1"
|
||||
version = "~>0.5.1"
|
||||
}
|
||||
|
||||
# common modules
|
||||
|
|
|
@ -19,5 +19,5 @@ resource "azurerm_subnet" "subnet" {
|
|||
resource_group_name = "${azurerm_resource_group.vnet.name}"
|
||||
|
||||
address_prefix = "${var.subnet_prefixes[count.index]}"
|
||||
service_endpoints = "${split(",",var.subnet_service_endpoints[count.index])}"
|
||||
service_endpoints = "${var.subnet_service_endpoints[count.index]}"
|
||||
}
|
||||
|
|
|
@ -30,13 +30,14 @@ variable "subnet_prefixes" {
|
|||
|
||||
variable "subnet_names" {
|
||||
description = "A list of public subnets inside the vNet."
|
||||
type = "list"
|
||||
default = ["subnet1", "subnet2"]
|
||||
}
|
||||
|
||||
variable "subnet_service_endpoints" {
|
||||
description = "A list of the service endpoints for the subnet (e.g. Microsoft.Web)"
|
||||
type = "list"
|
||||
default = ["", ""]
|
||||
default = [[], []]
|
||||
}
|
||||
|
||||
variable "tags" {
|
||||
|
|
|
@ -2,6 +2,10 @@ provider "null" {
|
|||
version = "~>2.1.2"
|
||||
}
|
||||
|
||||
terraform {
|
||||
required_version = "~> 0.11.14"
|
||||
provider "random" {
|
||||
version = "~> 2.1"
|
||||
}
|
||||
|
||||
terraform {
|
||||
required_version = "~> 0.12.6"
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module "common-provider" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/common/provider"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/common/provider"
|
||||
}
|
||||
|
||||
resource "null_resource" "velero_restore" {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
data "azurerm_client_config" "current" {}
|
||||
|
||||
module "keyvault" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/keyvault"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/keyvault"
|
||||
|
||||
keyvault_name = "${var.keyvault_name}"
|
||||
resource_group_name = "${var.global_resource_group_name}"
|
||||
|
@ -9,7 +9,7 @@ module "keyvault" {
|
|||
}
|
||||
|
||||
module "keyvault_access_policy_default" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/keyvault_policy"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/keyvault_policy"
|
||||
|
||||
vault_id = "${module.keyvault.keyvault_id}"
|
||||
tenant_id = "${data.azurerm_client_config.current.tenant_id}"
|
||||
|
@ -17,7 +17,7 @@ module "keyvault_access_policy_default" {
|
|||
}
|
||||
|
||||
module "keyvault_access_policy_aks" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/keyvault_policy"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/keyvault_policy"
|
||||
|
||||
vault_id = "${module.keyvault.keyvault_id}"
|
||||
tenant_id = "${data.azurerm_client_config.current.tenant_id}"
|
||||
|
|
|
@ -3,7 +3,7 @@ terraform {
|
|||
}
|
||||
|
||||
module "provider" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/provider"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/provider"
|
||||
}
|
||||
|
||||
resource "azurerm_resource_group" "global_rg" {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module "vnet" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/vnet"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/vnet"
|
||||
|
||||
vnet_name = "${var.vnet_name}"
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ locals {
|
|||
|
||||
# Creates vnet
|
||||
module "central_vnet" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/vnet"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/vnet"
|
||||
|
||||
resource_group_name = "${local.central_rg_name }"
|
||||
resource_group_location = "${local.central_rg_location}"
|
||||
|
@ -31,7 +31,7 @@ module "central_vnet" {
|
|||
|
||||
# Creates aks cluster
|
||||
module "central_aks" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/aks"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/aks"
|
||||
|
||||
resource_group_name = "${local.central_rg_name }"
|
||||
resource_group_location = "${local.central_rg_location}"
|
||||
|
@ -52,7 +52,7 @@ module "central_aks" {
|
|||
|
||||
# Deploys flux in aks cluster
|
||||
module "central_flux" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/common/flux"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/common/flux"
|
||||
|
||||
gitops_ssh_url = "${var.gitops_ssh_url}"
|
||||
gitops_ssh_key = "${var.gitops_ssh_key}"
|
||||
|
@ -65,7 +65,7 @@ module "central_flux" {
|
|||
}
|
||||
|
||||
module "central_tm_endpoint" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/tm-endpoint-ip"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/tm-endpoint-ip"
|
||||
|
||||
resource_group_name = "${azurerm_resource_group.centralrg.name}"
|
||||
resource_location = "${local.central_rg_location}"
|
||||
|
|
|
@ -15,7 +15,7 @@ locals {
|
|||
|
||||
# Creates vnet
|
||||
module "east_vnet" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/vnet"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/vnet"
|
||||
|
||||
resource_group_name = "${local.east_rg_name }"
|
||||
resource_group_location = "${local.east_rg_location}"
|
||||
|
@ -32,7 +32,7 @@ module "east_vnet" {
|
|||
|
||||
# Creates aks cluster
|
||||
module "east_aks" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/aks"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/aks"
|
||||
|
||||
resource_group_name = "${local.east_rg_name }"
|
||||
resource_group_location = "${local.east_rg_location}"
|
||||
|
@ -53,7 +53,7 @@ module "east_aks" {
|
|||
|
||||
# Deploys flux in aks cluster
|
||||
module "east_flux" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/common/flux"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/common/flux"
|
||||
|
||||
gitops_ssh_url = "${var.gitops_ssh_url}"
|
||||
gitops_ssh_key = "${var.gitops_ssh_key}"
|
||||
|
@ -68,7 +68,7 @@ module "east_flux" {
|
|||
# # create a dynamic public ip and associate with traffic manger endpoint
|
||||
|
||||
module "east_tm_endpoint" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/tm-endpoint-ip"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/tm-endpoint-ip"
|
||||
|
||||
resource_group_name = "${azurerm_resource_group.eastrg.name}"
|
||||
resource_location = "${local.east_rg_location}"
|
||||
|
|
|
@ -15,7 +15,7 @@ locals {
|
|||
|
||||
# Creates vnet
|
||||
module "west_vnet" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/vnet"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/vnet"
|
||||
|
||||
resource_group_name = "${local.west_rg_name}"
|
||||
resource_group_location = "${local.west_rg_location}"
|
||||
|
@ -32,7 +32,7 @@ module "west_vnet" {
|
|||
|
||||
# Creates aks cluster
|
||||
module "west_aks" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/aks"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/aks"
|
||||
|
||||
resource_group_name = "${local.west_rg_name}"
|
||||
resource_group_location = "${local.west_rg_location}"
|
||||
|
@ -53,7 +53,7 @@ module "west_aks" {
|
|||
|
||||
# Deploys flux in aks cluster
|
||||
module "west_flux" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/common/flux"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/common/flux"
|
||||
|
||||
gitops_ssh_url = "${var.gitops_ssh_url}"
|
||||
gitops_ssh_key = "${var.gitops_ssh_key}"
|
||||
|
@ -68,7 +68,7 @@ module "west_flux" {
|
|||
# create a dynamic public ip and associate with traffic manger endpoint
|
||||
|
||||
module "west_tm_endpoint" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/tm-endpoint-ip"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/tm-endpoint-ip"
|
||||
|
||||
resource_group_name = "${azurerm_resource_group.westrg.name}"
|
||||
resource_location = "${local.west_rg_location}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module "api-mgmt" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/api-mgmt"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/api-mgmt"
|
||||
|
||||
api_mgmt_name = "apiterraarmdeploy"
|
||||
resource_group_name = "${azurerm_resource_group.tmrg.name}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module "provider" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/provider"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/provider"
|
||||
}
|
||||
|
||||
# Read AKS cluster service principal (client) object to create a role assignment
|
||||
|
|
|
@ -4,7 +4,7 @@ resource "azurerm_resource_group" "tmrg" {
|
|||
}
|
||||
|
||||
module "trafficmanager" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/tm-profile"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/tm-profile"
|
||||
|
||||
resource_group_name = "${azurerm_resource_group.tmrg.name}"
|
||||
resource_group_location = "${azurerm_resource_group.tmrg.location}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module "central_waf_subnet" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/subnet"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/subnet"
|
||||
|
||||
resource_group_name = "${azurerm_resource_group.centralrg.name}"
|
||||
vnet_name = "${module.central_vnet.vnet_name}"
|
||||
|
@ -8,7 +8,7 @@ module "central_waf_subnet" {
|
|||
}
|
||||
|
||||
module "central_waf" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/waf"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/waf"
|
||||
|
||||
resource_group_name = "${azurerm_resource_group.centralrg.name}"
|
||||
resource_group_location = "${azurerm_resource_group.centralrg.location}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module "east_waf_subnet" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/subnet"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/subnet"
|
||||
|
||||
resource_group_name = "${azurerm_resource_group.eastrg.name}"
|
||||
vnet_name = "${module.east_vnet.vnet_name}"
|
||||
|
@ -8,7 +8,7 @@ module "east_waf_subnet" {
|
|||
}
|
||||
|
||||
module "east_waf" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/waf"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/waf"
|
||||
|
||||
resource_group_name = "${azurerm_resource_group.eastrg.name}"
|
||||
resource_group_location = "${azurerm_resource_group.eastrg.location}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module "west_waf_subnet" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/subnet"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/subnet"
|
||||
|
||||
resource_group_name = "${azurerm_resource_group.westrg.name}"
|
||||
vnet_name = "${module.west_vnet.vnet_name}"
|
||||
|
@ -8,7 +8,7 @@ module "west_waf_subnet" {
|
|||
}
|
||||
|
||||
module "west_waf" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/waf"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/waf"
|
||||
|
||||
resource_group_name = "${azurerm_resource_group.westrg.name}"
|
||||
resource_group_location = "${azurerm_resource_group.westrg.location}"
|
||||
|
|
|
@ -15,7 +15,7 @@ locals {
|
|||
|
||||
# Creates central vnet
|
||||
module "central_vnet" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/vnet"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/vnet"
|
||||
|
||||
resource_group_name = "${local.central_rg_name }"
|
||||
resource_group_location = "${local.central_rg_location}"
|
||||
|
@ -30,7 +30,7 @@ module "central_vnet" {
|
|||
|
||||
# Creates central aks cluster, flux, kubediff
|
||||
module "central_aks_gitops" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/aks-gitops"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/aks-gitops"
|
||||
|
||||
acr_enabled = "${var.acr_enabled}"
|
||||
agent_vm_count = "${var.agent_vm_count}"
|
||||
|
@ -59,7 +59,7 @@ module "central_aks_gitops" {
|
|||
|
||||
# create a static public ip and associate with traffic manger endpoint
|
||||
module "central_tm_endpoint" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/tm-endpoint-ip"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/tm-endpoint-ip"
|
||||
|
||||
resource_group_name = "${local.central_rg_name}"
|
||||
resource_location = "${local.central_rg_location}"
|
||||
|
@ -85,7 +85,7 @@ resource "azurerm_role_assignment" "central_spra" {
|
|||
|
||||
# Deploy central keyvault flexvolume
|
||||
module "central_flex_volume" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/keyvault_flexvol"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/keyvault_flexvol"
|
||||
|
||||
resource_group_name = "${var.keyvault_resource_group}"
|
||||
service_principal_id = "${var.service_principal_id}"
|
||||
|
|
|
@ -15,7 +15,7 @@ locals {
|
|||
|
||||
# Creates east vnet
|
||||
module "east_vnet" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/vnet"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/vnet"
|
||||
|
||||
resource_group_name = "${local.east_rg_name }"
|
||||
resource_group_location = "${local.east_rg_location}"
|
||||
|
@ -30,7 +30,7 @@ module "east_vnet" {
|
|||
|
||||
# Creates east aks cluster, flux, kubediff
|
||||
module "east_aks_gitops" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/aks-gitops"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/aks-gitops"
|
||||
|
||||
acr_enabled = "${var.acr_enabled}"
|
||||
agent_vm_count = "${var.agent_vm_count}"
|
||||
|
@ -59,7 +59,7 @@ module "east_aks_gitops" {
|
|||
|
||||
# create a static public ip and associate with traffic manger endpoint
|
||||
module "east_tm_endpoint" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/tm-endpoint-ip"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/tm-endpoint-ip"
|
||||
|
||||
resource_group_name = "${local.east_rg_name}"
|
||||
resource_location = "${local.east_rg_location}"
|
||||
|
@ -85,7 +85,7 @@ resource "azurerm_role_assignment" "east_spra" {
|
|||
|
||||
# Deploy east keyvault flexvolume
|
||||
module "east_flex_volume" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/keyvault_flexvol"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/keyvault_flexvol"
|
||||
|
||||
resource_group_name = "${var.keyvault_resource_group}"
|
||||
service_principal_id = "${var.service_principal_id}"
|
||||
|
|
|
@ -15,7 +15,7 @@ locals {
|
|||
|
||||
# Creates west vnet
|
||||
module "west_vnet" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/vnet"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/vnet"
|
||||
|
||||
resource_group_name = "${local.west_rg_name}"
|
||||
resource_group_location = "${local.west_rg_location}"
|
||||
|
@ -30,7 +30,7 @@ module "west_vnet" {
|
|||
|
||||
# Creates west aks cluster, flux, kubediff
|
||||
module "west_aks_gitops" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/aks-gitops"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/aks-gitops"
|
||||
|
||||
acr_enabled = "${var.acr_enabled}"
|
||||
agent_vm_count = "${var.agent_vm_count}"
|
||||
|
@ -59,7 +59,7 @@ module "west_aks_gitops" {
|
|||
|
||||
# create a static public ip and associate with traffic manger endpoint
|
||||
module "west_tm_endpoint" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/tm-endpoint-ip"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/tm-endpoint-ip"
|
||||
|
||||
resource_group_name = "${local.west_rg_name}"
|
||||
resource_location = "${local.west_rg_location}"
|
||||
|
@ -85,7 +85,7 @@ resource "azurerm_role_assignment" "west_spra" {
|
|||
|
||||
# Deploy west keyvault flexvolume
|
||||
module "west_flex_volume" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/keyvault_flexvol"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/keyvault_flexvol"
|
||||
|
||||
resource_group_name = "${var.keyvault_resource_group}"
|
||||
service_principal_id = "${var.service_principal_id}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module "provider" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/provider"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/provider"
|
||||
}
|
||||
|
||||
# Read AKS cluster service principal (client) object to create a role assignment
|
||||
|
@ -11,7 +11,7 @@ data "azurerm_client_config" "current" {}
|
|||
|
||||
# Create Azure Key Vault role for SP
|
||||
module "keyvault_flexvolume_role" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/keyvault_flexvol_role"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/keyvault_flexvol_role"
|
||||
|
||||
resource_group_name = "${var.keyvault_resource_group}"
|
||||
service_principal_id = "${var.service_principal_id}"
|
||||
|
|
|
@ -4,7 +4,7 @@ resource "azurerm_resource_group" "tmrg" {
|
|||
}
|
||||
|
||||
module "trafficmanager" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/tm-profile"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/tm-profile"
|
||||
|
||||
resource_group_name = "${azurerm_resource_group.tmrg.name}"
|
||||
resource_group_location = "${azurerm_resource_group.tmrg.location}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module "provider" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/provider"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/provider"
|
||||
}
|
||||
|
||||
resource "azurerm_resource_group" "cluster_rg" {
|
||||
|
@ -8,14 +8,14 @@ resource "azurerm_resource_group" "cluster_rg" {
|
|||
}
|
||||
|
||||
module "vnet" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/vnet"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/vnet"
|
||||
|
||||
vnet_name = "${var.vnet_name}"
|
||||
address_space = "${var.address_space}"
|
||||
resource_group_name = "${var.resource_group_name}"
|
||||
resource_group_location = "${var.resource_group_location}"
|
||||
resource_group_name = "${azurerm_resource_group.cluster_rg.name}"
|
||||
resource_group_location = "${azurerm_resource_group.cluster_rg.location}"
|
||||
subnet_names = ["${var.cluster_name}-aks-subnet"]
|
||||
subnet_prefixes = "${var.subnet_prefixes}"
|
||||
subnet_prefixes = ["${var.subnet_prefix}"]
|
||||
|
||||
tags = {
|
||||
environment = "azure-simple"
|
||||
|
@ -23,7 +23,7 @@ module "vnet" {
|
|||
}
|
||||
|
||||
module "aks-gitops" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/aks-gitops"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/aks-gitops"
|
||||
|
||||
acr_enabled = "${var.acr_enabled}"
|
||||
agent_vm_count = "${var.agent_vm_count}"
|
||||
|
@ -39,11 +39,11 @@ module "aks-gitops" {
|
|||
gitops_poll_interval = "${var.gitops_poll_interval}"
|
||||
gitops_url_branch = "${var.gitops_url_branch}"
|
||||
ssh_public_key = "${var.ssh_public_key}"
|
||||
resource_group_location = "${var.resource_group_location}"
|
||||
resource_group_location = "${azurerm_resource_group.cluster_rg.location}"
|
||||
resource_group_name = "${azurerm_resource_group.cluster_rg.name}"
|
||||
service_principal_id = "${var.service_principal_id}"
|
||||
service_principal_secret = "${var.service_principal_secret}"
|
||||
vnet_subnet_id = "${module.vnet.vnet_subnet_ids[0]}"
|
||||
vnet_subnet_id = "${tostring(element(module.vnet.vnet_subnet_ids, 0))}"
|
||||
service_cidr = "${var.service_cidr}"
|
||||
dns_ip = "${var.dns_ip}"
|
||||
docker_cidr = "${var.docker_cidr}"
|
||||
|
|
|
@ -107,9 +107,9 @@ variable "address_space" {
|
|||
default = "10.10.0.0/16"
|
||||
}
|
||||
|
||||
variable "subnet_prefixes" {
|
||||
variable "subnet_prefix" {
|
||||
description = "The address prefix to use for the subnet."
|
||||
default = ["10.10.1.0/24"]
|
||||
default = "10.10.1.0/24"
|
||||
}
|
||||
|
||||
variable "network_policy" {
|
||||
|
|
|
@ -10,7 +10,7 @@ resource "azurerm_resource_group" "cluster_rg" {
|
|||
}
|
||||
|
||||
module "aks-gitops" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/aks-gitops"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/aks-gitops"
|
||||
|
||||
acr_enabled = "${var.acr_enabled}"
|
||||
agent_vm_count = "${var.agent_vm_count}"
|
||||
|
@ -35,7 +35,7 @@ module "aks-gitops" {
|
|||
|
||||
# Create Azure Key Vault role for SP
|
||||
module "keyvault_flexvolume_role" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/keyvault_flexvol_role"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/keyvault_flexvol_role"
|
||||
|
||||
resource_group_name = "${var.keyvault_resource_group}"
|
||||
service_principal_id = "${var.service_principal_id}"
|
||||
|
@ -45,7 +45,7 @@ module "keyvault_flexvolume_role" {
|
|||
|
||||
# Deploy central keyvault flexvolume
|
||||
module "flex_volume" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/keyvault_flexvol"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/keyvault_flexvol"
|
||||
|
||||
resource_group_name = "${var.keyvault_resource_group}"
|
||||
service_principal_id = "${var.service_principal_id}"
|
||||
|
|
|
@ -10,7 +10,7 @@ resource "azurerm_resource_group" "cluster_rg" {
|
|||
}
|
||||
|
||||
module "aks-gitops" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/aks-gitops"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/aks-gitops"
|
||||
|
||||
acr_enabled = "${var.acr_enabled}"
|
||||
agent_vm_count = "${var.agent_vm_count}"
|
||||
|
@ -37,7 +37,7 @@ module "aks-gitops" {
|
|||
|
||||
# Create Azure Key Vault role for SP
|
||||
module "keyvault_flexvolume_role" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/keyvault_flexvol_role"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/keyvault_flexvol_role"
|
||||
|
||||
resource_group_name = "${var.keyvault_resource_group}"
|
||||
service_principal_id = "${var.service_principal_id}"
|
||||
|
@ -47,7 +47,7 @@ module "keyvault_flexvolume_role" {
|
|||
|
||||
# Deploy central keyvault flexvolume
|
||||
module "flex_volume" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/keyvault_flexvol"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/keyvault_flexvol"
|
||||
|
||||
resource_group_name = "${var.keyvault_resource_group}"
|
||||
service_principal_id = "${var.service_principal_id}"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
data "azurerm_client_config" "current" {}
|
||||
|
||||
module "common-provider" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/common/provider"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/common/provider"
|
||||
}
|
||||
|
||||
resource "azurerm_resource_group" "cluster_rg" {
|
||||
|
@ -20,7 +20,7 @@ resource "null_resource" "cloud_credentials" {
|
|||
}
|
||||
|
||||
module "aks" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/aks"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/aks"
|
||||
|
||||
agent_vm_count = "${var.agent_vm_count}"
|
||||
agent_vm_size = "${var.agent_vm_size}"
|
||||
|
@ -38,7 +38,7 @@ module "aks" {
|
|||
|
||||
# Create Azure Key Vault role for SP
|
||||
module "keyvault_flexvolume_role" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/keyvault_flexvol_role"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/keyvault_flexvol_role"
|
||||
|
||||
resource_group_name = "${var.keyvault_resource_group}"
|
||||
service_principal_id = "${var.service_principal_id}"
|
||||
|
@ -48,7 +48,7 @@ module "keyvault_flexvolume_role" {
|
|||
|
||||
# Deploy central keyvault flexvolume
|
||||
module "flex_volume" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/azure/keyvault_flexvol"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/azure/keyvault_flexvol"
|
||||
|
||||
resource_group_name = "${var.keyvault_resource_group}"
|
||||
service_principal_id = "${var.service_principal_id}"
|
||||
|
@ -60,7 +60,7 @@ module "flex_volume" {
|
|||
}
|
||||
|
||||
module "velero" {
|
||||
source = "github.com/microsoft/bedrock?ref=master//cluster/common/velero"
|
||||
source = "github.com/microsoft/bedrock?ref=0.12support//cluster/common/velero"
|
||||
|
||||
velero_bucket = "${var.velero_bucket}"
|
||||
velero_backup_location_config = "${var.velero_backup_location_config}"
|
||||
|
|
|
@ -17,7 +17,7 @@ This walkthrough consists of the following steps:
|
|||
|
||||
Before starting the deployment, there are several required steps:
|
||||
|
||||
- Install the required common tools (kubectl, helm, and terraform). See also [Required Tools](https://github.com/microsoft/bedrock/tree/master/cluster). Note: this tutorial currently uses [Terraform 0.11.14](https://releases.hashicorp.com/terraform/0.11.14/).
|
||||
- Install the required common tools (kubectl, helm, and terraform). See also [Required Tools](https://github.com/microsoft/bedrock/tree/master/cluster). Note: this tutorial currently uses [Terraform 0.12.6](https://releases.hashicorp.com/terraform/0.12.6/).
|
||||
- Enroll as an Azure subscriber. The free trial subscription does not support enough cores to run this tutorial.
|
||||
- Install the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest).
|
||||
- Set up [Flux manifest repository](#set-up-flux-manifest-repository).
|
||||
|
|
|
@ -33,6 +33,7 @@ The script takes the following arguments:
|
|||
Running the script resembles:
|
||||
|
||||
```bash
|
||||
|
||||
$ ./tools/bedrock_terraform_release.sh -v 0.1.0
|
||||
Cloning into 'bedrock'...
|
||||
remote: Enumerating objects: 20, done.
|
||||
|
|
|
@ -23,7 +23,6 @@ func TestIT_Bedrock_AzureCommon_KV_Test(t *testing.T) {
|
|||
location := os.Getenv("DATACENTER_LOCATION")
|
||||
clientid := os.Getenv("ARM_CLIENT_ID")
|
||||
subnetName := k8sName + "-subnet"
|
||||
tenantid := os.Getenv("ARM_TENANT_ID")
|
||||
vnetName := k8sName + "-vnet"
|
||||
|
||||
//Generate common-infra backend for tf.state files to be persisted in azure storage account
|
||||
|
@ -59,7 +58,6 @@ func TestIT_Bedrock_AzureCommon_KV_Test(t *testing.T) {
|
|||
"service_principal_id": clientid,
|
||||
"subnet_name": subnetName,
|
||||
"subnet_prefix": addressSpace,
|
||||
"tenant_id": tenantid,
|
||||
"vnet_name": vnetName,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -43,7 +43,6 @@ func TestIT_Bedrock_AzureMC_Test(t *testing.T) {
|
|||
|
||||
location := os.Getenv("DATACENTER_LOCATION")
|
||||
clientid := os.Getenv("ARM_CLIENT_ID")
|
||||
tenantid := os.Getenv("ARM_TENANT_ID")
|
||||
|
||||
addressSpace := "10.39.0.0/16"
|
||||
subnetName := k8sName + "-subnet"
|
||||
|
@ -85,7 +84,6 @@ func TestIT_Bedrock_AzureMC_Test(t *testing.T) {
|
|||
"service_principal_id": clientid,
|
||||
"subnet_name": subnetName,
|
||||
"subnet_prefix": addressSpace,
|
||||
"tenant_id": tenantid,
|
||||
"vnet_name": vnetName,
|
||||
},
|
||||
}
|
||||
|
@ -272,7 +270,7 @@ func TestIT_Bedrock_AzureMC_Test(t *testing.T) {
|
|||
|
||||
//Verify that we get a 200 OK response and response text contains `Cats` otherwise clean up AKS load balancer and destroy resources
|
||||
//Bedrock is using the azure-vote.yaml service that provisions a stateless simple voting app using redis on all clusters
|
||||
_reqErr := http_helper.HttpGetWithRetryWithCustomValidationE(t, testTM_URL, maxRetries, timeBetweenRetries, func(status int, body string) bool {
|
||||
_reqErr := http_helper.HttpGetWithRetryWithCustomValidationE(t, testTM_URL, nil, maxRetries, timeBetweenRetries, func(status int, body string) bool {
|
||||
return status == 200 && strings.Contains(body, `"Cats"`)
|
||||
})
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@ func TestIT_Bedrock_AzureSimple_Test(t *testing.T) {
|
|||
|
||||
// Generate a random cluster name to prevent a naming conflict
|
||||
uniqueID := random.UniqueId()
|
||||
k8sName := fmt.Sprintf("gTestk8s-%s", uniqueID)
|
||||
k8sName := strings.ToLower(fmt.Sprintf("gTestk8s-%s", uniqueID))
|
||||
|
||||
subnetPrefixes := []string{"10.10.1.0/24"}
|
||||
subnetPrefix := "10.10.1.0/24"
|
||||
addressSpace := "10.10.0.0/16"
|
||||
clientid := os.Getenv("ARM_CLIENT_ID")
|
||||
clientsecret := os.Getenv("ARM_CLIENT_SECRET")
|
||||
|
@ -28,9 +28,6 @@ func TestIT_Bedrock_AzureSimple_Test(t *testing.T) {
|
|||
location := os.Getenv("DATACENTER_LOCATION")
|
||||
publickey := os.Getenv("public_key")
|
||||
sshkey := os.Getenv("ssh_key")
|
||||
subnetName := k8sName + "-subnet"
|
||||
subscriptionid := os.Getenv("ARM_SUBSCRIPTION_ID")
|
||||
tenantid := os.Getenv("ARM_TENANT_ID")
|
||||
vnetName := k8sName + "-vnet"
|
||||
|
||||
//Copy env directories as needed to avoid conflicting with other running tests
|
||||
|
@ -52,10 +49,7 @@ func TestIT_Bedrock_AzureSimple_Test(t *testing.T) {
|
|||
"service_principal_id": clientid,
|
||||
"service_principal_secret": clientsecret,
|
||||
"ssh_public_key": publickey,
|
||||
"subnet_name": subnetName,
|
||||
"subnet_prefixes": subnetPrefixes,
|
||||
"subscription_id": subscriptionid,
|
||||
"tenant_id": tenantid,
|
||||
"subnet_prefix": subnetPrefix,
|
||||
"vnet_name": vnetName,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ func TestIT_Bedrock_Azure_Single_KV_Cosmos_Mongo_DB_Test(t *testing.T) {
|
|||
location := os.Getenv("DATACENTER_LOCATION")
|
||||
clientid := os.Getenv("ARM_CLIENT_ID")
|
||||
subnetName := k8sName + "-subnet"
|
||||
tenantid := os.Getenv("ARM_TENANT_ID")
|
||||
vnetName := k8sName + "-vnet"
|
||||
|
||||
//Generate common-infra backend for tf.state files to be persisted in azure storage account
|
||||
|
@ -61,7 +60,6 @@ func TestIT_Bedrock_Azure_Single_KV_Cosmos_Mongo_DB_Test(t *testing.T) {
|
|||
"service_principal_id": clientid,
|
||||
"subnet_name": subnetName,
|
||||
"subnet_prefix": addressSpace,
|
||||
"tenant_id": tenantid,
|
||||
"vnet_name": vnetName,
|
||||
},
|
||||
}
|
||||
|
@ -165,4 +163,4 @@ func TestIT_Bedrock_Azure_Single_KV_Cosmos_Mongo_DB_Test(t *testing.T) {
|
|||
} else {
|
||||
fmt.Println("CosmosDB with MongoDB verification complete.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,13 +16,15 @@ require (
|
|||
github.com/googleapis/gnostic v0.2.0 // indirect
|
||||
github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc // indirect
|
||||
github.com/gruntwork-io/gruntwork-cli v0.4.2 // indirect
|
||||
github.com/gruntwork-io/terratest v0.14.2
|
||||
github.com/gruntwork-io/terratest v0.18.3
|
||||
github.com/imdario/mergo v0.3.7 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.6 // indirect
|
||||
github.com/magiconair/properties v1.8.1 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.1 // indirect
|
||||
github.com/otiai10/copy v1.0.1
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
|
||||
github.com/pquerna/otp v1.1.0 // indirect
|
||||
github.com/spf13/cobra v0.0.3 // indirect
|
||||
|
|
10
test/go.sum
10
test/go.sum
|
@ -1,3 +1,5 @@
|
|||
bou.ke/monkey v1.0.1 h1:zEMLInw9xvNakzUUPjfS4Ds6jYPqCFx3m7bRmG5NH2U=
|
||||
bou.ke/monkey v1.0.1/go.mod h1:FgHuK96Rv2Nlf+0u1OOVDpCMdsWyOFmeeketDHE7LIg=
|
||||
cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg=
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
github.com/aws/aws-sdk-go v1.18.2 h1:GcmH9zTLXpWLyijotBQ1i83sslnkuORZVot+yAsj/LQ=
|
||||
|
@ -34,6 +36,8 @@ github.com/gruntwork-io/gruntwork-cli v0.4.2 h1:+K4OLfTbdwfCGa8wFDPFV6t6jG1YBQqp
|
|||
github.com/gruntwork-io/gruntwork-cli v0.4.2/go.mod h1:IBX21bESC1/LGoV7jhXKUnTQTZgQ6dYRsoj/VqxUSZQ=
|
||||
github.com/gruntwork-io/terratest v0.14.2 h1:A9YUZZlXE/syTnIVeuqhqoyVO5CUJS5Kasvyr5IUsv8=
|
||||
github.com/gruntwork-io/terratest v0.14.2/go.mod h1:NjUn6YXA5Skxt8Rs20t3isYx5Rl+EgvGB8/+RRXddqk=
|
||||
github.com/gruntwork-io/terratest v0.18.3 h1:07C7q8dElpSmob6uo/5mZm1c++zsAQsVlDv3G98CeLs=
|
||||
github.com/gruntwork-io/terratest v0.18.3/go.mod h1:NjUn6YXA5Skxt8Rs20t3isYx5Rl+EgvGB8/+RRXddqk=
|
||||
github.com/imdario/mergo v0.3.7 h1:Y+UAYTZ7gDEuOfhxKWy+dvb5dRQ6rJjFSdX2HZY1/gI=
|
||||
github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
|
||||
|
@ -44,12 +48,18 @@ github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwK
|
|||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
|
||||
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/otiai10/copy v1.0.1 h1:gtBjD8aq4nychvRZ2CyJvFWAw0aja+VHazDdruZKGZA=
|
||||
github.com/otiai10/copy v1.0.1/go.mod h1:8bMCJrAqOtN/d9oyh5HR7HhLQMvcGMpGdwRDYsfOCHc=
|
||||
github.com/otiai10/mint v1.2.3 h1:PsrRBmrxR68kyNu6YlqYHbNlItc5vOkuS6LBEsNttVA=
|
||||
github.com/otiai10/mint v1.2.3/go.mod h1:YnfyPNhBvnY8bW4SGQHCs/aAFhkgySlMZbrF5U0bOVw=
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
# Bedrock Tools
|
||||
|
||||
This directory contains tools for working with both the release process as well as helping to facilitate pull requests, especially when remote references to modules need to be updated.
|
||||
|
||||
Currently, the scripts are:
|
||||
|
||||
- `bedrock_terraform_release.sh` - this script updates remote references and creates a branch for which releases can be generated
|
||||
- `toggle_remote_ref.sh` - this script is used to toggle remote references in your repository so when a PR is issued with changes affecting remote modules, those changes (in the branch the PR is based on) can be toggled easily for testing (and then returned to reference master post testing)
|
|
@ -91,7 +91,7 @@ echo $FILE_SEARCH
|
|||
|
||||
# update files
|
||||
for f in $FILE_SEARCH; do
|
||||
sed -i -r "s/source[ ]{0,}=[ ]{0,}\"github.com\/$entity_name\/$project_name\?ref=$CURRENT_VERSION\/\/(.*)\"/source = \"github.com\/$entity_name\/$project_name\?ref=$NEW_VERSION\/\/\1/g" $f
|
||||
sed -i -r "s/source[ ]{0,}=[ ]{0,}\"github.com\/$entity_name\/$project_name\?ref=$CURRENT_VERSION\/\/(.*)\"/source = \"github.com\/$entity_name\/$project_name\?ref=$NEW_VERSION\/\/\1\"/g" $f
|
||||
done
|
||||
|
||||
# create new branch and commit
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
#!/bin/bash
|
||||
# This script helps toggle the remote version reference within the current
|
||||
# checkout repository. This will help facilitate the process of doing
|
||||
# pull requests where the remote referenced modules changed.
|
||||
#
|
||||
# It is assumed that remote source URLs are of the form:
|
||||
#
|
||||
# github.com/<entity>/<repository>?ref=<current version>//...
|
||||
#
|
||||
# Note, this script will make changes to the current files checked out.
|
||||
while getopts :c:v: option
|
||||
do
|
||||
case "${option}" in
|
||||
c) CURRENT_VERSION=${OPTARG};;
|
||||
v) NEW_VERSION=${OPTARG};;
|
||||
*) echo "Please refer to usage guide on GitHub" >&2
|
||||
exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
entity_name="microsoft"
|
||||
project_name="bedrock"
|
||||
|
||||
if [ -z "$NEW_VERSION" ]; then
|
||||
echo "version to update remote references to is required"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -c "$CURRENT_VERSION" ]; then
|
||||
echo "version to update remote references to is required"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
NEW_VERSION=`echo $NEW_VERSION | sed 's/\./\\\./'`
|
||||
CURRENT_VERSION=`echo $CURRENT_VERSION | sed 's/\./\\\./'`
|
||||
|
||||
read -p "This script will modify files in this checked out repository. Are you sure you want to continue? " -n 1 -r
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
# go to base Bedrock directory (relative to this script location which is
|
||||
# <top level>/tools.
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
cd $SCRIPT_DIR/..
|
||||
|
||||
# determine files that need updating
|
||||
FILE_SEARCH=`grep -r "source[ ]\{0,\}=[ ]\{0,\}\"github.com\/$entity_name\/$project_name" * | awk '{print $1}' | grep ".tf" | sort -u | sed "s/://"`
|
||||
echo $FILE_SEARCH
|
||||
|
||||
# update files
|
||||
for f in $FILE_SEARCH; do
|
||||
sed -i -r "s/source[ ]{0,}=[ ]{0,}\"github.com\/$entity_name\/$project_name\?ref=$CURRENT_VERSION\/\/(.*)\"/source = \"github.com\/$entity_name\/$project_name\?ref=$NEW_VERSION\/\/\1\"/g" $f
|
||||
done
|
||||
|
||||
echo "remote references updated"
|
||||
fi
|
Загрузка…
Ссылка в новой задаче