-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
56 lines (37 loc) · 1008 Bytes
/
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
ENV_FILE_PATH=env/.env
-include $(ENV_FILE_PATH)
#######
# GENERAL
##
default: python-run
init: environment-init python-init
clean: python-clean container-clean
#######
# ENVIRONMENT
##
environment-init:
-cp -n env/example.env env/.env
#######
# PYTHON
##
python-run:
set -o allexport; source $(ENV_FILE_PATH); set +o allexport; venv/bin/python src/main.py
python-init: python-clean python-venv python-install
python-clean:
rm -rf venv/
python-venv:
python3 -m venv venv
python-install:
venv/bin/python -m pip install -r requirements.txt
#######
# CONTAINER
##
container: container-build container-run
container-build:
docker build --progress=plain -t $(GITHUB_USERNAME)/$(APP_NAME) .
container-run:
ENV_FILE_PATH=$(ENV_FILE_PATH) docker-compose --env-file $(ENV_FILE_PATH) up
container-run-detached:
ENV_FILE_PATH=$(ENV_FILE_PATH) docker-compose --env-file $(ENV_FILE_PATH) up -d
container-clean:
ENV_FILE_PATH=$(ENV_FILE_PATH) docker-compose --env-file $(ENV_FILE_PATH) rm -f