Adapter le dépôt au layout serveur (git root = home, pas public_html).

Déplace deploy_dev.php dans public_html, retire www/home du tracking, et limite git clean aux chemins applicatifs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-19 10:29:36 -04:00
parent ea49f2c94f
commit def14692ee
303 changed files with 50 additions and 130830 deletions

View File

@ -1,18 +1,25 @@
#!/bin/bash
# À placer sur le serveur : ~/deploy/deploy_dev.sh
# Le dépôt applicatif est typiquement ~/public_html (ou le docroot Git).
# Emplacement serveur : /home/ms1reader/deploy/deploy_dev.sh
# chmod +x ~/deploy/deploy_dev.sh
#
# Philosophie MS1 : serveur = déploiement uniquement (pas de commits).
# Nécessite un remote Gitea (souvent http://127.0.0.1:3000/stephan/ms1readerv4.git).
# Git root = $HOME (ci4app + public_html sont frères, pas un clone dans public_html).
# IMPORTANT : ne jamais `git clean -fd` sur tout le home (mail, ssl, etc.).
set -euo pipefail
REPO_DIR="${HOME}/public_html"
REPO_DIR="${HOME}"
BRANCH="dev"
cd "$REPO_DIR"
git fetch origin "$BRANCH"
git reset --hard "FETCH_HEAD"
git clean -fd
# Nettoyer uniquement les chemins applicatifs versionnés
git clean -fd -- ci4app public_html
# Garantir le symlink cPanel (au cas où un vieux commit aurait créé un dossier www)
if [ ! -L www ]; then
rm -rf www
ln -s public_html www
fi
echo "Deploy OK: $(git rev-parse --short HEAD) on ${BRANCH}"