From 0a81a89b717dc6d65436b491cbc6c8e9308df2c3 Mon Sep 17 00:00:00 2001 From: mo khan Date: Thu, 3 Jul 2025 16:26:44 -0600 Subject: chore: use forego to start services --- Makefile | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 2ab437eb..c56bb9ba 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ IMAGE_TAG := $(PROJECT_NAME):$(GIT_BRANCH) setup: mise install - mise exec go -- go install github.com/mattn/goreman@latest + mise exec go -- go install github.com/ddollar/forego@latest mise exec rustup -- rustup component add clippy rustfmt # Cargo targets @@ -22,7 +22,7 @@ test: run: build @cp target/debug/authzd bin/authzd - @goreman -set-ports=false -rpc-server=false -f ./Procfile -exit-on-error=true start + @forego start -f Procfile clean: @cargo clean @@ -43,9 +43,6 @@ vendor: build-image: @docker build --tag $(IMAGE_TAG) . -build-image-clean: - @docker build --tag $(IMAGE_TAG) . - run-image: build-image @docker run --rm -p 10000:10000 -p 9901:9901 --init -it $(IMAGE_TAG) @@ -53,23 +50,5 @@ run-image: build-image health-check: @curl -s http://localhost:10000/health || echo "Service not running" -envoy-admin: - @curl -s http://localhost:9901/stats/prometheus | head -20 - list-services: @grpcurl -plaintext localhost:50051 list - -test-image: build-image - @echo "Starting container..." - @docker run -d --name authzd-test -p 10000:10000 -p 9901:9901 $(IMAGE_TAG) - @echo "Waiting for services to start..." - @sleep 5 - @echo "Testing Envoy admin endpoint..." - @curl -s http://localhost:9901/stats/prometheus | grep -q "envoy_" && echo "✓ Envoy admin is accessible" || echo "✗ Envoy admin failed" - @echo "Testing health endpoint..." - @curl -s -o /dev/null -w "%{http_code}" http://localhost:10000/health | grep -q "200" && echo "✓ Health check passed" || echo "✗ Health check failed" - @echo "Testing authorization flow..." - @curl -s -H "Authorization: Bearer valid-token" http://localhost:10000/ -w "\n%{http_code}" | grep -q "200" && echo "✓ Auth with valid token passed" || echo "✗ Auth with valid token failed" - @curl -s http://localhost:10000/ -w "\n%{http_code}" | grep -q "401" && echo "✓ Auth without token correctly rejected" || echo "✗ Auth without token failed" - @echo "Cleaning up..." - @docker stop authzd-test && docker rm authzd-test -- cgit v1.2.3