-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (34 loc) · 1.37 KB
/
Makefile
File metadata and controls
42 lines (34 loc) · 1.37 KB
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
PROTOCCMD = protoc
POETRY_PATH = $(shell which poetry)
.PHONY: install_dev
install_dev:
$(POETRY_PATH) config virtualenvs.create false
$(POETRY_PATH) lock
$(POETRY_PATH) install --with=dev
.PHONY: install
install:
$(POETRY_PATH) lock
$(POETRY_PATH) install
src/stealthimfilestorage/proto/filestorage_pb2.py src/stealthimfilestorage/proto/filestorage_grpc.py: proto/filestorage.proto
@mkdir -p src/stealthimfilestorage/proto
python -m grpc_tools.protoc -Iproto --python_out=./src/stealthimfilestorage/proto --grpclib_python_out=./src/stealthimfilestorage/proto --mypy_out=./src/stealthimfilestorage/proto proto/filestorage.proto
@echo "Rewrite File"
@sed -i 's/import filestorage_pb2/from . import filestorage_pb2/g' ./src/stealthimfilestorage/proto/filestorage_grpc.py
cp ./src/stealthimfilestorage/proto ./src/stimfstool/proto -r
.PHONY: proto
proto: src/stealthimfilestorage/proto/filestorage_pb2.py src/stealthimfilestorage/proto/filestorage_grpc.py
.PHONY: build
build: proto
poetry build
./bin/StealthIMFileStorage.docker.zst:
docker-compose build
@mkdir -p ./bin
docker save stealthimfilestorage-app > ./bin/StealthIMFileStorage.docker
zstd ./bin/StealthIMFileStorage.docker -19
@rm ./bin/StealthIMFileStorage.docker
.PHONY: build_docker
build_docker: ./bin/StealthIMFileStorage.docker.zst
.PHONY: clean
clean:
@rm -rf ./src/stealthimfilestorage/proto
@rm -rf ./bin