fix: install.sh sets up git repo + overlays current code

This commit is contained in:
Claus Lohmar 2026-07-07 18:40:21 +01:00
parent b0325267db
commit d6e0387b1c

View file

@ -89,12 +89,20 @@ apt-get install -y -qq git build-essential curl podman podman-compose
REPO_DIR="/opt/NextWks"
mkdir -p "$REPO_DIR"
# Copy current code to REPO_DIR (includes all latest changes)
echo "[COPY] Deploying current code to $REPO_DIR..."
# Clone or update repo, then overlay our current code
echo "[SETUP] Preparing /opt/NextWks..."
if [ -d "$REPO_DIR/.git" ]; then
cd "$REPO_DIR" && git pull
elif command -v git &>/dev/null; then
# Try to clone the remote first, so git history is intact
git clone "https://git.lohmar.co.uk/lexton-it/NextWks.git" "$REPO_DIR.tmp" 2>/dev/null && \
mv "$REPO_DIR.tmp" "$REPO_DIR" || true
fi
# Copy current code on top (ensures latest changes)
mkdir -p "$REPO_DIR"
cp -r "$SCRIPT_DIR"/* "$REPO_DIR/"
cp "$SCRIPT_DIR"/.gitignore "$REPO_DIR/" 2>/dev/null || true
# Ensure tools are executable
chmod +x "$REPO_DIR/deploy.sh" "$REPO_DIR/install.sh" 2>/dev/null || true
echo "[DONE] Bootstrapping complete. Running first deploy..."