Amélioration du script de déploiement : remplacement de git pull par git fetch et git reset pour une mise à jour plus sécurisée du dépôt.
All checks were successful
SSH Frontend Deploy / ssh-deploy (push) Successful in 2s
All checks were successful
SSH Frontend Deploy / ssh-deploy (push) Successful in 2s
This commit is contained in:
@@ -29,13 +29,14 @@ trap cleanup EXIT
|
||||
main() {
|
||||
log "Starting deployment..."
|
||||
|
||||
# Git pull force
|
||||
log "Pulling latest changes from the repository..."
|
||||
git pull origin main --force
|
||||
log "Updating repository to match remote main branch..."
|
||||
git fetch origin
|
||||
git reset --hard origin/main
|
||||
if [ $? -ne 0 ]; then
|
||||
log "Failed to pull latest changes."
|
||||
log "Failed to update to the latest main branch."
|
||||
exit 1
|
||||
fi
|
||||
log "Repository successfully updated to latest main branch."
|
||||
|
||||
# Lancer le docker
|
||||
log "Building and starting Docker containers..."
|
||||
|
||||
Reference in New Issue
Block a user