Repository navigation
🐛 fix(deploy): composer via PHP CLI, vérification de vendor/ et rollback avant migrations (#570) - #602
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #570
Pourquoi
Incident #569 : 6 instances en HTTP 500. Le déploiement nocturne a lancé composer avec le PHP CGI du PATH cron ; composer a affiché son aide et sorti en code 0 sans rien installer, alors que
git checkoutavait déjà mis le code à jour. Résultat : nouveau code + ancienvendor/(3 paquets manquants), et aucun rollback.Deux constats en plus pendant l'analyse :
61ba614était lui-même cassé ("$COMPOSER_BIN"entre guillemets, valeur de deux mots → exit 127), donc le cron nocturne aurait échoué dès qu'une instance l'aurait récupéré ;main, sans que personne le voie (ils ne tournent pas en CI).Changements
bin/lib/deploy-common.sh(nouveau) : définition unique de composer (PHP CLI explicite,memory_limit) et de la vérification devendor/, sourcée pardeploy-nightly.sh,deploy-all.shetdeploy.sh. Plus aucuncomposernu dansbin/.vendor/aprèscomposer install:composer install --dry-run --no-devdoit afficher « Nothing to install, update or remove ». Validé avec le vrai composer sur la prod : présent sur ronan, absent sur yannick (3 paquets manquants listés).HEADréellement en place (pas.deployed-sha), réinstallation devendor/, vérification,cache:clear. Rapport→ code restauré (<sha>)ou→ ROLLBACK ÉCHOUÉ. Pas de rollback à partir des migrations (état de la base incertain), ni siHEADest déjà la cible..claude/deploiement.md,.github/avancement.md.Points d'attention
bin/deploy.sh(script historique) : son mode primo déploiement installait composer sans--no-dev; il utilise désormais les arguments communs. Pas de rollback dans ce script (deploy-all.shest l'outil supporté).deploy-all.shdepuis le poste.tests/bash/run.shen CI (proposé, non fait ici).Tests
bash tests/bash/run.sh: 28/28 (11 nouveaux, 7 réparés) — vérification devendor/, rollback, pas de rollback après migration ou si HEAD = cible, rollback en échec signalé, pas decomposernu.