-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (51 loc) · 1.89 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
62
63
64
65
SHELL := /bin/bash
VERSION := 0.0.1
BUILD_INFO := Manual build
ENV_FILE := .env
ifeq ($(filter $(MAKECMDGOALS),config clean),)
ifneq ($(strip $(wildcard $(ENV_FILE))),)
ifneq ($(MAKECMDGOALS),config)
include $(ENV_FILE)
export
endif
endif
endif
.PHONY: help lint image push build run
.DEFAULT_GOAL := help
help: ## 💬 This help message :)
@echo -e "\e[34m$@\e[0m" || true
@grep -E '[a-zA-Z_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
all: bootstrap build deploy ## 🏃♀️ Run all the things
lint: ## 🌟 Lint & format, will not fix but sets exit code on error, use in CI
@echo -e "\e[34m$@\e[0m" || true
@terraform fmt -check -recursive -diff
build: ## 🔨 Run a local binary build without a container
@echo -e "\e[34m$@\e[0m" || true
@echo "Build your binary here . . . (Maybe push it to ACR)"
run: ## 🏃 Run application, used for local development
@echo -e "\e[34m$@\e[0m" || true
@echo "Not implemented yet!"
test: ## 🧪 Run tests, used for local development
@echo -e "\e[34m$@\e[0m" || true
@echo "Not implemented yet!"
bootstrap: ## 🥾 Deploy core project resources
@echo -e "\e[34m$@\e[0m" || true
@./scripts/bootstrap.sh
deploy: ## 🏡 Deploy application resources
@echo -e "\e[34m$@\e[0m" || true
@./scripts/deploy.sh
destroy: bootstrap ## 💣 Destroy application resources
@echo -e "\e[34m$@\e[0m" || true
@./scripts/destroy.sh
e2e-test: ## 🤖 Run end to end tests against the API
@figlet $@ || true
@echo "Not implemented yet!"
clean: ## 🧹 Clean up local files
@figlet $@ || true
@rm -rf infra/terraform/.terraform
@rm -rf infra/terraform/terraform.tfstate.*
@rm -rf infra/terraform/*.tfplan
@rm -rf infra/terraform/bootstrap_*.*
@find ./src -type d -name 'bin' | xargs rm -rf
@find ./src -type d -name 'obj' | xargs rm -rf
@find ./src -name 'coverage.json' | xargs rm -rf