-
Notifications
You must be signed in to change notification settings - Fork 51
/
Makefile
50 lines (41 loc) · 1.03 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
# Variables
APP_NAME=app
ROOT=$(shell pwd)
## Lint
DOCKER_IMAGE_LINTER=alvarofpp/linter:latest
LINT_COMMIT_TARGET_BRANCH=origin/main
## Test
TEST_CONTAINER_NAME=${APP_NAME}_test
# Commands
.PHONY: install-hooks
install-hooks:
git config core.hooksPath .githooks
.PHONY: build
build: install-hooks
@docker compose build --pull
.PHONY: build-no-cache
build-no-cache: install-hooks
@docker compose build --no-cache --pull
.PHONY: lint
lint:
@docker pull ${DOCKER_IMAGE_LINTER}
@docker run --rm -v ${ROOT}:/app ${DOCKER_IMAGE_LINTER} " \
lint-commit ${LINT_COMMIT_TARGET_BRANCH} \
&& lint-markdown \
&& lint-dockerfile \
&& lint-yaml \
&& lint-shell-script \
&& lint-python"
.PHONY: test
test:
@docker compose run --rm -v ${ROOT}:/app \
--name ${TEST_CONTAINER_NAME} ${APP_NAME} \
pytest
.PHONY: test-coverage
test-coverage:
@docker compose run --rm -v ${ROOT}:/app \
--name ${TEST_CONTAINER_NAME} ${APP_NAME} \
/bin/bash -c "pytest --cov=validate_docbr/"
.PHONY: shell
shell:
@docker compose run --rm ${APP_NAME} bash