fix(ci): preserve installer compatibility with older releases
This commit is contained in:
5 files changed
+49
-23
No files matched your search
+8
-1
@@ -4707,6 +4707,13 @@ offsite_enabled() {
|
||||
# database password.
|
||||
write_felis_toml() {
|
||||
local target="$1" db_addr="$2" deployment="${3:-}" deployment_line="" smtp_block auth_body auth_source_blocks registry_block archive_block offsite_section
|
||||
local config_keys game_version_line=""
|
||||
# main's installer also installs older releases, whose strict TOML parser rejects
|
||||
# newer optional keys. Ask the installed binary rather than guessing from its stamp.
|
||||
config_keys="$("$HOST_BIN" bootstrap-assets config-keys 2>/dev/null || true)"
|
||||
if grep -Fxq 'velocity.game_version' <<<"$config_keys"; then
|
||||
game_version_line="game_version = \"${MC_VERSION:-}\""
|
||||
fi
|
||||
if [ -n "$deployment" ]; then
|
||||
# Starts with the newline that ends the url line, so the pod copy has no blank line there.
|
||||
deployment_line="
|
||||
@@ -4762,7 +4769,7 @@ login_image = "${FELIS_LIMBO_IMAGE}"
|
||||
lobby_image = "${FELIS_LOBBY_IMAGE}"
|
||||
# The public port players connect on; the panel shows it in server addresses.
|
||||
game_port = ${FELIS_GAME_PORT}
|
||||
game_version = "${MC_VERSION:-}"
|
||||
${game_version_line}
|
||||
|
||||
[registry]
|
||||
url = "${REGISTRY_URL}"
|
||||
|
||||
@@ -2042,11 +2042,16 @@ run_write() { # out-file [state-dir] [database-deployment]; under the installer'
|
||||
[ -z "${CAT_FAILS:-}" ] || cat() { head -c 40; return 1; }
|
||||
persisted_smtp_block() { :; }
|
||||
persisted_auth_source_blocks() { :; }
|
||||
felis() {
|
||||
[ "$*" = "bootstrap-assets config-keys" ] || return 2
|
||||
[ "${OLD_CONFIG:-0}" != 1 ] || return 2
|
||||
printf "%s\n" velocity.game_version
|
||||
}
|
||||
. "$FNFILE"
|
||||
FELIS_ROOT_DOMAIN=r.example.com DB_USER=u DB_PASSWORD=p DB_NAME=d MINECRAFT_NS=minecraft \
|
||||
FELIS_EGRESS_MODE=nodeport FELIS_LIMBO_IMAGE=li FELIS_LOBBY_IMAGE=lo FELIS_GAME_PORT=25570 MC_VERSION=26.3 \
|
||||
REGISTRY_URL=registry.felis.svc:5000 BUILD_NS=felis-build FELIS_ARCHIVE_LOCAL_PATH=/a \
|
||||
FELIS_OFFSITE_BUCKET= write_felis_toml "$OUT_TOML" 127.0.0.1:15432 "$DEPLOY"'
|
||||
HOST_BIN=felis FELIS_OFFSITE_BUCKET= write_felis_toml "$OUT_TOML" 127.0.0.1:15432 "$DEPLOY"'
|
||||
}
|
||||
|
||||
run_write "$rdir/out.toml"
|
||||
@@ -2086,6 +2091,13 @@ expect "a re-run carries the scheduled backup retention" 'scheduled_retention =
|
||||
expect "the archive mount stays installer-owned" 'local_path = "/a"' "$out"
|
||||
expect "the panel learns the public game port" 'game_port = 25570' "$out"
|
||||
expect "the panel learns the built login protocol" 'game_version = "26.3"' "$out"
|
||||
(OLD_CONFIG=1 run_write "$rdir/release.toml")
|
||||
release_config="$(cat "$rdir/release.toml")"
|
||||
case "$release_config" in
|
||||
*game_version*) echo "FAIL an older binary must not receive velocity.game_version"; fails=$((fails + 1)) ;;
|
||||
*) echo "PASS an older binary receives no unsupported game-version key" ;;
|
||||
esac
|
||||
expect "an older binary still receives the public game port" 'game_port = 25570' "$release_config"
|
||||
expect "a re-run keeps the off-site bucket, set apart from the next section" '[offsite]
|
||||
endpoint = "https://objects.example"
|
||||
bucket = "felis-offsite"
|
||||
|
||||
Reference in new issue
Block a user