-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathTaskfile.yml
More file actions
210 lines (185 loc) · 10.1 KB
/
Taskfile.yml
File metadata and controls
210 lines (185 loc) · 10.1 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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
version: '3'
vars:
IMAGE_NAME: '{{default "hytale-server:local" .IMAGE_NAME}}'
IMAGE_NAME_AMD64: '{{default "hytale-server:local-amd64" .IMAGE_NAME_AMD64}}'
DEV_CONTAINER_NAME: '{{default "hytale-server-dev" .DEV_CONTAINER_NAME}}'
DEV_DATA_DIR: '{{default "./data" .DEV_DATA_DIR}}'
DEV_BACKUP_DIR: '{{default "./backups" .DEV_BACKUP_DIR}}'
DEV_BACKUP_FREQUENCY_MINUTES: '{{default "60" .DEV_BACKUP_FREQUENCY_MINUTES}}'
DEV_BACKUP_MAX_COUNT: '{{default "24" .DEV_BACKUP_MAX_COUNT}}'
DEV_PORT: '{{default "5520" .DEV_PORT}}'
tasks:
build:
desc: Build the Docker image locally
cmds:
- docker build -t {{.IMAGE_NAME}} .
build:amd64:
desc: Build the Docker image locally for linux/amd64 (Apple Silicon support)
cmds:
- docker buildx build --platform linux/amd64 -t {{.IMAGE_NAME_AMD64}} --load .
test:
desc: Run container-level validation tests against IMAGE_NAME
cmds:
- chmod +x ci/test-image.sh
- IMAGE_NAME={{.IMAGE_NAME}} ./ci/test-image.sh
k8s:test:
desc: Validate Helm + Kustomize manifests via kubeconform (runs tools in Docker)
cmds:
- chmod +x ci/test-k8s-manifests.sh
- ./ci/test-k8s-manifests.sh
verify:
desc: Build + run validation tests
cmds:
- task: build
- task: test
- task: k8s:test
dev:up:
desc: Start a local server container (manual provisioning in ./data)
cmds:
- task: build
- docker rm -f {{.DEV_CONTAINER_NAME}} 2>/dev/null || true
- docker run -d -it --name {{.DEV_CONTAINER_NAME}} -p {{.DEV_PORT}}:5520/udp -v {{.DEV_DATA_DIR}}:/data {{.IMAGE_NAME}}
dev:up:amd64:
desc: Start a local server container as linux/amd64 (manual provisioning in ./data)
cmds:
- task: build:amd64
- docker rm -f {{.DEV_CONTAINER_NAME}} 2>/dev/null || true
- docker run -d -it --platform linux/amd64 --name {{.DEV_CONTAINER_NAME}} -p {{.DEV_PORT}}:5520/udp -v {{.DEV_DATA_DIR}}:/data {{.IMAGE_NAME_AMD64}}
dev:up:backup:
desc: Start a local server container with backups enabled (backups are written into /data unless HYTALE_BACKUP_DIR is overridden)
cmds:
- task: build
- docker rm -f {{.DEV_CONTAINER_NAME}} 2>/dev/null || true
- docker run -d -it --name {{.DEV_CONTAINER_NAME}} -e HYTALE_ENABLE_BACKUP=true -e HYTALE_BACKUP_DIR=/data/backups -e HYTALE_BACKUP_FREQUENCY_MINUTES={{.DEV_BACKUP_FREQUENCY_MINUTES}} -e HYTALE_BACKUP_MAX_COUNT={{.DEV_BACKUP_MAX_COUNT}} -p {{.DEV_PORT}}:5520/udp -v {{.DEV_DATA_DIR}}:/data {{.IMAGE_NAME}}
dev:up:backup:amd64:
desc: Start a local server container as linux/amd64 with backups enabled
cmds:
- task: build:amd64
- docker rm -f {{.DEV_CONTAINER_NAME}} 2>/dev/null || true
- docker run -d -it --platform linux/amd64 --name {{.DEV_CONTAINER_NAME}} -e HYTALE_ENABLE_BACKUP=true -e HYTALE_BACKUP_DIR=/data/backups -e HYTALE_BACKUP_FREQUENCY_MINUTES={{.DEV_BACKUP_FREQUENCY_MINUTES}} -e HYTALE_BACKUP_MAX_COUNT={{.DEV_BACKUP_MAX_COUNT}} -p {{.DEV_PORT}}:5520/udp -v {{.DEV_DATA_DIR}}:/data {{.IMAGE_NAME_AMD64}}
dev:up:backup:separate:
desc: Start a local server container with backups enabled, using a separate host directory mounted to /backups
cmds:
- task: build
- mkdir -p {{.DEV_BACKUP_DIR}}
- docker rm -f {{.DEV_CONTAINER_NAME}} 2>/dev/null || true
- docker run -d -it --name {{.DEV_CONTAINER_NAME}} -e HYTALE_ENABLE_BACKUP=true -e HYTALE_BACKUP_DIR=/backups -e HYTALE_BACKUP_FREQUENCY_MINUTES={{.DEV_BACKUP_FREQUENCY_MINUTES}} -e HYTALE_BACKUP_MAX_COUNT={{.DEV_BACKUP_MAX_COUNT}} -p {{.DEV_PORT}}:5520/udp -v {{.DEV_DATA_DIR}}:/data -v {{.DEV_BACKUP_DIR}}:/backups {{.IMAGE_NAME}}
dev:up:backup:separate:amd64:
desc: Start a local server container as linux/amd64 with backups enabled, using a separate host directory mounted to /backups
cmds:
- task: build:amd64
- mkdir -p {{.DEV_BACKUP_DIR}}
- docker rm -f {{.DEV_CONTAINER_NAME}} 2>/dev/null || true
- docker run -d -it --platform linux/amd64 --name {{.DEV_CONTAINER_NAME}} -e HYTALE_ENABLE_BACKUP=true -e HYTALE_BACKUP_DIR=/backups -e HYTALE_BACKUP_FREQUENCY_MINUTES={{.DEV_BACKUP_FREQUENCY_MINUTES}} -e HYTALE_BACKUP_MAX_COUNT={{.DEV_BACKUP_MAX_COUNT}} -p {{.DEV_PORT}}:5520/udp -v {{.DEV_DATA_DIR}}:/data -v {{.DEV_BACKUP_DIR}}:/backups {{.IMAGE_NAME_AMD64}}
dev:up:auto:
desc: Start a local server container with HYTALE_AUTO_DOWNLOAD=true
cmds:
- task: build
- docker rm -f {{.DEV_CONTAINER_NAME}} 2>/dev/null || true
- docker run -d -it --name {{.DEV_CONTAINER_NAME}} -e CFG_MOTD=Test -e HYTALE_AUTO_DOWNLOAD=true -p {{.DEV_PORT}}:5520/udp -v {{.DEV_DATA_DIR}}:/data {{.IMAGE_NAME}}
dev:up:auto:amd64:
desc: Start a local server container as linux/amd64 with HYTALE_AUTO_DOWNLOAD=true
cmds:
- task: build:amd64
- docker rm -f {{.DEV_CONTAINER_NAME}} 2>/dev/null || true
- docker run -d -it --platform linux/amd64 --name {{.DEV_CONTAINER_NAME}} -e CFG_MOTD=Test -e=CFG_MAX_PLAYERS=50 -e HYTALE_AUTO_DOWNLOAD=true -p {{.DEV_PORT}}:5520/udp -v {{.DEV_DATA_DIR}}:/data {{.IMAGE_NAME_AMD64}}
dev:up:curseforge:
desc: Start a local server container with CurseForge mod auto-download (requires CURSEFORGE_API_KEY env var or ./.secrets/curseforge_api_key.txt)
cmds:
- task: build
- docker rm -f {{.DEV_CONTAINER_NAME}} 2>/dev/null || true
- |
if [ -f ./.secrets/curseforge_api_key.txt ]; then
docker run -d -it --name {{.DEV_CONTAINER_NAME}} \
-e CFG_MOTD=Test \
-e HYTALE_AUTO_DOWNLOAD=true \
-e HYTALE_CURSEFORGE_MODS="1428599 1409811" \
-e HYTALE_CURSEFORGE_API_KEY_SRC=/run/secrets/curseforge_api_key \
-v ./.secrets/curseforge_api_key.txt:/run/secrets/curseforge_api_key:ro \
-p {{.DEV_PORT}}:5520/udp \
-v {{.DEV_DATA_DIR}}:/data \
{{.IMAGE_NAME}}
elif [ -n "${CURSEFORGE_API_KEY:-}" ]; then
docker run -d -it --name {{.DEV_CONTAINER_NAME}} \
-e CFG_MOTD=Test \
-e HYTALE_AUTO_DOWNLOAD=true \
-e HYTALE_CURSEFORGE_MODS="1428599 1409811" \
-e HYTALE_CURSEFORGE_API_KEY="${CURSEFORGE_API_KEY}" \
-p {{.DEV_PORT}}:5520/udp \
-v {{.DEV_DATA_DIR}}:/data \
{{.IMAGE_NAME}}
else
echo "ERROR: CurseForge API key required. Set CURSEFORGE_API_KEY env var or create ./.secrets/curseforge_api_key.txt"
exit 1
fi
dev:up:curseforge:amd64:
desc: Start a local server container as linux/amd64 with CurseForge mod auto-download (requires CURSEFORGE_API_KEY env var or ./.secrets/curseforge_api_key.txt)
cmds:
- task: build:amd64
- docker rm -f {{.DEV_CONTAINER_NAME}} 2>/dev/null || true
- |
if [ -f ./.secrets/curseforge_api_key.txt ]; then
docker run -d -it --platform linux/amd64 --name {{.DEV_CONTAINER_NAME}} \
-e CFG_MOTD=Test \
-e HYTALE_AUTO_DOWNLOAD=true \
-e HYTALE_CURSEFORGE_MODS="1428599 1409811" \
-e HYTALE_CURSEFORGE_API_KEY_SRC=/run/secrets/curseforge_api_key \
-v ./.secrets/curseforge_api_key.txt:/run/secrets/curseforge_api_key:ro \
-p {{.DEV_PORT}}:5520/udp \
-v {{.DEV_DATA_DIR}}:/data \
{{.IMAGE_NAME_AMD64}}
elif [ -n "${CURSEFORGE_API_KEY:-}" ]; then
docker run -d -it --platform linux/amd64 --name {{.DEV_CONTAINER_NAME}} \
-e CFG_MOTD=Test \
-e HYTALE_AUTO_DOWNLOAD=true \
-e HYTALE_CURSEFORGE_MODS="1428599 1409811" \
-e HYTALE_CURSEFORGE_API_KEY="${CURSEFORGE_API_KEY}" \
-p {{.DEV_PORT}}:5520/udp \
-v {{.DEV_DATA_DIR}}:/data \
{{.IMAGE_NAME_AMD64}}
else
echo "ERROR: CurseForge API key required. Set CURSEFORGE_API_KEY env var or create ./.secrets/curseforge_api_key.txt"
exit 1
fi
dev:aot:generate:
desc: Generate an AOT cache at ./data/server/HytaleServer.aot (requires server files + Assets.zip in ./data)
cmds:
- task: build
- docker run --rm -it --name {{.DEV_CONTAINER_NAME}}-aot-generate -e ENABLE_AOT=generate -e JVM_EXTRA_ARGS=-Xlog:aot=trace -e JDK_AOT_VM_OPTIONS=-Xlog:aot=trace -v {{.DEV_DATA_DIR}}:/data {{.IMAGE_NAME}}
dev:aot:generate:amd64:
desc: Generate an AOT cache as linux/amd64 (Apple Silicon support; requires server files + Assets.zip in ./data)
cmds:
- task: build:amd64
- docker run --rm -it --platform linux/amd64 --name {{.DEV_CONTAINER_NAME}}-aot-generate -e ENABLE_AOT=generate -e JVM_EXTRA_ARGS=-Xlog:aot=trace -e JDK_AOT_VM_OPTIONS=-Xlog:aot=trace -v {{.DEV_DATA_DIR}}:/data {{.IMAGE_NAME_AMD64}}
dev:up:aot:
desc: Start a local server container with AOT enabled and verbose AOT logging (requires generated AOT cache)
cmds:
- task: build
- docker rm -f {{.DEV_CONTAINER_NAME}} 2>/dev/null || true
- docker run -d -it --name {{.DEV_CONTAINER_NAME}} -e CFG_MOTD=Test -e ENABLE_AOT=true -e JVM_EXTRA_ARGS=-Xlog:aot=trace -p {{.DEV_PORT}}:5520/udp -v {{.DEV_DATA_DIR}}:/data {{.IMAGE_NAME}}
dev:up:aot:amd64:
desc: Start a local server container as linux/amd64 with AOT enabled and verbose AOT logging (requires generated AOT cache)
cmds:
- task: build:amd64
- docker rm -f {{.DEV_CONTAINER_NAME}} 2>/dev/null || true
- docker run -d -it --platform linux/amd64 --name {{.DEV_CONTAINER_NAME}} -e CFG_MOTD=Test -e ENABLE_AOT=true -e JVM_EXTRA_ARGS=-Xlog:aot=trace -p {{.DEV_PORT}}:5520/udp -v {{.DEV_DATA_DIR}}:/data {{.IMAGE_NAME_AMD64}}
dev:down:
desc: Stop and remove the local server container
cmds:
- docker rm -f {{.DEV_CONTAINER_NAME}} 2>/dev/null || true
dev:logs:
desc: Follow logs from the local server container
cmds:
- docker logs -f {{.DEV_CONTAINER_NAME}}
dev:attach:
desc: Attach to the server console of the running local container
cmds:
- docker attach {{.DEV_CONTAINER_NAME}}
dev:ps:
desc: Show status of the local server container
cmds:
- docker ps -a --filter name={{.DEV_CONTAINER_NAME}}
dev:exec:
desc: Open a shell in the running local server container
cmds:
- docker exec -it {{.DEV_CONTAINER_NAME}} sh