Skip to content

Commit

Permalink
Replace terrafile
Browse files Browse the repository at this point in the history
terrafile is no longer maintained. Replace with a simple git command.
  • Loading branch information
saliceti committed Dec 5, 2024
1 parent b6220e7 commit ceebf89
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 34 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ terraform/app/vendor/
terraform/domains/environment_domains/vendor
terraform.tfstate*
tokens
bin/terrafile

# ENV files
.env*
Expand Down Expand Up @@ -104,5 +103,4 @@ dump.rdb
.idea

# devops files
bin/terrafile
bin/konduit.sh
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"))
Expand Down Expand Up @@ -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})
Expand Down
1 change: 1 addition & 0 deletions global_config/production.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions global_config/qa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions global_config/review.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions global_config/staging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
26 changes: 13 additions & 13 deletions terraform/app/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions terraform/workspace-variables/production_Terrafile

This file was deleted.

3 changes: 0 additions & 3 deletions terraform/workspace-variables/qa_Terrafile

This file was deleted.

3 changes: 0 additions & 3 deletions terraform/workspace-variables/review_Terrafile

This file was deleted.

3 changes: 0 additions & 3 deletions terraform/workspace-variables/staging_Terrafile

This file was deleted.

0 comments on commit ceebf89

Please sign in to comment.