-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
34 lines (29 loc) · 912 Bytes
/
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
SHELL:=bash
aws_profile=default
aws_region=eu-west-2
default: help
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: bootstrap
bootstrap: ## Bootstrap local environment for first use
make git-hooks
pip3 install --user Jinja2 PyYAML boto3
@{ \
export AWS_PROFILE=$(aws_profile); \
export AWS_REGION=$(aws_region); \
python3 bootstrap_terraform.py; \
}
terraform fmt -recursive
.PHONY: git-hooks
git-hooks: ## Set up hooks in .git/hooks
@{ \
HOOK_DIR=.git/hooks; \
for hook in $(shell ls .githooks); do \
if [ ! -h $${HOOK_DIR}/$${hook} -a -x $${HOOK_DIR}/$${hook} ]; then \
mv $${HOOK_DIR}/$${hook} $${HOOK_DIR}/$${hook}.local; \
echo "moved existing $${hook} to $${hook}.local"; \
fi; \
ln -s -f ../../.githooks/$${hook} $${HOOK_DIR}/$${hook}; \
done \
}