-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (49 loc) · 2.41 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.DEFAULT_GOAL := all
.PHONY: all
all: clean python terraform-apply docker
clean:
rm -rf build
format:
find . -name "*.tf" -not -path "*.terraform*" | xargs terraform fmt
cd steps/list && pipenv install --dev && pipenv run format
cd steps/gather && pipenv install --dev && pipenv run format
cd steps/transform && pipenv install --dev && pipenv run format
cd steps/invalidate && pipenv install --dev && pipenv run format
cd edge/cloudfront && pipenv install --dev && pipenv run format
test-format:
find . -name "*.sh" -not -path "*.terraform*" | xargs shellcheck
find . -name "*.tf" -not -path "*.terraform*" | xargs terraform fmt -check
cd steps/list && pipenv install --dev && pipenv run test-format
cd steps/gather && pipenv install --dev && pipenv run test-format
cd steps/transform && pipenv install --dev && pipenv run test-format
cd steps/invalidate && pipenv install --dev && pipenv run test-format
cd edge/cloudfront && pipenv install --dev && pipenv run test-format
test-unit:
cd steps/list && pipenv install --dev && pipenv run test-unit
cd steps/gather && pipenv install --dev && pipenv run test-unit
cd steps/transform && pipenv install --dev && pipenv run test-unit
cd steps/invalidate && pipenv install --dev && pipenv run test-unit
cd edge/cloudfront && pipenv install --dev && pipenv run test-unit
docker:
cd infra && terraform init -input=false -backend-config=../backend.hcl
/bin/bash scripts/build-docker.sh steps/scan --repository "$$(cd infra && terraform output -raw scan-repo)"
python:
cd infra && terraform init -input=false -backend-config=../backend.hcl
/bin/bash scripts/build-python.sh steps/list
/bin/bash scripts/build-python.sh steps/gather --include-venv
/bin/bash scripts/build-python.sh steps/transform --include-venv
/bin/bash scripts/build-python.sh steps/invalidate
/bin/bash scripts/build-python.sh edge/cloudfront
terraform-plan:
cd infra && terraform init -input=false -backend-config=../backend.hcl
cd infra && terraform plan
terraform-apply:
cd infra && terraform init -input=false -backend-config=../backend.hcl
cd infra && terraform apply -auto-approve
backend: backend-plan backend-apply
backend-plan:
cd infra/.tf-backend && terraform init -input=false
cd infra/.tf-backend && terraform plan -state=backend.tfstate -out=backend.tfplan
backend-apply:
cd infra/.tf-backend && terraform init -input=false
cd infra/.tf-backend && terraform apply -state=backend.tfstate backend.tfplan