Skip to content

Commit 8f82ff9

Browse files
committed
Added support for Catserver type
1 parent 7d97fdc commit 8f82ff9

File tree

5 files changed

+47
-2
lines changed

5 files changed

+47
-2
lines changed

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ docker build -t mc-dev .
2222
Using the baseline image, an interactive container can be started to iteratively run the scripts to be developed. By attaching the current workspace directory, you can use the local editor of your choice to iteratively modify scripts while using the container to run them.
2323

2424
```shell script
25-
docker run -it --rm -v ${PWD}:/scripts -e SCRIPTS=/scripts/ --entrypoint bash mc-dev
25+
docker run -it --rm -v ${PWD}:/scripts -e SCRIPTS=/scripts/ --entrypoint bash mc-dev
2626
```
2727

2828
From within the container you can run individual scripts via the attached `/scripts/` path; however, be sure to set any environment variables expected by the scripts by either `export`ing them manually:

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,15 @@ A [Mohist](https://github.com/Mohist-Community/Mohist) server can be used with
534534

535535
> **NOTE** there are limited base versions supported, so you will also need to set `VERSION`, such as "1.12.2"
536536

537+
538+
## Running a Catserver type server
539+
540+
A [Catserver](http://catserver.moe/) type server can be used with
541+
542+
-e TYPE=CATSERVER
543+
544+
> **NOTE** Catserver only provides a single release stream, so `VERSION` is ignored
545+
537546
## Running a server with a Feed the Beast modpack
538547

539548
> **NOTE** requires `itzg/minecraft-server:multiarch` image

start-configuration

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ case "${TYPE^^}" in
123123
exec ${SCRIPTS:-/}start-deployMohist "$@"
124124
;;
125125

126+
CATSERVER)
127+
exec ${SCRIPTS:-/}start-deployCatserver "$@"
128+
;;
129+
126130
*)
127131
log "Invalid type: '$TYPE'"
128132
log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTB, CURSEFORGE, SPONGEVANILLA"

start-deployCatserver

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
. ${SCRIPTS:-/}start-utils
4+
set -o pipefail
5+
set -e
6+
7+
latestAsset=$(
8+
curl -fsSL https://api.github.com/repos/Luohuayu/CatServer/releases/latest | \
9+
jq '.assets[] | select(.name | match(".*-universal.jar"))'
10+
)
11+
12+
if [[ -z "${latestAsset}" ]]; then
13+
log "ERROR: latest release of Catserver is missing universal.jar asset"
14+
exit 1
15+
fi
16+
17+
isDebugging && log "Latest asset ${latestAsset}"
18+
latestJarName=$(echo ${latestAsset} | jq --raw-output '.name')
19+
latestJarId=$(echo ${latestAsset} | jq --raw-output '.id')
20+
21+
22+
export SERVER="/data/${latestJarName}"
23+
24+
if [ ! -f ${SERVER} ]; then
25+
log "Downloading ${latestJarName}"
26+
curl -H "Accept:application/octet-stream" -o "$SERVER" -fsSL https://api.github.com/repos/Luohuayu/CatServer/releases/assets/${latestJarId}
27+
fi
28+
29+
export SKIP_LOG4J_CONFIG=true
30+
31+
# Continue to Final Setup
32+
exec ${SCRIPTS:-/}start-finalSetup01World "$@"

start-deployMohist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fi
3333
export SERVER="/data/${baseName}"
3434

3535
if [ ! -f ${SERVER} ]; then
36-
log "Downloading ${SERVER}"
36+
log "Downloading ${baseName}"
3737
curl -o "${SERVER}" -fsSL "${mohistJob}lastSuccessfulBuild/artifact/${latestBuildRelPath}"
3838
fi
3939

0 commit comments

Comments
 (0)