From 74a34f453aad891472934512991a5fd492ae51a9 Mon Sep 17 00:00:00 2001 From: Mike Kell Date: Fri, 13 Jun 2025 13:06:21 +0000 Subject: [PATCH] feat(dev): external Keycloak detection, scoped services, pytest compatibility --- Makefile | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index db6e423..7808522 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,16 @@ # Root Makefile for CMMC-Platform local dev +############################################################ +# Load .env into Make's environment (must be first!) +############################################################ +ifneq (,$(wildcard .env)) +include .env +export $(shell sed -E 's/#.*//' .env | cut -d= -f1) +endif + +# ───────────── rest of your Makefile below ───────────── compose = podman-compose -f dev-compose.yaml +# # ---------------------------------------------------------- # Helpers @@ -11,9 +21,12 @@ create-proxy-net: # probe external Keycloak once and cache the flag check-idp: @echo "🔍 Probing $(KEYCLOAK_URL) for existing Keycloak..." - @if curl -sf "${KEYCLOAK_URL:-http://keycloak.local:8080}/realms/master" >/dev/null ; \ - then echo "🥳 External Keycloak detected!"; echo 1 >.idp_flag ; \ - else echo "🛠 No external Keycloak found."; echo 0 >.idp_flag ; fi + @if curl -skL --max-time 5 "$${KEYCLOAK_URL:-http://keycloak.local:8080}/realms/master" >/dev/null ; then \ + echo "🥳 External Keycloak detected!"; echo 1 >.idp_flag ; \ + else \ + echo "🛠 No external Keycloak found."; echo 0 >.idp_flag ; \ + fi + # ---------------------------------------------------------- # Lifecycle targets