Améliorer la mise à jour du dépôt en remplaçant 'git pull' par 'git fetch' et 'git checkout' pour une gestion plus précise des branches.
Some checks failed
SSH Backend Deploy / ssh-deploy (push) Failing after 2s
Some checks failed
SSH Backend Deploy / ssh-deploy (push) Failing after 2s
This commit is contained in:
@@ -29,13 +29,14 @@ trap cleanup EXIT
|
|||||||
main() {
|
main() {
|
||||||
log "Starting deployment..."
|
log "Starting deployment..."
|
||||||
|
|
||||||
# Git pull force
|
log "Updating repository to match remote main branch..."
|
||||||
log "Pulling latest changes from the repository..."
|
git fetch origin
|
||||||
git pull origin main --force
|
git checkout -f origin/main
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
log "Failed to pull latest changes."
|
log "Failed to update to the latest main branch."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
log "Repository successfully updated to latest main branch."
|
||||||
|
|
||||||
# Lancer le docker
|
# Lancer le docker
|
||||||
log "Building and starting Docker containers..."
|
log "Building and starting Docker containers..."
|
||||||
|
|||||||
Reference in New Issue
Block a user