diff --git a/start.sh b/start.sh index 2d5ff42..fdc6d24 100644 --- a/start.sh +++ b/start.sh @@ -1,5 +1,5 @@ -#!/bin/bash +#!/bin/bash set -e cd /home/container @@ -8,9 +8,25 @@ echo "======================================" echo " Boulangerie Web" echo "======================================" -echo "Python : $(python3 --version)" -echo "Node : $(node --version)" -echo "npm : $(npm --version)" +# -------------------------------------- +# Mise à jour du projet +# -------------------------------------- + +if [ ! -d ".git" ]; then + echo "Dépôt Git absent → clonage..." + + git clone https://gitea.louismazin.ovh/LouisMazin/Boulangerie_Website.git /tmp/boulangerie + + cp -a /tmp/boulangerie/. /home/container/ + rm -rf /tmp/boulangerie +else + echo "Mise à jour du dépôt Git..." + + git fetch origin + git reset --hard origin/main +fi + +echo "Git : $(git rev-parse --short HEAD)" # -------------------------------------- # Backend