-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·91 lines (70 loc) · 2.58 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env make -f
PORT=25565
PORT_INSIDE=25565
PROJECT_SUFFIX=
PROJECT_NAME=minecraft_$(VERSION)$(PROJECT_SUFFIX)
DOCKER_COMPOSE_ARGS=--project-name "$(PROJECT_NAME)"
BACKUP_DIR=$(PWD)/BACKUP
DATE_STAMP=$(shell date +%Y%m%d-%H%M%S)
.PHONY: default
default: run
.PHONY: build spigot11 spigot16 build-tools
build: spigot16
.PHONY: build-all spigot build-tools
build-all: build multiverse worldedit
.PHONY: submodule-update
submodule-update:
git submodule update --remote --init --recursive
.PHONY: init java11 java16 spigot11 spigot16 minecraft
#VERSION = 1.15.2
#VERSION = 1.16.4
# VERSION = 1.16.5
java11 spigot11 minecraft: VERSION=1.16.5
java16 spigot16 forge16 multiverse worldedit: VERSION = 1.17.1
forge16: BUILD_NUM = 37.1.1
java17 forge17: VERSION = 1.18.1
forge17: BUILD_NUM = 39.0.66
java11 java16 java17: init
spigot11 minecraft: java11
spigot16 forge16 multiverse worldedit: java16
forge17: java17
init java11 java16 java17 spigot11 spigot16 forge16 forge17 multiverse worldedit:
VERSION="$(VERSION)" docker-compose $(DOCKER_COMPOSE_ARGS) build "$@"
.PHONY: harry-potter furniture robertson
harry-potter-1.13.2: VERSION=1.13.2
harry-potter-1.13.2: DIR=/home/minecraft/minecraft-harry_1.13.2
harry-potter-1.13.2: PORT=25566
harry-potter-1.13.2: minecraft
harry-potter: VERSION=1.16.3
harry-potter: DIR=/home/minecraft/minecraft-harry
harry-potter: PORT=25566
harry-potter: minecraft
terra-swoop-force: VERSION=1.16.4
terra-swoop-force: DIR=/home/minecraft/minecraft-terraswoopforce
terra-swoop-force: PORT=25567
terra-swoop-force: minecraft
#furniture: VERSION=1.16.1
#furniture: DIR=/home/minecraft/minecraft-furniture
#furniture: PORT=25567
#furniture: minecraft
robertson: DIR=/home/minecraft/minecraft
robertson: spigot16
robertson-forge: DIR=/home/minecraft/minecraft-forge
robertson-forge: forge16
# robertson-forge: forge17
robertson-forge: PORT=25568
spigot11 spigot16 forge16 forge17 minecraft:
$(if $(DIR),,$(error $$DIR is not provided?))
$(if $(VERSION),,$(error $$VERSION is not provided?))
$(if $(PORT),,$(error $$PORT is not provided?))
$(if $(PORT_INSIDE),,$(error $$PORT_INSIDE is not provided?))
# VERSION="$(VERSION)" docker-compose $(DOCKER_COMPOSE_ARGS) build "$@"
VERSION="$(VERSION)" BUILD_NUM="$(BUILD_NUM)" DIR="$(DIR)" PORT="$(PORT)" PORT_INSIDE="$(PORT_INSIDE)" docker-compose $(DOCKER_COMPOSE_ARGS) up --remove-orphans "$@"
.PHONY: run
run:
VERSION="$(VERSION)" docker-compose up spigot
.PHONY: backup
backup: END-DIR=$(notdir $(DIR))
backup:
$(if $(DIR),,$(error $$DIR is not provided?))
sudo tar -C "$(DIR)" -cvf "$(BACKUP_DIR)/$(END-DIR).$(DATE_STAMP).tar" .