diff --git a/scripts/vps-clone-without-docker.sh b/scripts/vps-clone-without-docker.sh new file mode 100755 index 0000000..40bbab6 --- /dev/null +++ b/scripts/vps-clone-without-docker.sh @@ -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 }" +REMOTE="${2:?usage: $0 /path/to/Fractured }" + +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" diff --git a/scripts/vps-sparse-checkout-no-docker.sh b/scripts/vps-sparse-checkout-no-docker.sh new file mode 100755 index 0000000..9e7935f --- /dev/null +++ b/scripts/vps-sparse-checkout-no-docker.sh @@ -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"