Skip to content

Commit

Permalink
Merge pull request #1489 from DFE-Digital/replace-terrafile
Browse files Browse the repository at this point in the history
Replace terrafile
  • Loading branch information
neillturner authored Dec 2, 2024
2 parents be751e4 + 7aa6c2c commit f383ee1
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ env.local

# DevOps file
fetch_config.rb

bin/terrafile
bin/yaq

# Downloaded terraform modules
Expand Down
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
TERRAFILE_VERSION=0.8
ARM_TEMPLATE_TAG=1.1.6
RG_TAGS={"Product" : "Get into teaching website"}
SERVICE_SHORT=gitapi
Expand All @@ -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

Expand Down Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions global_config/development_aks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ ENVIRONMENT=development
CONFIG_SHORT=dv
AZ_SUBSCRIPTION=s189-teacher-services-cloud-test
AZURE_RESOURCE_PREFIX=s189t01
TERRAFORM_MODULES_TAG=main
1 change: 1 addition & 0 deletions global_config/production_aks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ ENVIRONMENT=production
CONFIG_SHORT=pd
AZ_SUBSCRIPTION=s189-teacher-services-cloud-production
AZURE_RESOURCE_PREFIX=s189p01
TERRAFORM_MODULES_TAG=stable
1 change: 1 addition & 0 deletions global_config/test_aks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ ENVIRONMENT=test
CONFIG_SHORT=ts
AZ_SUBSCRIPTION=s189-teacher-services-cloud-test
AZURE_RESOURCE_PREFIX=s189t01
TERRAFORM_MODULES_TAG=testing
3 changes: 0 additions & 3 deletions terraform/aks/config/development_aks_Terrafile

This file was deleted.

3 changes: 0 additions & 3 deletions terraform/aks/config/production_aks_Terrafile

This file was deleted.

3 changes: 0 additions & 3 deletions terraform/aks/config/test_aks_Terrafile

This file was deleted.

0 comments on commit f383ee1

Please sign in to comment.