-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
94 lines (60 loc) · 1.77 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
.PHONY: tests
# Development
dependencies:
poetry install
pre-commit-hooks:
pre-commit install
development: dependencies pre-commit-hooks
# Testing
unit-tests:
poetry run py.test tests/unit
integration-tests: export DATASTORE_EMULATOR_HOST=0.0.0.0:8081
integration-tests:
poetry run py.test tests/integration
e2e-tests: export DATASTORE_EMULATOR_HOST=0.0.0.0:8081
e2e-tests:
poetry run py.test tests/e2e
smoke-tests: export DATASTORE_EMULATOR_HOST=0.0.0.0:8081
smoke-tests:
poetry run py.test tests/smoke
tests: unit-tests integration-tests smoke-tests e2e-tests
coverage: export DATASTORE_EMULATOR_HOST=0.0.0.0:8081
coverage:
poetry run py.test --cov=datastorm --cov-branch --cov-fail-under=90 --cov-report=html tests
# Static analysis
lint-code:
poetry run flake8 datastorm
lint-tests:
poetry run flake8 tests
lint: lint-code lint-tests
type-check:
poetry run mypy -p datastorm
# Docs
docs:
mkdocs serve
# Packaging
build: tests lint
poetry build
publish: build
poetry publish
# CI
ci-publish:
poetry publish --build --username "${PYPI_USERNAME}" --password "${PYPI_PASSWORD}" --no-interaction
ci-bump-version:
poetry run bump2version build
# Docker
docker-build:
docker build -t datastorm-test-env:255.0.0-3.6.9 .circleci/images
docker-run: docker-build
docker run --rm --name datastorm-test-env --publish 8081:8081 datastorm-test-env:255.0.0-3.6.9
docker-tag:
docker tag datastorm-test-env:255.0.0-3.6.9 javierluna/datastorm-test-env:255.0.0-3.6.9
docker-push: docker-build docker-tag
docker push javierluna/datastorm-test-env
docker-clean:
-docker stop datastore-test-env
-docker rm datastore-test-env
docker-tests: docker-build
docker run --rm -d --name datastore-test-env --publish 8081:8081 datastorm-test-env:255.0.0-3.6.9
sleep 5
$(MAKE) tests