-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
54 lines (36 loc) · 1.66 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
.PHONY: help build.test build.cli run start debug stop clean logs shell lint test
GIT_SHA = $(shell git rev-parse HEAD)
DOCKER_REPOTAG = $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_NAME):$(GIT_SHA)
default: help
build: build.cli build.test ## Build the cli and test containers
build.cli: ## Build the cli container
@docker-compose build cli
build.test: ## Build the test container
@docker-compose build test
build.lint: ## Build the lint container
@docker-compose build test
build.all: build.cli build.test build.lint ## Build all containers
help: ## show this help
@echo
@fgrep -h " ## " $(MAKEFILE_LIST) | fgrep -v fgrep | sed -Ee 's/([a-z.]*):[^#]*##(.*)/\1##\2/' | column -t -s "##"
@echo
run: start ## run the cli locally
start: ## run the cli locally in the background
@docker-compose up --build cli
stop: ## stop the cli
@docker-compose down --remove-orphans
clean: ## delete all data from the local databases
@docker-compose down --remove-orphans --volumes
network: ## Create the deps network if it doesn't exist
docker network create --driver bridge deps || true
shell: ## shell into a development container
@docker-compose build cli
@docker-compose run --rm cli sh
test: build.test network ## Run the unit tests and linters
@docker-compose -f docker-compose.yml run --rm test
@docker-compose down
lint: ## lint and autocorrect the code
@docker-compose build test
@docker-compose run --rm --no-deps test isort . && black --check . && mypy . && flake8 . && pylint --rcfile=.pylintrc deps && bandit deps && vulture --min-confidence 90 deps && codespell deps && find . -name '*.py' -exec pyupgrade {} +
install: ## build and install the cli
sudo pip install -e .