From c5a2dabd124a8867c216ee4dc40b576fee619125 Mon Sep 17 00:00:00 2001 From: Bakery Admin Date: Sat, 24 Jan 2026 16:00:51 +0100 Subject: [PATCH] Fix Forntend build issues 7 --- .../templates/task-update-gitops.yaml | 46 ++++++++++++++++++- shared/database/base.py | 2 +- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/infrastructure/cicd/tekton-helm/templates/task-update-gitops.yaml b/infrastructure/cicd/tekton-helm/templates/task-update-gitops.yaml index 37073e5e..6bc968e8 100644 --- a/infrastructure/cicd/tekton-helm/templates/task-update-gitops.yaml +++ b/infrastructure/cicd/tekton-helm/templates/task-update-gitops.yaml @@ -94,9 +94,51 @@ spec: # Compute short hash once for job name updates SHORT_HASH=$(echo "$(params.git-revision)" | cut -c 1-8) + # Handle special cases for service discovery + # "all" = all services + gateway + frontend + # "services-and-gateway" = all services + gateway (no frontend) - used when shared/ changes + SERVICES_PARAM=$(echo "$(params.services)" | tr -d '\n' | tr -d ' ') + WORKSPACE="$(workspaces.source.path)" + + if [ "$SERVICES_PARAM" = "all" ] || [ "$SERVICES_PARAM" = "services-and-gateway" ]; then + echo "Expanding '$SERVICES_PARAM' to actual service list..." + SERVICES="" + # Find all services with Dockerfiles + if [ -d "$WORKSPACE/services" ]; then + for svc_name in $(ls "$WORKSPACE/services/"); do + if [ -f "$WORKSPACE/services/$svc_name/Dockerfile" ]; then + if [ -z "$SERVICES" ]; then + SERVICES="$svc_name" + else + SERVICES="$SERVICES,$svc_name" + fi + fi + done + fi + # Add gateway + if [ -d "$WORKSPACE/gateway" ]; then + if [ -z "$SERVICES" ]; then + SERVICES="gateway" + else + SERVICES="$SERVICES,gateway" + fi + fi + # Add frontend ONLY for "all" (not for "services-and-gateway") + if [ "$SERVICES_PARAM" = "all" ] && [ -d "$WORKSPACE/frontend" ]; then + if [ -z "$SERVICES" ]; then + SERVICES="frontend" + else + SERVICES="$SERVICES,frontend" + fi + fi + echo "Expanded services: $SERVICES" + else + SERVICES="$SERVICES_PARAM" + fi + # Update image tags in Kubernetes manifests # Service names come from detect-changes task as folder names: auth, tenant, ai_insights, etc. - for service in $(echo "$(params.services)" | tr ',' '\n'); do + for service in $(echo "$SERVICES" | tr ',' '\n'); do service=$(echo "$service" | xargs) # Trim whitespace if [ -n "$service" ] && [ "$service" != "none" ] && [ "$service" != "infrastructure" ] && [ "$service" != "shared" ]; then echo "" @@ -186,7 +228,7 @@ spec: git add . git status if ! git diff --cached --quiet; then - git commit -m "Update images for services: $(params.services) [skip ci]" + git commit -m "Update images for services: $SERVICES [skip ci]" echo "Pushing to branch: $BRANCH_NAME" git push origin "HEAD:$BRANCH_NAME" echo "GitOps manifests updated successfully" diff --git a/shared/database/base.py b/shared/database/base.py index 58882240..42b7dc0f 100755 --- a/shared/database/base.py +++ b/shared/database/base.py @@ -24,7 +24,7 @@ logger = structlog.get_logger() Base = declarative_base() class DatabaseManager: - """Enhanced Database Manager for Microservices + """Test Enhanced Database Manager for Microservices Provides: - Connection pooling with configurable settings