-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (52 loc) · 1.56 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
venv_activate :=
system := $(shell uname -s)
# Set the virtual environment activation command based on the system type
ifeq ($(system),Darwin) # Mac
venv_activate := source venv/bin/activate
else ifeq ($(system),Linux)
venv_activate := . venv/bin/activate
else
$(error Unsupported operating system: $(system))
endif
setup:
python -m venv venv
$(venv_activate)
pip install -r requirements-test.txt
#pre-commits:
# pip install pre-commit
# pre-commit install
# pre-commit autoupdate
install:
@ pip install --upgrade pip
@ pip install -r requirements.txt
run:
@python -m uvicorn app:app --port 80
dev:
@python -m uvicorn app:app --reload --port 1605
install-tests:
@ python -m pip install -r requirements-test.txt
test:
@pytest -p no:cacheprovider
@echo "testing complete"
clean:
@echo "cleaning"
@find . -type d -name '.pytest_cache' -exec rm -rf {} +
@find . -type d -name '.benchmarks' -exec rm -rf {} +
@find . -type d -name '__pycache__' -exec rm -rf {} +
@find . -type f -name '*.log' -exec rm {} +
docker:
@echo "docker building"
@docker build . -t aichats
@docker run -p 80:8080 aichats
compose:
@docker-compose up --build --force-recreate
docker-deploy:
@docker build -t laciferin/aichats .
@docker login -u laciferin
@docker push laciferin/aichats:latest
deploy:
ssh aichat "sh aichatsback/scripts/deploy.sh"
env:
@[ -f .env ] && echo ".env file already exists. Appending"
@grep -v '^#' .env.example | cut -d '=' -f 1 | xargs -I {} bash -c 'echo "$1=${!1}"' _ {} >> .env
.PHONY: run install clean setup test run env deploy compose docker dev