-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (27 loc) · 1006 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
NAME = inception
CONFIGS_FOLDER = ./srcs/configs
COMPOSE_FILE = ./srcs/docker-compose.yml
ENV = ./srcs/.env
BASEYML = ./srcs/tools/base.yml
LOGIN = $(shell whoami)
all: config build run
config:
@bash ./srcs/tools/create_inception.sh $(ENV) $(BASEYML) $(COMPOSE_FILE)
build:
@sudo bash ./srcs/tools/check_data.sh $(ENV)
sudo docker-compose -f $(COMPOSE_FILE) build
@echo "\n\nInception is ready to be launched."
run:
sudo docker-compose -f $(COMPOSE_FILE) up -d
@echo "\n\nInception is now running on https://${LOGIN}.42.fr."
stop:
sudo docker-compose -f $(COMPOSE_FILE) stop
test: build run
clean: stop
sudo docker-compose -f $(COMPOSE_FILE) down -v
fclean: clean
@bash ./srcs/tools/delete_inception.sh
@if [ -n "$$(sudo docker ps -a -q)" ]; then sudo docker rm -f $$(sudo docker ps -a -q); fi
@if [ -n "$$(sudo docker images -q)" ]; then sudo docker rmi -f $$(sudo docker images -q); fi
@if [ -n "$$(sudo docker volume ls -q)" ]; then sudo docker volume prune -f; fi
re: fclean all