Permet le test bout en bout du webhook et du miroir Bitbucket. Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
606 B
Bash
25 lines
606 B
Bash
#!/bin/bash
|
|
# Emplacement serveur : /home/ms1reader/deploy/deploy_dev.sh
|
|
# chmod +x ~/deploy/deploy_dev.sh
|
|
#
|
|
# Git root = /home/ms1reader (ci4app + public_html frères).
|
|
# HOME n'est pas défini quand appelé via PHP → chemin absolu obligatoire.
|
|
# Ne jamais `git clean -fd` sur tout le home (mail, ssl, etc.).
|
|
|
|
set -euo pipefail
|
|
|
|
REPO_DIR="/home/ms1reader"
|
|
BRANCH="dev"
|
|
|
|
cd "$REPO_DIR"
|
|
git fetch origin "$BRANCH"
|
|
git reset --hard "FETCH_HEAD"
|
|
git clean -fd -- ci4app public_html
|
|
|
|
if [ ! -L www ]; then
|
|
rm -rf www
|
|
ln -s public_html www
|
|
fi
|
|
|
|
echo "Deploy OK: $(git rev-parse --short HEAD) on ${BRANCH}"
|