-
-
Notifications
You must be signed in to change notification settings - Fork 93
/
Makefile
32 lines (28 loc) · 1.19 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
COMMAND_COLOR = \033[36m
DESC_COLOR = \033[32m
CLEAR_COLOR = \033[0m
.PHONY: help
help: ## prints this message ##
@echo ""; \
echo "Usage: make <command>"; \
echo ""; \
echo "where <command> is one of the following:"; \
echo ""; \
grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
perl -nle '/(.*?): ## (.*?) ## (.*$$)/; if ($$3 eq "") { printf ( "$(COMMAND_COLOR)%-20s$(DESC_COLOR)%s$(CLEAR_COLOR)\n\n", $$1, $$2) } else { printf ( "$(COMMAND_COLOR)%-20s$(DESC_COLOR)%s$(CLEAR_COLOR)\n%-20s%s\n\n", $$1, $$2, " ", $$3) }';
.PHONY: start
start: ## docker compose up --build ## (starts the minecraft server)
@echo "Starting Minecraft Server..."; \
docker compose up -d --build;
.PHONY: stop
stop: ## docker compose stop --rmi all --remove-orphans: ## (stops and cleans up images, but keeps data)
@echo "Stopping Minecraft Server and cleaning up..."; \
docker compose down --rmi all --remove-orphans;
.PHONY: attach
attach: ## docker attach mcserver ## (attaches to minecraft paper jar for issuing commands)
@echo "Attaching to Minecraft..."; \
echo "Ctrl-C stops minecraft and exits"; \
echo "Ctrl-P Ctrl-Q only exits"; \
echo ""; \
echo "Type "help" for help."; \
docker attach mcserver;