Skip to content

Commit 82043d5

Browse files
Add purpur support for ServerLibraryCleaner (#4133)
1 parent d9bf26c commit 82043d5

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

docs/configuration/misc-options.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ docker run -d --pull=always \
2626

2727
By default, supported server types remove stale server libraries during installation by setting `CLEAN_SERVER_LIBRARIES` to `true`. Set `CLEAN_SERVER_LIBRARIES` to `false` to disable this cleanup if it causes unexpected behavior.
2828

29-
Currently, library cleanup is supported by `TYPE=PAPER`. Other server jar types are not yet supported.
29+
Currently, library cleanup is supported by
30+
31+
- `TYPE=PAPER`
32+
- `TYPE=PURPUR`
3033

3134
## Running as alternate user/group ID
3235

@@ -244,4 +247,4 @@ To also include the timestamp with each log, set `LOG_TIMESTAMP` to "true". The
244247
245248
```
246249
[init] 2022-02-05 16:58:33+00:00 Starting the Minecraft server...
247-
```
250+
```

scripts/start-deployPurpur

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ IFS=$'\n\t'
55
: "${PURPUR_BUILD:=LATEST}"
66
: "${PURPUR_DOWNLOAD_URL:=}"
77
: "${PURPUR_CONFIG_REPO:=}"
8+
: "${CLEAN_SERVER_LIBRARIES:=true}"
89

910
# shellcheck source=start-utils
1011
. "$(dirname "$0")/start-utils"
@@ -13,10 +14,15 @@ isDebugging && set -x
1314
resultsFile=/data/.purpur.env
1415

1516
if [[ $PURPUR_DOWNLOAD_URL ]]; then
16-
if ! mc-image-helper install-purpur \
17-
--output-directory=/data \
18-
--results-file="$resultsFile" \
19-
--url="${PURPUR_DOWNLOAD_URL}"; then
17+
args=(
18+
--output-directory=/data
19+
--results-file="$resultsFile"
20+
--url="${PURPUR_DOWNLOAD_URL}"
21+
)
22+
if isTrue "$CLEAN_SERVER_LIBRARIES"; then
23+
args+=(--clean-libraries)
24+
fi
25+
if ! mc-image-helper install-purpur "${args[@]}"; then
2026
logError "Failed to download from custom Purpur URL"
2127
exit 1
2228
fi
@@ -29,6 +35,9 @@ else
2935
if [[ $PURPUR_BUILD ]]; then
3036
args+=(--build="$PURPUR_BUILD")
3137
fi
38+
if isTrue "$CLEAN_SERVER_LIBRARIES"; then
39+
args+=(--clean-libraries)
40+
fi
3241
if ! mc-image-helper install-purpur "${args[@]}"; then
3342
logError "Failed to download Purpur"
3443
exit 1

0 commit comments

Comments
 (0)