-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
79 lines (57 loc) · 2.84 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
67
68
69
70
71
72
73
74
75
76
77
78
79
all: help
pypi-upload: build-dist ## Uploads new package to PyPi after clean, build
poetry publish
update-dependencies: ## Updates requirements.txt and requirements_dev.txt from pyproject.toml
poetry export --without-hashes --without=dev --format=requirements.txt > requirements.txt
poetry export --without-hashes --only=dev --format=requirements.txt > requirements-dev.txt
# pypi-upload-test: build-dist ## Uploads new package to TEST PyPi after clean, build
# twine upload -r testpypi dist/*
build-dist: clean-dist ## Builds new package dist
poetry build --verbose
build: ## build Flask app
docker compose build app
build-dev: ## build Flask app w/ dev dependencies
docker compose build app --build-arg DEV=True
clean-dist: ## Cleans dist dir
rm -rf dist/*
install-static: ## Installs static assets
cd app/static; \
npm install; \
npm run build
test-unit: ## Runs unit tests. Compatible with dev environment / `make up`
poetry run pytest --junitxml=pytest.xml --cov=harvester ./tests/unit
test-integration: ## Runs integration tests. Compatible with dev environment / `make up`
poetry run pytest --junitxml=pytest.xml --cov=harvester ./tests/integration
test-functional: ## Runs integration tests. Compatible with dev environment / `make up`
poetry run pytest --noconftest --junitxml=pytest.xml --cov=harvester ./tests/functional
test: up test-unit test-integration ## Runs all tests. Compatible with dev environment / `make up`
test-ci: ## Runs all tests using only db and required test resources. NOT compatible with dev environment / `make up`
docker compose up -d db nginx-harvest-source transformer
make test-unit
make test-integration
make test-functional
make down
up: ## Sets up local flask and harvest runner docker environments. harvest runner gets DATABASE_PORT from .env
DATABASE_PORT=5433 docker compose up -d
docker compose -p harvest-app up db -d
up-unified: ## For testing when you want a shared db between flask and harvester
docker compose up -d
down: ## Tears down the flask and harvester containers
docker compose down
docker compose -p harvest-app down
up-debug: ## Sets up local docker environment with VSCODE debug support enabled
docker compose -f docker-compose.yml -f docker-compose_debug.yml up -d
up-prod: ## Sets up local flask env running gunicorn instead of standard dev server
docker compose -f docker-compose.yml -f docker-compose_prod.yml up -d
clean: ## Cleans docker images
docker compose down -v --remove-orphans
docker compose -p harvest-app down -v --remove-orphans
lint: ## Lints wtih ruff, isort, black
ruff check .
isort .
black .
# Output documentation for top-level targets
# Thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
.PHONY: help
help: ## This help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)