add makefile
This commit is contained in:
1 parent
f22f0f2ccc
commit
a52fc338c9
1 file changed
+31
@@ -0,0 +1,31 @@
|
||||
PYTHON ?= python3
|
||||
DOCKER ?= docker
|
||||
DOCKER_COMPOSE ?= $(DOCKER) compose -f docker-compose.yml
|
||||
|
||||
RUNTIME_LIBS := libs/mangacollec libs/mangacollec-store libs/container
|
||||
RUNTIME_WHEEL_DIR := _dist/
|
||||
API_IMAGE := booksync-api:latest
|
||||
WORKER_IMAGE := booksync-worker:latest
|
||||
DASH_IMAGE := booksync-dash:latest
|
||||
|
||||
.PHONY: build_libs build_api build_worker build_dash run_dash run_docker
|
||||
build_libs:
|
||||
@mkdir -p "$(RUNTIME_WHEEL_DIR)" && find "$(RUNTIME_WHEEL_DIR)" -maxdepth 1 -type f -name '*.whl' -exec trash {} +
|
||||
$(PYTHON) -m pip wheel --no-deps --wheel-dir="$(RUNTIME_WHEEL_DIR)" $(RUNTIME_LIBS)
|
||||
|
||||
########## DOCKER ######################################################################################################
|
||||
build_api: build_libs
|
||||
$(DOCKER) build --tag "$(API_IMAGE)" --file booksync-api/Dockerfile .
|
||||
|
||||
build_worker: build_libs
|
||||
$(DOCKER) build --tag "$(WORKER_IMAGE)" --file booksync-worker/Dockerfile .
|
||||
|
||||
build_dash:
|
||||
$(DOCKER) build --tag "$(DASH_IMAGE)" --file booksync-dash/Dockerfile .
|
||||
|
||||
run_dash:
|
||||
$(DOCKER_COMPOSE) up --no-deps --no-recreate --no-build --pull never dash
|
||||
|
||||
run_docker: build_worker build_api build_dash
|
||||
$(DOCKER_COMPOSE) down
|
||||
$(DOCKER_COMPOSE) up --build -d
|
||||
Reference in new issue
Block a user