-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (47 loc) · 991 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
57
58
59
60
.DEFAULT_GOAL := all
# Colors and Styles
RESET := \e[0m
BOLD := \e[1m
DIM := \e[2m
ITALIC := \e[3m
UNDERLINE := \e[4m
RED := \e[31m
GREEN := \e[32m
PURPLE := \e[95m
BLUE := \e[34m
YELLOW := \e[33m
MAGENTA := \e[35m
CYAN := \e[36m
# Variables
DOCKER_COMPOSE = docker-compose -f docker-compose.yml
DATA_DIRS = data \
data/nginx \
data/django \
data/postgresql \
data/hashicorp_vault
# Commands
RM := rm -rf
## RULES --
# Docker
build:
$(DOCKER_COMPOSE) build
up: build
@mkdir -p $(DATA_DIRS)
@$(DOCKER_COMPOSE) up
# Venv
venv:
$(RM) .env .envPy
python3 -m venv .env
@echo "Use this command : $(GREEN)[source .env/bin/activate]$(RESET)"
freeze: venv
pip install -r requirements.txt
pip freeze > Ressource/requirements.txt
# Global
all: build up
clean:
@$(RM) $(DATA_DIRS) || true
# @docker stop $$(docker ps -qa) || true
# @docker rm $$(docker ps -qa) || true
# @docker rmi -f $$(docker images -qa) || true
fclean: clean
$(RM) .env .envPy