From a379741f4c56ba23355226dbd369e9ee1631cad7 Mon Sep 17 00:00:00 2001 From: Neill Turner Date: Fri, 29 Nov 2024 14:04:23 +0000 Subject: [PATCH 1/2] Replace terrafile --- .gitignore | 2 -- Makefile | 13 ++++++------- global_config/development_aks.sh | 1 + global_config/production_aks.sh | 1 + global_config/test_aks.sh | 1 + terraform/aks/config/development_aks_Terrafile | 3 --- terraform/aks/config/production_aks_Terrafile | 3 --- terraform/aks/config/test_aks_Terrafile | 3 --- 8 files changed, 9 insertions(+), 18 deletions(-) delete mode 100644 terraform/aks/config/development_aks_Terrafile delete mode 100644 terraform/aks/config/production_aks_Terrafile delete mode 100644 terraform/aks/config/test_aks_Terrafile diff --git a/.gitignore b/.gitignore index 6514b1d1c..67df89c04 100644 --- a/.gitignore +++ b/.gitignore @@ -48,8 +48,6 @@ env.local # DevOps file fetch_config.rb - -bin/terrafile bin/yaq # Downloaded terraform modules diff --git a/Makefile b/Makefile index b694368a4..c192e9e4d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,3 @@ -TERRAFILE_VERSION=0.8 ARM_TEMPLATE_TAG=1.1.6 RG_TAGS={"Product" : "Get into teaching website"} SERVICE_SHORT=gitapi @@ -20,10 +19,6 @@ install-fetch-config: && chmod +x fetch_config.rb \ || true -bin/terrafile: ## Install terrafile to manage terraform modules - mkdir -p bin | 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 - bin/yaq: mkdir -p bin | curl -sL https://github.com/uk-devops/yaq/releases/download/v0.0.3/yaq_linux_amd64_v0.0.3.zip -o yaq.zip && unzip -o yaq.zip -d ./bin/ && rm yaq.zip @@ -65,8 +60,12 @@ setup-local-env: local_aks install-fetch-config set-azure-account set-key-vault- edit-local-app-secrets: local_aks install-fetch-config set-azure-account ./fetch_config.rb -s azure-key-vault-secret:${KEY_VAULT}/API-KEYS -e -d azure-key-vault-secret:${KEY_VAULT}/API-KEYS -f yaml -c -terraform-init: bin/terrafile set-azure-account - ./bin/terrafile -p terraform/aks/vendor/modules -f terraform/aks/config/$(CONFIG)_Terrafile +.PHONY: vendor-modules +vendor-modules: + rm -rf terraform/aks/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/aks/vendor/modules/aks + +terraform-init: vendor-modules set-azure-account terraform -chdir=terraform/aks init -upgrade -reconfigure \ -backend-config=resource_group_name=${AZURE_RESOURCE_PREFIX}-${SERVICE_SHORT}-${CONFIG_SHORT}-rg \ -backend-config=storage_account_name=${AZURE_RESOURCE_PREFIX}${SERVICE_SHORT}tfstate${CONFIG_SHORT}sa \ diff --git a/global_config/development_aks.sh b/global_config/development_aks.sh index 47b7f1ab9..4b3ef689d 100644 --- a/global_config/development_aks.sh +++ b/global_config/development_aks.sh @@ -3,3 +3,4 @@ ENVIRONMENT=development CONFIG_SHORT=dv AZ_SUBSCRIPTION=s189-teacher-services-cloud-test AZURE_RESOURCE_PREFIX=s189t01 +TERRAFORM_MODULES_TAG=main diff --git a/global_config/production_aks.sh b/global_config/production_aks.sh index 49696c624..431bf9270 100644 --- a/global_config/production_aks.sh +++ b/global_config/production_aks.sh @@ -3,3 +3,4 @@ ENVIRONMENT=production CONFIG_SHORT=pd AZ_SUBSCRIPTION=s189-teacher-services-cloud-production AZURE_RESOURCE_PREFIX=s189p01 +TERRAFORM_MODULES_TAG=stable diff --git a/global_config/test_aks.sh b/global_config/test_aks.sh index 9c4d19f91..fec4f50b4 100644 --- a/global_config/test_aks.sh +++ b/global_config/test_aks.sh @@ -3,3 +3,4 @@ ENVIRONMENT=test CONFIG_SHORT=ts AZ_SUBSCRIPTION=s189-teacher-services-cloud-test AZURE_RESOURCE_PREFIX=s189t01 +TERRAFORM_MODULES_TAG=testing diff --git a/terraform/aks/config/development_aks_Terrafile b/terraform/aks/config/development_aks_Terrafile deleted file mode 100644 index 65af53b11..000000000 --- a/terraform/aks/config/development_aks_Terrafile +++ /dev/null @@ -1,3 +0,0 @@ -aks: - source: "https://github.com/DFE-Digital/terraform-modules" - version: "main" diff --git a/terraform/aks/config/production_aks_Terrafile b/terraform/aks/config/production_aks_Terrafile deleted file mode 100644 index b4c222c13..000000000 --- a/terraform/aks/config/production_aks_Terrafile +++ /dev/null @@ -1,3 +0,0 @@ -aks: - source: "https://github.com/DFE-Digital/terraform-modules" - version: "testing" diff --git a/terraform/aks/config/test_aks_Terrafile b/terraform/aks/config/test_aks_Terrafile deleted file mode 100644 index b4c222c13..000000000 --- a/terraform/aks/config/test_aks_Terrafile +++ /dev/null @@ -1,3 +0,0 @@ -aks: - source: "https://github.com/DFE-Digital/terraform-modules" - version: "testing" From 7aa6c2c0c717f86b2a618635676970f79a43c3f5 Mon Sep 17 00:00:00 2001 From: Neill Turner Date: Fri, 29 Nov 2024 14:40:44 +0000 Subject: [PATCH 2/2] ignore end of support message --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index b3d24d441..ea9199a78 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -36,7 +36,7 @@ jobs: run: dotnet restore - name: Build - run: dotnet build --configuration Release --no-restore /warnaserror + run: dotnet build --configuration Release --no-restore /warnaserror /p:CheckEolTargetFramework=false - name: Spin Up Stack run: docker compose up -d