Compare commits

...

4 Commits

Author SHA1 Message Date
Geoff Bourne
ac125dc15e Temporarily replace GTNH ServerPacks call with restify+jq (#3938) 2026-02-15 17:33:46 -06:00
Andre Blanke
4c0fd104c6 Exit early on failed GTNH packs retrieval (#3931) 2026-02-15 13:20:18 -06:00
Geoff Bourne
cca86e6a3d Tuning renovate config to just custom regex (#3928) 2026-02-15 09:52:49 -06:00
renovate[bot]
67ec9e1b3c chore: Configure Renovate (#3923)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
2026-02-14 14:46:05 -06:00
15 changed files with 39 additions and 52 deletions

View File

@@ -17,6 +17,7 @@ on:
- "compose-docs.yml"
- "zensical.toml"
- ".readthedocs.yaml"
- "renovate.json*"
jobs:
build:

View File

@@ -14,6 +14,7 @@ on:
- "compose-docs.yml"
- "zensical.toml"
- ".readthedocs.yaml"
- "renovate.json*"
jobs:
build:

View File

@@ -49,7 +49,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
# renovate: datasource=github-releases depName=itzg/mc-image-helper versioning=loose
ARG MC_HELPER_VERSION=1.54.0
ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
# used for cache busting local copy of mc-image-helper

15
compose-dev.yml Normal file
View File

@@ -0,0 +1,15 @@
services:
mc-dev:
build:
context: .
environment:
EULA: true
volumes:
- ./scripts:/image/scripts:ro
- data:/data
ports:
- "25565:25565"
stdin_open: true
tty: true
volumes:
data:

View File

@@ -11,61 +11,15 @@ Adding a new server `TYPE` can vary due to the complexity of obtaining and confi
## Iterative script development
Individual scripts can be iteratively developed, debugged, and tested using the following procedure.
First, build a baseline of the image to include the packages needed by existing or new scripts:
PowerShell: (Example of building and testing ForgeAPI)
```powershell
$env:FOLDER_TO_TEST="forgeapimods_projectids"
$env:IMAGE_TO_TEST="mc-dev"
docker build -t $env:IMAGE_TO_TEST .
pushd "tests/setuponlytests/$env:FOLDER_TO_TEST/"
docker compose run mc
docker compose down -v --remove-orphans
popd
```
PowerShell: Building different images of Java for testing
```powershell
$env:BASE_IMAGE='eclipse-temurin:8u312-b07-jre'
$env:IMAGE_TO_TEST="mc-dev"
docker build --build-arg BASE_IMAGE=$env:BASE_IMAGE -t $env:IMAGE_TO_TEST .
```
Bash: (Example of building and testing ForgeAPI)
```bash
export FOLDER_TO_TEST="forgeapimods_file"
export IMAGE_TO_TEST="mc-dev"
docker build -t $IMAGE_TO_TEST .
pushd tests/setuponlytests/$FOLDER_TO_TEST/
docker compose run mc
docker compose down -v --remove-orphans
popd
```
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.
The included `compose-dev.yml` will mount the local `scripts` code into the container and allow for iterative development. Replace `[-e key=value]` with any environment variables you wish to set for testing the modified scripts.
```shell
docker run -it --rm -v ${PWD}:/image/scripts --entrypoint bash mc-dev
docker compose -f compose-dev.yml run --rm -it [-e key=value] mc-dev
```
From within the container you can run individual scripts via the attached `/image/scripts/` path; however, be sure to set any environment variables expected by the scripts by either `export`ing them manually:
!!! tip
```shell
export VERSION=1.12.2
/image/scripts/start-deployFabric
```
...or pre-pending script execution:
```shell
VERSION=1.12.2 /image/scripts/start-deployFabric
```
!!! note
You may want to temporarily add an `exit` statement near the end of your script to isolate execution to just the script you're developing.
To speed up the development cycle, it is recommended to set `SETUP_ONLY` to `true` as part of the run command above.
## Using development copy of tools

15
renovate.json5 Normal file
View File

@@ -0,0 +1,15 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"enabledManagers": [
"custom"
],
"customManagers": [
{
"customType": "regex",
"managerFilePatterns": ["/^Dockerfile$/"],
"matchStrings": [
"# renovate: datasource=(?<datasource>[a-z-]+?)(?: packageName=(?<packageName>.+?))? (?: versioning=(?<versioning>[a-z-]+?))?\\s(?:ENV|ARG) .+?_VERSION=(?<currentValue>.+?)\\s"
]
}
]
}

0
scripts/start-deployAutoCF Normal file → Executable file
View File

0
scripts/start-deployFolia Normal file → Executable file
View File

3
scripts/start-deployGTNH Normal file → Executable file
View File

@@ -8,10 +8,11 @@ function getGTNHdownloadPath(){
gtnh_download_path=""
current_java_version=$(mc-image-helper java-release)
if ! mapfile -t packs < <(curl -sfL 'http://downloads.gtnewhorizons.com/ServerPacks/?raw'); then
if ! packs_data="$(restify --tag=a https://www.gtnewhorizons.com/version-history/ | jq -r '.[].href | select(test("Server"))')"; then
logError "Failed to retrieve data from http://downloads.gtnewhorizons.com/ServerPacks/?raw"
exit 1
fi
mapfile -t packs <<< "$packs_data"
log "Start locating server files..."
for pack in "${packs[@]}"; do

0
scripts/start-deployLeaf Normal file → Executable file
View File

0
scripts/start-deployModrinth Normal file → Executable file
View File

0
scripts/start-deployNeoForge Normal file → Executable file
View File

0
scripts/start-deployPoseidon Normal file → Executable file
View File

0
scripts/start-rconcmds Normal file → Executable file
View File

0
scripts/start-setupRbac Normal file → Executable file
View File