fix : modification du script de déploiement pour corriger le problème d'écriture des logs de prod

This commit is contained in:
tristan
2026-01-22 11:50:46 +01:00
parent c4f4107512
commit 5395dfefda
5 changed files with 27 additions and 46 deletions
+17 -6
View File
@@ -4,10 +4,12 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="7c107abe-5995-4428-8429-b146aaca8386" name="Changes" comment="feat : Ajout du bundle Monolog pour la gestion des logs"> <list default="true" id="7c107abe-5995-4428-8429-b146aaca8386" name="Changes" comment="fix : modification du script de déploiement pour corriger le problème d'écriture des logs de prod">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config/packages/monolog.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/config/packages/monolog.yaml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/DEPLOYMENT.md" beforeDir="false" afterPath="$PROJECT_DIR$/DEPLOYMENT.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config/reference.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/reference.php" afterDir="false" /> <change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/scripts/deploy-native.sh" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/scripts/deploy-release.sh" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/deploy-release.sh" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -266,7 +268,7 @@
<workItem from="1768374298711" duration="12403000" /> <workItem from="1768374298711" duration="12403000" />
<workItem from="1768460547451" duration="26946000" /> <workItem from="1768460547451" duration="26946000" />
<workItem from="1768547023783" duration="11371000" /> <workItem from="1768547023783" duration="11371000" />
<workItem from="1768894030675" duration="45508000" /> <workItem from="1768894030675" duration="46930000" />
</task> </task>
<task id="LOCAL-00001" summary="feat : Ajout de pinia, création de la table weight et reception mise en place du système de step pour les receptions (WIP)"> <task id="LOCAL-00001" summary="feat : Ajout de pinia, création de la table weight et reception mise en place du système de step pour les receptions (WIP)">
<option name="closed" value="true" /> <option name="closed" value="true" />
@@ -452,7 +454,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1769075990984</updated> <updated>1769075990984</updated>
</task> </task>
<option name="localTasksCounter" value="24" /> <task id="LOCAL-00024" summary="fix : affiche plus détail dans les logs en recette/prod">
<option name="closed" value="true" />
<created>1769077633390</created>
<option name="number" value="00024" />
<option name="presentableId" value="LOCAL-00024" />
<option name="project" value="LOCAL" />
<updated>1769077633390</updated>
</task>
<option name="localTasksCounter" value="25" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@@ -526,7 +536,8 @@
<MESSAGE value="ci : ajout du script et de la doc déploiement" /> <MESSAGE value="ci : ajout du script et de la doc déploiement" />
<MESSAGE value="fix : correction du path URI pour la création d'un poids dans une réception" /> <MESSAGE value="fix : correction du path URI pour la création d'un poids dans une réception" />
<MESSAGE value="feat : Ajout du bundle Monolog pour la gestion des logs" /> <MESSAGE value="feat : Ajout du bundle Monolog pour la gestion des logs" />
<option name="LAST_COMMIT_MESSAGE" value="feat : Ajout du bundle Monolog pour la gestion des logs" /> <MESSAGE value="fix : affiche plus détail dans les logs en recette/prod" />
<option name="LAST_COMMIT_MESSAGE" value="fix : affiche plus détail dans les logs en recette/prod" />
</component> </component>
<component name="XSLT-Support.FileAssociations.UIState"> <component name="XSLT-Support.FileAssociations.UIState">
<expand /> <expand />
+1 -1
View File
@@ -70,7 +70,7 @@
2. Attendre que la release Gitea soit publiée 2. Attendre que la release Gitea soit publiée
3. Déployer la release 3. Déployer la release
```bash ```bash
sudo DEPLOY_OWNER=malio /usr/local/bin/deploy-ferme v0.0.X sudo DEPLOY_OWNER=malio DEPLOY_GROUP=www-data ./scripts/deploy-release.sh vX.Y.Z
``` ```
### Vérifications ### Vérifications
+1 -1
View File
@@ -83,7 +83,7 @@ Pour le modifier, il faut copier le contenu du deploy-release.sh dans le deploy-
### Livraison ### Livraison
Sur le serveur de recette, il suffit d'utiliser cette commande pour livrer Sur le serveur de recette, il suffit d'utiliser cette commande pour livrer
```bash ```bash
sudo DEPLOY_OWNER=malio /usr/local/bin/deploy-ferme vX.X.X sudo DEPLOY_OWNER=malio DEPLOY_GROUP=www-data ./scripts/deploy-release.sh vX.Y.Z
``` ```
## Commandes utiles ## Commandes utiles
Pour restart le container Pour restart le container
-36
View File
@@ -1,36 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"
BRANCH="develop"
for cmd in git php composer npm; do
if ! command -v "$cmd" >/dev/null 2>&1; then
echo "Missing required command: $cmd" >&2
exit 1
fi
done
echo "==> Pulling latest code ($BRANCH)"
git fetch origin "$BRANCH"
git checkout "$BRANCH"
git pull --ff-only origin "$BRANCH"
echo "==> Installing backend deps (prod)"
composer install --no-dev --optimize-autoloader
echo "==> Running DB migrations"
php bin/console doctrine:migrations:migrate --no-interaction --env=prod
echo "==> Warming Symfony cache (prod)"
php bin/console cache:clear --env=prod
php bin/console cache:warmup --env=prod
echo "==> Building frontend (static)"
cd "$ROOT_DIR/frontend"
npm ci
npm run generate
echo "==> Done."
+6
View File
@@ -73,8 +73,14 @@ echo "Release ${TAG} deployed to ${DEPLOY_DIR}"
if [ -n "${DEPLOY_OWNER:-}" ]; then if [ -n "${DEPLOY_OWNER:-}" ]; then
DEPLOY_GROUP="${DEPLOY_GROUP:-www-data}" DEPLOY_GROUP="${DEPLOY_GROUP:-www-data}"
DEPLOY_PERMS_SCOPE="${DEPLOY_PERMS_SCOPE:-var}"
if [ "$DEPLOY_PERMS_SCOPE" = "all" ]; then
chown -R "${DEPLOY_OWNER}:${DEPLOY_GROUP}" "$DEPLOY_DIR" chown -R "${DEPLOY_OWNER}:${DEPLOY_GROUP}" "$DEPLOY_DIR"
chmod -R g+rx,o+rx "$DEPLOY_DIR" chmod -R g+rx,o+rx "$DEPLOY_DIR"
elif [ -d "${DEPLOY_DIR}/var" ]; then
chown -R "${DEPLOY_OWNER}:${DEPLOY_GROUP}" "${DEPLOY_DIR}/var"
chmod -R g+rwX "${DEPLOY_DIR}/var"
fi
fi fi
if [ -f "${DEPLOY_DIR}/.env.local" ]; then if [ -f "${DEPLOY_DIR}/.env.local" ]; then