-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (50 loc) · 1.67 KB
/
Makefile
File metadata and controls
69 lines (50 loc) · 1.67 KB
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
66
67
68
69
.DEFAULT_GOAL := help
# Use force targets instead of listing all the targets we have via .PHONY
# https://www.gnu.org/software/make/manual/html_node/Force-Targets.html#Force-Targets
.FORCE:
# Set default PAGER if not Set
PAGER ?= cat
# Root directory with Makefile
ROOT_DIR = $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
# Help prelude
define PRELUDE
Usage:
make [target]
endef
# Include maintainer Makefile
ifneq ($(IS_MAINTAINER),)
include Makefile.maintainer
endif
##@ Install
install/pre-commit: ## Install pre-commit hooks
@if test -n "$(IS_MAINTAINER)"; then \
pre-commit install --config .pre-commit-config-maintainer.yaml; \
else \
pre-commit install; \
fi
##@ Pools
ENVIRONMENTS := dev staging production
generate-pools: $(addprefix generate-pools-,$(ENVIRONMENTS)) .FORCE ## Generate Artemis pool configs for all environments
generate-pools-%: .FORCE ## Generate Artemis pool config for a specific environment
generate-artemis-pools generate $(ROOT_DIR)/terragrunt/environments/$*/artemis
##@ Cleanup
clean: .FORCE ## Cleanup
rm -rf $(ROOT_DIR)/.direnv
rm -rf $(ROOT_DIR)/.venv
rm -rf $$PROJECT_ROOT/.pytest
find . -name .terragrunt-cache | xargs rm -rf
# See https://www.thapaliya.com/en/writings/well-documented-makefiles/ for details.
reverse = $(if $(1),$(call reverse,$(wordlist 2,$(words $(1)),$(1)))) $(firstword $(1))
.help:
@awk 'BEGIN { \
FS = ":.*##"; \
printf "$(info $(PRELUDE))" \
} \
/^[a-zA-Z_/-]+:.*?##/ { \
printf " \033[36m%-35s\033[0m %s\n", $$1, $$2 \
} \
/^##@/ { \
printf "\n\033[1m%s\033[0m\n\n", substr($$0, 5) \
}' $(call reverse, $(MAKEFILE_LIST))
help: .FORCE ## Show this help
make -s .help | $(PAGER)