-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
51 lines (40 loc) · 1.77 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mbocquel <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/08/01 17:12:15 by mbocquel #+# #+# #
# Updated: 2023/12/04 13:44:50 by mbocquel ### ########.fr #
# #
# **************************************************************************** #
SOURCES = docker-compose.yml
CACHE_FILE = "/mnt/nfs/homes/$(USER)/.cache/yarn"
all: $(SOURCES) env_front env_back
docker-compose -f ./docker-compose.yml up
down: $(SOURCES) env_front env_back
docker-compose -f ./docker-compose.yml down
clean: $(SOURCES)
docker-compose -f ./docker-compose.yml down -v
fclean: clean
docker system prune -af
re: fclean all
env_back: /mnt/nfs/homes/$(USER)/env_ft_transcendence/env_back
@( \
if [ ! -e "backend/.env" ]; then \
cp /mnt/nfs/homes/$(USER)/env_ft_transcendence/env_back backend/.env; \
echo "Env file backend added !"; \
fi; \
)
env_front:
@( \
if [ ! -e "frontend/.env" ]; then \
echo -n "REACT_APP_URL_MACHINE=" > frontend/.env;\
env | grep cluster | cut -d ":" -f 1 | cut -d "/" -f 2 >> frontend/.env; \
echo "Env file frontend added !"; \
fi; \
)
cache: fclean
rm -rf $(CACHE_FILE)
.PHONY: all re down clean