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>
26 lines
703 B
Bash
26 lines
703 B
Bash
#!/bin/bash
|
|
# Emplacement serveur : /home/ms1reader/deploy/deploy_dev.sh
|
|
# chmod +x ~/deploy/deploy_dev.sh
|
|
#
|
|
# 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}"
|
|
BRANCH="dev"
|
|
|
|
cd "$REPO_DIR"
|
|
git fetch origin "$BRANCH"
|
|
git reset --hard "FETCH_HEAD"
|
|
# 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}"
|