- manage nomad jobs - create makefile - create gitignore - manage terragrunt environments - add build jobs
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
SHELL := /bin/bash
|
||||
ENVIRONMENT ?= au-syd1
|
||||
ENV_DIR = environments/$(ENVIRONMENT)
|
||||
PLAN_DIR = plans
|
||||
PLAN_FILE = ../../$(PLAN_DIR)/$(ENVIRONMENT).plan
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@echo "Cleaning Terraform files..."
|
||||
find environments -type f -name '*.tf' -exec rm -f "{}" \; && \
|
||||
find environments -type f -name '.terraform.lock.hcl' -exec rm -f "{}" \; && \
|
||||
find environments -type d -name '.terraform' -exec rm -rf "{}" \; && \
|
||||
rm -rf plans
|
||||
|
||||
.PHONY: init
|
||||
init:
|
||||
terragrunt --terragrunt-working-dir $(ENV_DIR) init
|
||||
|
||||
.PHONY: plan
|
||||
plan: init
|
||||
@mkdir -p $(PLAN_DIR)
|
||||
terragrunt --terragrunt-working-dir $(ENV_DIR) plan -out=$(PLAN_FILE)
|
||||
|
||||
.PHONY: apply
|
||||
apply:
|
||||
terragrunt --terragrunt-working-dir $(ENV_DIR) apply $(PLAN_FILE)
|
||||
Reference in New Issue
Block a user