summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-02 12:32:27 -0600
committermo khan <mo@mokhan.ca>2025-07-02 12:32:27 -0600
commita577c62277e3d651b66fd68dbe800bf3ab5c4921 (patch)
tree7ae4e79fc84c539c12fb0313d0d3cc929b2e12ae /Makefile
parentc2b8edab01b23fde6cc196a3349ad6aa19a93299 (diff)
parent0b610d061e45811130d8cf3919037fdc9513e340 (diff)
Merge branch 'rs' into 'main'
Re-write the authorization daemon in rust See merge request gitlab-org/software-supply-chain-security/authorization/authzd!1
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile53
1 files changed, 42 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 028279a6..a134ae64 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,42 @@
-default: install-tools
- @mage -l
-
-install-tools:
- @cargo install --keep-going cedar-policy-cli
- @go install tool
- @command -v cedar
- @command -v mage
- @command -v protoc-gen-go
- @command -v protoc-gen-go-grpc
- @command -v protoc-gen-twirp_ruby
+PROJECT_NAME := $(shell basename $(shell pwd))
+GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD | sed 's/\//_/g')
+IMAGE_TAG := $(PROJECT_NAME):$(GIT_BRANCH)
+
+.PHONY: build check test run clean fmt lint doc
+.PHONY: build-image run-image health-check list-services test-grpc
+
+# Cargo targets
+build:
+ @cargo build
+
+check:
+ @cargo check
+
+test:
+ @cargo test
+
+run:
+ @cargo run
+
+clean:
+ @cargo clean
+
+fmt:
+ @cargo fmt
+
+lint:
+ @cargo clippy -- -D warnings
+
+doc:
+ @cargo doc --open
+
+# Docker targets
+build-image:
+ @docker build --no-cache --tag $(IMAGE_TAG) .
+
+run-image: build-image
+ @docker run --rm -p 50051:50051 -it $(IMAGE_TAG)
+
+# gRPC testing targets
+health-check:
+ @grpcurl -plaintext localhost:50051 grpc.health.v1.Health/Check