Fix issues 8

This commit is contained in:
2026-01-23 21:54:05 +01:00
parent c3defa3a10
commit bd6db544ba

View File

@@ -154,18 +154,26 @@ spec:
echo "Building service: $service" echo "Building service: $service"
echo "===================================================================" echo "==================================================================="
# Determine Dockerfile path and image name # Determine Dockerfile path, context path, and image name
# Folder names are: auth, tenant, gateway, frontend, alert_processor, etc. # Folder names are: auth, tenant, gateway, frontend, alert_processor, etc.
# Image names MUST match what's in the Kubernetes manifests exactly # Image names MUST match what's in the Kubernetes manifests exactly
# The manifests use the folder name directly (with underscores preserved) # The manifests use the folder name directly (with underscores preserved)
#
# CONTEXT_PATH is important - some Dockerfiles expect the context to be their directory
# (e.g., frontend expects context=frontend/), while services expect context=workspace root
if [ "$service" = "gateway" ]; then if [ "$service" = "gateway" ]; then
DOCKERFILE_PATH="$WORKSPACE/gateway/Dockerfile" DOCKERFILE_PATH="$WORKSPACE/gateway/Dockerfile"
CONTEXT_PATH="$WORKSPACE"
IMAGE_NAME="gateway" IMAGE_NAME="gateway"
elif [ "$service" = "frontend" ]; then elif [ "$service" = "frontend" ]; then
# Frontend Dockerfile expects context to be the frontend/ directory
# because it does COPY package*.json ./ and COPY nginx.conf etc.
DOCKERFILE_PATH="$WORKSPACE/frontend/Dockerfile.kubernetes" DOCKERFILE_PATH="$WORKSPACE/frontend/Dockerfile.kubernetes"
CONTEXT_PATH="$WORKSPACE/frontend"
IMAGE_NAME="frontend" IMAGE_NAME="frontend"
else else
DOCKERFILE_PATH="$WORKSPACE/services/$service/Dockerfile" DOCKERFILE_PATH="$WORKSPACE/services/$service/Dockerfile"
CONTEXT_PATH="$WORKSPACE"
# Use folder name directly - matches manifest image references # Use folder name directly - matches manifest image references
# e.g., auth, tenant, ai_insights, alert_processor, demo_session, external # e.g., auth, tenant, ai_insights, alert_processor, demo_session, external
IMAGE_NAME="$service" IMAGE_NAME="$service"
@@ -191,10 +199,11 @@ spec:
sleep 10 sleep 10
fi fi
echo "Context: $CONTEXT_PATH"
if /kaniko/executor \ if /kaniko/executor \
--dockerfile="$DOCKERFILE_PATH" \ --dockerfile="$DOCKERFILE_PATH" \
--destination="$(params.registry)/$IMAGE_NAME:$(params.git-revision)" \ --destination="$(params.registry)/$IMAGE_NAME:$(params.git-revision)" \
--context="$WORKSPACE" \ --context="$CONTEXT_PATH" \
--build-arg="BASE_REGISTRY=$(params.base-registry)" \ --build-arg="BASE_REGISTRY=$(params.base-registry)" \
--build-arg="PYTHON_IMAGE=$(params.python-image)" \ --build-arg="PYTHON_IMAGE=$(params.python-image)" \
--cache=true \ --cache=true \