-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (31 loc) · 1.11 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
RED = $(shell tput -Txterm setab 1 && tput -Txterm setaf 0)
GREEN = $(shell tput -Txterm setab 2 && tput -Txterm setaf 0)
PURPLE = $(shell tput -Txterm setab 5 && tput -Txterm setaf 7)
RESET = $(shell tput -Txterm sgr0)
VAR_FILE = ../terraform.prod.tfvars
all: create
create: create-compute-engine
init: create-s3 create-compute-engine
create-s3:
@echo ""
@echo "$(GREEN) Terraform s3 init $(RESET)"
@cd src/s3_init && terraform init
@cd src/s3_init && terraform apply -auto-approve
create-compute-engine:
@echo ""
@echo "$(GREEN) Terraform compute engine init $(RESET)"
@cd src && terraform init
@cd src && terraform apply -auto-approve -var-file=$(VAR_FILE)
destroy-s3:
@echo ""
@echo "$(PURPLE) Terraform s3 destroy $(RESET)"
@cd src/s3_init && terraform init
@cd src/s3_init && terraform destroy -auto-approve
destroy-compute-engine:
@echo ""
@echo "$(PURPLE) Terraform compute engine destroy $(RESET)"
@cd src && terraform init
@cd src && terraform destroy -auto-approve -var-file=$(VAR_FILE)
clean: destroy-compute-engine
fclean: destroy-compute-engine destroy-s3
.PHONY: all create init clean fclean