feat(vps): override kill/start scripts for --restart via env
FRACTURED_KILL_SCRIPT and FRACTURED_START_SCRIPT default to repo scripts/. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -32,6 +32,8 @@
|
||||
# FRACTURED_GITEA_ORIGIN_URL — URL used when auto-migrating off GitHub (default: Gitea HTTPS above)
|
||||
# FRACTURED_SKIP_ORIGIN_MIGRATION — set to 1 to never rewrite remote URLs
|
||||
# FRACTURED_POST_UPDATE_CMD — shell command run after compile (used by bare --run-after)
|
||||
# FRACTURED_KILL_SCRIPT — with --restart: path to kill script (default: scripts/kill-azeroth-servers.sh)
|
||||
# FRACTURED_START_SCRIPT — with --restart: path to start script (default: scripts/start-azeroth-servers.sh)
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
@@ -62,7 +64,7 @@ Options:
|
||||
--compile-only ./acore.sh compiler compile (incremental).
|
||||
--prefix PATH Override CMAKE_INSTALL_PREFIX (updates conf/config.sh BINPATH).
|
||||
--dry-run Print commands without running them.
|
||||
--restart Kill servers before compile, restart in tmux after.
|
||||
--restart Kill servers before compile, restart after (see FRACTURED_KILL_SCRIPT / FRACTURED_START_SCRIPT).
|
||||
--run-after [CMD] Run a custom shell command after successful compile.
|
||||
If CMD is omitted, uses FRACTURED_POST_UPDATE_CMD.
|
||||
|
||||
@@ -71,6 +73,8 @@ Environment:
|
||||
FRACTURED_GITEA_ORIGIN_URL Target URL when auto-migrating from GitHub Fractured remote.
|
||||
FRACTURED_SKIP_ORIGIN_MIGRATION Set to 1 to skip GitHub → Gitea remote rewrite.
|
||||
FRACTURED_POST_UPDATE_CMD Used with bare --run-after.
|
||||
FRACTURED_KILL_SCRIPT Override kill script used with --restart (default: repo scripts/).
|
||||
FRACTURED_START_SCRIPT Override start script used with --restart (default: repo scripts/).
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -157,12 +161,12 @@ fi
|
||||
|
||||
cd "$ROOT"
|
||||
|
||||
KILL_SCRIPT="${SCRIPT_DIR}/kill-azeroth-servers.sh"
|
||||
START_SCRIPT="${SCRIPT_DIR}/start-azeroth-servers.sh"
|
||||
KILL_SCRIPT="${FRACTURED_KILL_SCRIPT:-$SCRIPT_DIR/kill-azeroth-servers.sh}"
|
||||
START_SCRIPT="${FRACTURED_START_SCRIPT:-$SCRIPT_DIR/start-azeroth-servers.sh}"
|
||||
|
||||
if [[ "$DO_RESTART" -eq 1 ]]; then
|
||||
if [[ ! -f "$KILL_SCRIPT" || ! -f "$START_SCRIPT" ]]; then
|
||||
echo "error: --restart requires kill-azeroth-servers.sh and start-azeroth-servers.sh in scripts/" >&2
|
||||
echo "error: --restart needs kill and start scripts (defaults under scripts/). Set FRACTURED_KILL_SCRIPT / FRACTURED_START_SCRIPT to override." >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "==> stopping servers before compile"
|
||||
@@ -250,7 +254,7 @@ if [[ "$DO_RUN_AFTER" -eq 1 ]]; then
|
||||
fi
|
||||
|
||||
if [[ "$DO_RESTART" -eq 0 && "$DO_RUN_AFTER" -eq 0 ]]; then
|
||||
echo "Done. Run 'bash scripts/start-azeroth-servers.sh' to (re)start servers in tmux."
|
||||
echo "Done. (Re)start: bash \"$SCRIPT_DIR/start-azeroth-servers.sh\" — or set FRACTURED_START_SCRIPT for a custom path."
|
||||
else
|
||||
echo "Done."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user