forked from Boavizta/boaviztapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (32 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
CURRENT_VERSION := $(shell poetry version -s || sed -n '3s/.*version = "\(.*\)"/\1/p' pyproject.toml)
TIMESTAMP := $(shell date " %H.%M-%m-%d-%y")
DOCKER_NAME := boavizta/boaviztapi:${CURRENT_VERSION}
SEMVERS := major minor patch
clean:
find . -name "*.pyc" -exec rm -rf {} \;
rm -rf dist *.egg-info __pycache__
install: install_pip
install_pip:
poetry install --with dev
test:
poetry run pytest
run:
poetry run uvicorn boaviztapi.main:app
$(SEMVERS):
poetry version $@
$(MAKE) npm_version
$(MAKE) tag_version
npm_version:
npm version --no-git-tag-version ${CURRENT_VERSION}
tag_version:
git commit -m "release: bump to ${CURRENT_VERSION}" pyproject.toml package.json package-lock.json
git tag ${CURRENT_VERSION}
build:
poetry build
distribute:
poetry config pypi-token.pypi ${API_TOKEN}
poetry publish --build
docker-build:
docker build -t $(DOCKER_NAME) . --build-arg VERSION=${CURRENT_VERSION}
docker-build-development:
docker build -t boavizta/boaviztapi:${TIMESTAMP} . --build-arg VERSION=${TIMESTAMP}