summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile51
1 files changed, 16 insertions, 35 deletions
diff --git a/Makefile b/Makefile
index 07d65fb..9d582c4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,34 +1,33 @@
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:
- @MISE_CONFIG_FILE=.tool-versions MISE_GLOBAL_CONFIG_FILE="" mise install
- @go mod tidy
- @go mod vendor
- @go tool
+ @mise install
+ @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 \
- echo "Installing Homebrew packages..."; \
brew bundle; \
- else \
- echo "Homebrew not found, skipping brew bundle"; \
fi
- @echo "Installing Python dependencies..."
- pip install dumb-init
+ @@mise exec python -- pip install dumb-init
-build: bin/authzd bin/sparkled
+build: $(AUTHZD_BIN) $(SPARKLED_BIN)
test-unit:
@go test -shuffle=on ./...
@@ -42,32 +41,14 @@ test-integration: build-image
test: clean test-unit test-integration
build-image:
- @docker build --no-cache --tag $(IMAGE_TAG) .
-
-build-builder-image:
- @docker build --target build --tag $(IMAGE_TAG) .
+ @docker build --network=host --no-cache --tag $(IMAGE_TAG) .
run: clean build
- @go tool godotenv -f .env.local,.env ./bin/entrypoint.sh
-
-run-authzd: clean build
- @go tool godotenv -f .env.local,.env ./bin/authzd
+ @go tool godotenv -f .env.local,.env go tool minit
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 .