-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (37 loc) · 1.52 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
SHELL=/bin/bash
.DEFAULT_GOAL := help
.PHONY: help
help: ## Shows this help text
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: init
init: clean install checkov test ## Clean environment and reinstall all dependencies
.PHONY: clean
clean: ## Removes project virtual env and untracked files
rm -rf .venv cdk.out build dist **/*.egg-info .pytest_cache node_modules .coverage
poetry env remove --all
.PHONY: install
install: ## Install the project dependencies using Poetry.
poetry install --with lint,test,checkov
poetry run pre-commit install --hook-type pre-commit --hook-type commit-msg --hook-type pre-push
.PHONY: update
update: ## Update the project dependencies using Poetry.
poetry update --with lint,test,checkov
.PHONY: test
test: ## Run tests
poetry run python -m pytest
.PHONY: lint
lint: ## Apply linters to all files
poetry run pre-commit run --all-files
.PHONY: synth
synth: ## Synthetize all Cdk stacks
poetry run cdk synth
.PHONY: checkov
checkov: synth ## Run Checkov against IAC code
poetry run checkov --config-file .checkov --baseline .checkov.baseline
.PHONY: checkov-baseline
checkov-baseline: synth ## Run checkov and create a new baseline for future checks
poetry run checkov --config-file .checkov --create-baseline --soft-fail
mv cdk.out/.checkov.baseline .checkov.baseline
.PHONY: snapshot-update
snapshot-update: ## Run tests and update the snapshots baseline
poetry run python -m pytest --snapshot-update