-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (28 loc) · 753 Bytes
/
Copy pathMakefile
File metadata and controls
36 lines (28 loc) · 753 Bytes
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
export GIT_SHA
export VERSION
export API_URL
DOCKER_RUN=docker-compose run --rm
TF_PLAN=ops-technical-test.tfplan
GIT_SHA=$(shell git rev-parse --short HEAD)
VERSION=1.0
API_URL = $(shell $(DOCKER_RUN) terraform output api_endpoint)
S3_BUCKET=ops-technical-test-tf-backend
plan: init ssm-put
$(DOCKER_RUN) terraform plan -out=$(TF_PLAN)
.PHONY: plan
deploy: init plan
$(DOCKER_RUN) terraform apply $(TF_PLAN)
.PHONY: deploy
ssm-put:
echo "Storing GIT_SHA and VERSION of your application"
bash scripts/ssm-put.sh
init:
$(DOCKER_RUN) terraform init
.PHONY: init
tf-backend:
$(DOCKER_RUNNER) aws s3 mb s3://${S3_BUCKET} --region ap-southeast-2
test:
bash scripts/test.sh $(API_URL)
clean:
$(DOCKER_RUN) terraform destroy
.PHONY: clean