This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
/
Makefile
66 lines (45 loc) · 1.54 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
66
#!make
GENERATE_DOCS_COMMAND:=terraform-docs markdown . > README.md
build:
@docker-compose build
develop:
@docker-compose -f ./docker-compose.yml -f ./docker-compose.develop.yml run --rm workhorse bash ; docker-compose down -v
test-docker:
@docker-compose -f ./docker-compose.yml run --rm workhorse make test
lint-docker:
@docker-compose -f ./docker-compose.yml run --rm --no-deps workhorse make lint
down:
@docker-compose down -v
init:
@pip3 install -r requirements.txt
fix-py:
@black .
@isort .
fix-go:
@terraform fmt -recursive
@find . -name '*.go' | xargs gofmt -w -s
fix: fix-go fix-py
lint-py:
@black --check .
@isort . --check --diff
@flake8 **/*.py
lint-go:
@terraform fmt -check -recursive -diff=true
@test -z $(shell find . -type f -name '*.go' | xargs gofmt -l)
lint: lint-py lint-go
clean-state:
@find . -type f -name 'terraform.tfstate*' | xargs rm -rf
@find . -type f -name 'dashboard.json' | xargs rm -rf
@find . -type d -name '.terraform' | xargs rm -rf
clean-py:
@find . -type f -name '*.pyc' | xargs rm -rf
clean: clean-py clean-state
generate-docs: fix lint
@find terraform_modules -maxdepth 1 -type d -not -path 'terraform_modules' -exec sh -c 'cd {} && $(GENERATE_DOCS_COMMAND)' ';'
@find terraform_modules/lambda/triggers -maxdepth 1 -type d -not -path 'terraform_modules/lambda/triggers' -exec sh -c 'cd {} && $(GENERATE_DOCS_COMMAND)' ';'
test-unit:
@coverage run -m pytest test/unit/test_*.py && coverage report -m
test-integration:
@cd test/integration && go test
test: test-unit test-integration
.PHONY: test