ESPO-03 liest die Version aus EspoCRM selbst

Der Abnahmelauf meldete 'Version: unbekannt' - das grep auf data/config.php
griff nicht. Jetzt fragt das Skript EspoCRM im Container (config.php und
config-internal.php zusammengefuehrt) und faellt nur ersatzweise auf grep
ueber beide Dateien zurueck.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
gordon.zimm 2026-09-24 11:33:46 +02:00
parent f33d2d5131
commit c0e62788c0

View File

@ -68,7 +68,11 @@ echo "--- Container"
docker compose -f /srv/espo/docker-compose.yml ps --format 'table {{.Name}}\t{{.Status}}'
echo "--- Instanz"
echo "FQDN: $FQDN (Ring $RING)"
echo "Version: $(grep -oP "'version'\s*=>\s*'\K[^']+" /srv/espo/data/config.php 2>/dev/null || echo unbekannt)"
# Die Version steht je nach Stand in config.php oder in config-internal.php - EspoCRM selbst
# fragen ist verlaesslicher als eine der beiden Dateien zu raten.
VERSION="$(docker exec espocrm php -r '$a=@include "data/config.php"; $b=@include "data/config-internal.php"; $c=array_merge(is_array($a)?$a:[], is_array($b)?$b:[]); echo $c["version"] ?? "";' 2>/dev/null)"
[ -n "$VERSION" ] || VERSION="$(grep -hoP "['\"]version['\"]\s*=>\s*['\"]\K[^'\"]+" /srv/espo/data/config.php /srv/espo/data/config-internal.php 2>/dev/null | head -1)"
echo "Version: ${VERSION:-unbekannt}"
IMAGE="$(docker inspect -f '{{.Config.Image}}' espocrm 2>/dev/null)"
echo "Image: $IMAGE"
echo "Digest: $(docker image inspect --format '{{if .RepoDigests}}{{index .RepoDigests 0}}{{else}}{{.Id}}{{end}}' "$IMAGE" 2>/dev/null)"