From ceebf89daf75ac0eb9efda4f7317a5b3739a2461 Mon Sep 17 00:00:00 2001 From: Colin Saliceti Date: Thu, 5 Dec 2024 11:15:07 +0000 Subject: [PATCH] Replace terrafile terrafile is no longer maintained. Replace with a simple git command. --- .gitignore | 2 -- Makefile | 11 +++----- global_config/production.sh | 1 + global_config/qa.sh | 1 + global_config/review.sh | 1 + global_config/staging.sh | 1 + terraform/app/.terraform.lock.hcl | 26 +++++++++---------- .../workspace-variables/production_Terrafile | 3 --- terraform/workspace-variables/qa_Terrafile | 3 --- .../workspace-variables/review_Terrafile | 3 --- .../workspace-variables/staging_Terrafile | 3 --- 11 files changed, 21 insertions(+), 34 deletions(-) delete mode 100644 terraform/workspace-variables/production_Terrafile delete mode 100644 terraform/workspace-variables/qa_Terrafile delete mode 100644 terraform/workspace-variables/review_Terrafile delete mode 100644 terraform/workspace-variables/staging_Terrafile diff --git a/.gitignore b/.gitignore index c965bee634..2355ee16a0 100644 --- a/.gitignore +++ b/.gitignore @@ -60,7 +60,6 @@ terraform/app/vendor/ terraform/domains/environment_domains/vendor terraform.tfstate* tokens -bin/terrafile # ENV files .env* @@ -104,5 +103,4 @@ dump.rdb .idea # devops files -bin/terrafile bin/konduit.sh diff --git a/Makefile b/Makefile index f235f58141..f4a8ab19f5 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,6 @@ LOCAL_BRANCH :=$$(git rev-parse --abbrev-ref HEAD) LOCAL_SHA :=$$(git rev-parse HEAD) LOCAL_TAG :=dev-$(LOCAL_BRANCH)-$(LOCAL_SHA) -TERRAFILE_VERSION=0.8 ARM_TEMPLATE_TAG=1.1.6 RG_TAGS={"Product" : "Teaching vacancies"} REGION=UK South @@ -44,10 +43,6 @@ local: ## local # Same values as the deployed dev environment, adapted for local $(eval local_override=-d file:terraform/workspace-variables/local_app_env.yml -d file:terraform/workspace-variables/my_app_env.yml) $(eval local_filter=| sed -e '/APP_ROLE=/d' -e '/RAILS_ENV=/d') -bin/terrafile: ## Install terrafile to manage terraform modules - curl -sL https://github.com/coretech/terrafile/releases/download/v${TERRAFILE_VERSION}/terrafile_${TERRAFILE_VERSION}_$$(uname)_x86_64.tar.gz \ - | tar xz -C ./bin terrafile - .PHONY: review review: test-cluster ## review # Requires `pr_id=NNNN` $(if $(pr_id), , $(error Missing environment variable "pr_id")) @@ -128,8 +123,10 @@ ci: ## Run in automation environment $(eval export SKIP_AZURE_LOGIN=true) .PHONY: terraform-app-init -terraform-app-init: bin/terrafile set-azure-account - ./bin/terrafile -p terraform/app/vendor/modules -f terraform/workspace-variables/$(var_file)_Terrafile +terraform-app-init: set-azure-account + rm -rf terraform/app/vendor/modules/aks + git -c advice.detachedHead=false clone --depth=1 --single-branch --branch ${TERRAFORM_MODULES_TAG} https://github.com/DFE-Digital/terraform-modules.git terraform/app/vendor/modules/aks + terraform -chdir=terraform/app init -upgrade -reconfigure -input=false $(backend_config) $(eval export TF_VAR_azure_resource_prefix=${AZURE_RESOURCE_PREFIX}) diff --git a/global_config/production.sh b/global_config/production.sh index 0fb4c6ffe2..0daa10aaf4 100644 --- a/global_config/production.sh +++ b/global_config/production.sh @@ -3,3 +3,4 @@ var_file=production CONFIG_SHORT=pd AZURE_SUBSCRIPTION=s189-teacher-services-cloud-production AZURE_RESOURCE_PREFIX=s189p01 +TERRAFORM_MODULES_TAG=stable diff --git a/global_config/qa.sh b/global_config/qa.sh index 22b5434c78..d5d626d12e 100644 --- a/global_config/qa.sh +++ b/global_config/qa.sh @@ -3,3 +3,4 @@ var_file=qa CONFIG_SHORT=qa AZURE_SUBSCRIPTION=s189-teacher-services-cloud-test AZURE_RESOURCE_PREFIX=s189t01 +TERRAFORM_MODULES_TAG=testing diff --git a/global_config/review.sh b/global_config/review.sh index ef443c481e..79af29dff4 100644 --- a/global_config/review.sh +++ b/global_config/review.sh @@ -3,3 +3,4 @@ var_file=review CONFIG_SHORT=rv AZURE_SUBSCRIPTION=s189-teacher-services-cloud-test AZURE_RESOURCE_PREFIX=s189t01 +TERRAFORM_MODULES_TAG=main diff --git a/global_config/staging.sh b/global_config/staging.sh index 8a3d53af71..2cf622067b 100644 --- a/global_config/staging.sh +++ b/global_config/staging.sh @@ -3,3 +3,4 @@ var_file=staging CONFIG_SHORT=st AZURE_SUBSCRIPTION=s189-teacher-services-cloud-test AZURE_RESOURCE_PREFIX=s189t01 +TERRAFORM_MODULES_TAG=testing diff --git a/terraform/app/.terraform.lock.hcl b/terraform/app/.terraform.lock.hcl index 71c580f0b7..780fbdf80a 100644 --- a/terraform/app/.terraform.lock.hcl +++ b/terraform/app/.terraform.lock.hcl @@ -89,21 +89,21 @@ provider "registry.terraform.io/hashicorp/kubernetes" { } provider "registry.terraform.io/hashicorp/random" { - version = "3.6.2" + version = "3.6.3" hashes = [ - "h1:R5qdQjKzOU16TziCN1vR3Exr/B+8WGK80glLTT4ZCPk=", - "zh:0ef01a4f81147b32c1bea3429974d4d104bbc4be2ba3cfa667031a8183ef88ec", - "zh:1bcd2d8161e89e39886119965ef0f37fcce2da9c1aca34263dd3002ba05fcb53", - "zh:37c75d15e9514556a5f4ed02e1548aaa95c0ecd6ff9af1119ac905144c70c114", - "zh:4210550a767226976bc7e57d988b9ce48f4411fa8a60cd74a6b246baf7589dad", - "zh:562007382520cd4baa7320f35e1370ffe84e46ed4e2071fdc7e4b1a9b1f8ae9b", - "zh:5efb9da90f665e43f22c2e13e0ce48e86cae2d960aaf1abf721b497f32025916", - "zh:6f71257a6b1218d02a573fc9bff0657410404fb2ef23bc66ae8cd968f98d5ff6", + "h1:f6jXn4MCv67kgcofx9D49qx1ZEBv8oyvwKDMPBr0A24=", + "zh:04ceb65210251339f07cd4611885d242cd4d0c7306e86dda9785396807c00451", + "zh:448f56199f3e99ff75d5c0afacae867ee795e4dfda6cb5f8e3b2a72ec3583dd8", + "zh:4b4c11ccfba7319e901df2dac836b1ae8f12185e37249e8d870ee10bb87a13fe", + "zh:4fa45c44c0de582c2edb8a2e054f55124520c16a39b2dfc0355929063b6395b1", + "zh:588508280501a06259e023b0695f6a18149a3816d259655c424d068982cbdd36", + "zh:737c4d99a87d2a4d1ac0a54a73d2cb62974ccb2edbd234f333abd079a32ebc9e", "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:9647e18f221380a85f2f0ab387c68fdafd58af6193a932417299cdcae4710150", - "zh:bb6297ce412c3c2fa9fec726114e5e0508dd2638cad6a0cb433194930c97a544", - "zh:f83e925ed73ff8a5ef6e3608ad9225baa5376446349572c2449c0c0b3cf184b7", - "zh:fbef0781cb64de76b1df1ca11078aecba7800d82fd4a956302734999cfd9a4af", + "zh:a357ab512e5ebc6d1fda1382503109766e21bbfdfaa9ccda43d313c122069b30", + "zh:c51bfb15e7d52cc1a2eaec2a903ac2aff15d162c172b1b4c17675190e8147615", + "zh:e0951ee6fa9df90433728b96381fb867e3db98f66f735e0c3e24f8f16903f0ad", + "zh:e3cdcb4e73740621dabd82ee6a37d6cfce7fee2a03d8074df65086760f5cf556", + "zh:eff58323099f1bd9a0bec7cb04f717e7f1b2774c7d612bf7581797e1622613a0", ] } diff --git a/terraform/workspace-variables/production_Terrafile b/terraform/workspace-variables/production_Terrafile deleted file mode 100644 index 5b2b118f00..0000000000 --- a/terraform/workspace-variables/production_Terrafile +++ /dev/null @@ -1,3 +0,0 @@ -aks: - source: "https://github.com/DFE-Digital/terraform-modules" - version: "stable" diff --git a/terraform/workspace-variables/qa_Terrafile b/terraform/workspace-variables/qa_Terrafile deleted file mode 100644 index b4c222c13d..0000000000 --- a/terraform/workspace-variables/qa_Terrafile +++ /dev/null @@ -1,3 +0,0 @@ -aks: - source: "https://github.com/DFE-Digital/terraform-modules" - version: "testing" diff --git a/terraform/workspace-variables/review_Terrafile b/terraform/workspace-variables/review_Terrafile deleted file mode 100644 index 65af53b11d..0000000000 --- a/terraform/workspace-variables/review_Terrafile +++ /dev/null @@ -1,3 +0,0 @@ -aks: - source: "https://github.com/DFE-Digital/terraform-modules" - version: "main" diff --git a/terraform/workspace-variables/staging_Terrafile b/terraform/workspace-variables/staging_Terrafile deleted file mode 100644 index b4c222c13d..0000000000 --- a/terraform/workspace-variables/staging_Terrafile +++ /dev/null @@ -1,3 +0,0 @@ -aks: - source: "https://github.com/DFE-Digital/terraform-modules" - version: "testing"