-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (42 loc) · 1.45 KB
/
Makefile
File metadata and controls
54 lines (42 loc) · 1.45 KB
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
all: up
.PHONY: up
.PHONY: all
all:
$(MAKE) init
$(MAKE) up
.PHONY: bonus
bonus: all
sh src/bonus.sh
.PHONY: init
init: .intra_login.txt prelude
@[ -t 0 ] || echo "You MUST set hostname manually!"
@[ ! -t 0 ] || printf "\033[33mYou MUST set hostname manually!\033[0m\n"
[ -f .intra_login.txt ] && mkdir -p "/home/$$(cat .intra_login.txt)/data/mariadb" "/home/$$(cat .intra_login.txt)/data/wordpress"
.intra_login.txt:
@sh -c 'printf "Enter intra login > " && IFS= read -r INTRA_LOGIN && printf "%s" "$${INTRA_LOGIN}" > $@ && ([ "$$(cat $@)" != "" ] || printf "%s" "$$(whoami)" > $@)'
.PHONY: clean
clean:
@sh -c 'echo "clean without fclean may result in the persistence of volume data. Press Enter to continue, or Ctrl+C to stop." && IFS= read -r UNUSED'
rm -f .intra_login.txt srcs/.env
.PHONY: fclean
fclean:
[ ! -f .intra_login.txt ] || rm -rf "/home/$$(cat .intra_login.txt)/data/mariadb" "/home/$$(cat .intra_login.txt)/data/wordpress"
rm -f .intra_login.txt srcs/.env
.PHONY: re
re:
$(MAKE) fclean
$(MAKE) all
.PHONY: up
up: prelude
docker compose --env-file ./srcs/.env -f ./src/docker-compose.yml up -d
.PHONY: down
down: prelude
docker compose --env-file ./srcs/.env -f ./src/docker-compose.yml $@
.PHONY: prelude
prelude: ./srcs/.env
./srcs/.env:
@sh ./src/init.sh
.PHONY: dev
dev: prelude
@docker compose --env-file ./srcs/.env -f ./src/docker-compose.yml down -v
@docker compose --env-file ./srcs/.env -f ./src/docker-compose.yml up -d --build