Modifié : automate.sh

This commit is contained in:
Guillaume Emorine 2024-04-12 08:44:02 +02:00
parent 0da0615e76
commit 37eeae75ee

View File

@ -6,17 +6,36 @@
echo "Voulez-vous récupérer les fichiers à jour ou effectuer un push ? echo "Voulez-vous récupérer les fichiers à jour ou effectuer un push ?
[1 = Pull, 2 = Push]" [1 = Pull, 2 = Push]"
read answer read answer
if [ $answer == 1 ] ; then echo "Quelle branche est concernée ? [1 = main, 2 = tests]"
echo "Récupération des fichiers à jour..." read branch
git pull if [ $branch == 1 ] ; then
else if [ $answer == 1 ] ; then
echo "Récupération des fichiers à jour, branche main..."
git pull origin main
else
echo "Ajout des fichiers au Gitea..." echo "Ajout des fichiers au Gitea..."
sleep 2 sleep 2
git add . git add .
echo "Commit en cours..." echo "Commit en cours..."
sleep 2 sleep 2
git commit git commit
echo "Push des fichiers au Gitea..." echo "Push des fichiers au Gitea, branche main..."
sleep 2 sleep 2
git push git push origin main
fi
else
if [ $answer == 1 ] ; then
echo "Récupération des fichiers à jour dans la branche tests..."
git pull origin tests
else
echo "Ajout des fichiers au Gitea, branche tests..."
sleep 2
git add .
echo "Commit en cours..."
sleep 2
git commit
echo "Push des fichiers au Gitea, branche tests..."
sleep 2
git push origin tests
fi
fi fi