From 2ddcc34ca455973598f5693d64103deea41d8d79 Mon Sep 17 00:00:00 2001 From: mo khan Date: Tue, 8 Jul 2025 13:11:59 -0600 Subject: chore: use minit to start processes from Procfile --- Makefile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 07d65fb..0872ee3 100644 --- a/Makefile +++ b/Makefile @@ -20,13 +20,9 @@ setup: @go mod vendor @go tool @if command -v brew >/dev/null 2>&1; then \ - echo "Installing Homebrew packages..."; \ brew bundle; \ - else \ - echo "Homebrew not found, skipping brew bundle"; \ fi - @echo "Installing Python dependencies..." - pip install dumb-init + @pip install dumb-init build: bin/authzd bin/sparkled @@ -42,13 +38,13 @@ test-integration: build-image test: clean test-unit test-integration build-image: - @docker build --no-cache --tag $(IMAGE_TAG) . + @docker build --network=host --no-cache --tag $(IMAGE_TAG) . build-builder-image: @docker build --target build --tag $(IMAGE_TAG) . run: clean build - @go tool godotenv -f .env.local,.env ./bin/entrypoint.sh + @go tool godotenv -f .env.local,.env go tool minit run-authzd: clean build @go tool godotenv -f .env.local,.env ./bin/authzd -- cgit v1.2.3 From 7862db222e75ed69601f58bb65eed5291b692272 Mon Sep 17 00:00:00 2001 From: mo khan Date: Mon, 21 Jul 2025 15:25:38 -0600 Subject: chore: switch to mise.toml --- .tool-versions | 2 -- Makefile | 20 +------------------- mise.toml | 3 +++ 3 files changed, 4 insertions(+), 21 deletions(-) delete mode 100644 .tool-versions create mode 100644 mise.toml (limited to 'Makefile') diff --git a/.tool-versions b/.tool-versions deleted file mode 100644 index 6cd6801..0000000 --- a/.tool-versions +++ /dev/null @@ -1,2 +0,0 @@ -golang 1.24.3 -python 3.13.4 diff --git a/Makefile b/Makefile index 0872ee3..26cce23 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ clean: @go clean -testcache setup: - @MISE_CONFIG_FILE=.tool-versions MISE_GLOBAL_CONFIG_FILE="" mise install + @mise install @go mod tidy @go mod vendor @go tool @@ -40,30 +40,12 @@ test: clean test-unit test-integration build-image: @docker build --network=host --no-cache --tag $(IMAGE_TAG) . -build-builder-image: - @docker build --target build --tag $(IMAGE_TAG) . - run: clean build @go tool godotenv -f .env.local,.env go tool minit -run-authzd: clean build - @go tool godotenv -f .env.local,.env ./bin/authzd - run-image: clean build-image @docker run --rm --network host --env-file .env.local -p 10000:10000 -p 9901:9901 -p 8080:8080 -it $(IMAGE_TAG) -run-envoy: - @go tool godotenv -f .env.local,.env ./bin/envoy.sh - -run-sparkled: clean build - @go tool godotenv -f .env.local,.env ./bin/sparkled - -sh-image: build-builder-image - @docker run --rm -it $(IMAGE_TAG) /bin/sh - -authzd-rpc-check: - @go tool grpcurl -plaintext -format text -d '' 127.0.0.1:10003 envoy.service.auth.v3.Authorization.Check - lint: @go tool yamlfmt --lint -exclude vendor . diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000..7cdebe6 --- /dev/null +++ b/mise.toml @@ -0,0 +1,3 @@ +[tools] +go = "1.24.3" +python = "3.13.4" -- cgit v1.2.3 From 8de4cbbccd1fe2aae5a9919eab747181809603fa Mon Sep 17 00:00:00 2001 From: mo khan Date: Mon, 21 Jul 2025 15:31:49 -0600 Subject: chore: extract variable for sparkle binary --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 26cce23..9d88429 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,19 @@ PROJECT_NAME := $(shell basename $(shell pwd)) GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD | sed 's/\//_/g') IMAGE_TAG := $(PROJECT_NAME):$(GIT_BRANCH) +AUTHZD_BIN := bin/authzd +SPARKLED_BIN := bin/sparkled .PHONY: clean setup build test run -bin/authzd: - @go build -o ./bin/authzd ./cmd/authzd/main.go +$(AUTHZD_BIN): $(shell find . -name "*.go" 2>/dev/null) go.sum + @go build -o $(AUTHZD_BIN) ./cmd/authzd/main.go -bin/sparkled: - @go build -o ./bin/sparkled ./cmd/sparkled/main.go +$(SPARKLED_BIN): $(shell find . -name "*.go" 2>/dev/null) go.sum + @go build -o $(SPARKLED_BIN) ./cmd/sparkled/main.go clean: - @rm -f ./bin/authzd ./bin/sparkled + @rm -f $(AUTHZD_BIN) $(SPARKLED_BIN) @go clean -testcache setup: @@ -24,7 +26,7 @@ setup: fi @pip install dumb-init -build: bin/authzd bin/sparkled +build: $(AUTHZD_BIN) $(SPARKLED_BIN) test-unit: @go test -shuffle=on ./... -- cgit v1.2.3 From d319c49c79b85a7000a9453589a15536f97f97eb Mon Sep 17 00:00:00 2001 From: mo khan Date: Mon, 21 Jul 2025 15:33:30 -0600 Subject: chore: use mise exec to install tools --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 9d88429..9d582c4 100644 --- a/Makefile +++ b/Makefile @@ -18,13 +18,14 @@ clean: setup: @mise install - @go mod tidy - @go mod vendor - @go tool + @mise exec go -- go install github.com/xlgmokha/minit@latest + @mise exec go -- go mod tidy + @mise exec go -- go mod vendor + @mise exec go -- go tool @if command -v brew >/dev/null 2>&1; then \ brew bundle; \ fi - @pip install dumb-init + @@mise exec python -- pip install dumb-init build: $(AUTHZD_BIN) $(SPARKLED_BIN) -- cgit v1.2.3