Add VPS clone scripts for sparse checkout without Docker
Track vps-clone-without-docker.sh and vps-sparse-checkout-no-docker.sh so a fresh GitHub clone can run the helper end-to-end. Mark both executable in git for ./ usage after clone.
This commit is contained in:
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
# Clone Dawnforger/Fractured and omit Docker-only paths. Use when this script is
|
||||
# already on disk (e.g. scp). Otherwise: git clone … && cd Fractured && bash scripts/vps-sparse-checkout-no-docker.sh
|
||||
#
|
||||
# Usage:
|
||||
# bash scripts/vps-clone-without-docker.sh /path/to/Fractured git@github.com:Dawnforger/Fractured.git
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
TARGET="${1:?usage: $0 /path/to/Fractured <git-remote-url>}"
|
||||
REMOTE="${2:?usage: $0 /path/to/Fractured <git-remote-url>}"
|
||||
|
||||
if [[ -e "$TARGET" ]]; then
|
||||
echo "error: $TARGET already exists; remove it or pick another path." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$(dirname "$TARGET")"
|
||||
git clone "$REMOTE" "$TARGET"
|
||||
|
||||
cd "$TARGET"
|
||||
if [[ ! -f scripts/vps-sparse-checkout-no-docker.sh ]]; then
|
||||
echo "error: clone missing scripts/vps-sparse-checkout-no-docker.sh — pull latest main." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
bash scripts/vps-sparse-checkout-no-docker.sh
|
||||
|
||||
echo "Done. Next: docs/DEPLOY_LINUX_VPS.md"
|
||||
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
# Omit Docker-only paths from the working tree (native VPS / production clones).
|
||||
# Repository root is the AzerothCore tree (flat layout).
|
||||
#
|
||||
# Run from repository root (directory that contains acore.sh and apps/).
|
||||
#
|
||||
# Usage:
|
||||
# bash scripts/vps-sparse-checkout-no-docker.sh
|
||||
#
|
||||
# Restore full tree: git sparse-checkout disable
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$ROOT"
|
||||
|
||||
if [[ ! -d .git ]]; then
|
||||
echo "error: run from a git clone (no .git in $ROOT)." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git sparse-checkout init --no-cone
|
||||
|
||||
cat >.git/info/sparse-checkout <<'EOF'
|
||||
/*
|
||||
!/docker-compose.yml
|
||||
!/docker-compose.override.yml
|
||||
!/apps/docker/
|
||||
!/env/docker-focal-build/
|
||||
!/.devcontainer/
|
||||
EOF
|
||||
|
||||
if git sparse-checkout reapply 2>/dev/null; then
|
||||
:
|
||||
else
|
||||
git read-tree -mu HEAD
|
||||
fi
|
||||
|
||||
echo "Sparse checkout applied (Docker-only paths omitted)."
|
||||
echo "To restore full tree locally: git sparse-checkout disable"
|
||||
Reference in New Issue
Block a user