From 4351c74c7c5f97156bc94d3a8549b9940ac80e3f Mon Sep 17 00:00:00 2001 From: mo khan Date: Wed, 2 Jul 2025 17:58:24 -0600 Subject: feat: implement cargo vendor and optimize Docker builds --- Makefile | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index dea71cfd..ca1a93db 100644 --- a/Makefile +++ b/Makefile @@ -2,15 +2,15 @@ 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 check test run clean fmt lint doc vendor .PHONY: build-image run-image health-check list-services test-grpc setup: @rustup component add clippy rustfmt # Cargo targets -build: - @cargo build +build: vendor + @cargo build --offline check: @cargo check @@ -19,7 +19,7 @@ test: @cargo test run: - @cargo run + @cargo run --offline clean: @cargo clean @@ -33,8 +33,14 @@ lint: doc: @cargo doc --open +vendor: + @cargo vendor + # Docker targets -build-image: +build-image: vendor + @docker build --tag $(IMAGE_TAG) . + +build-image-clean: @docker build --no-cache --tag $(IMAGE_TAG) . run-image: build-image @@ -43,3 +49,6 @@ run-image: build-image # gRPC testing targets health-check: @grpcurl -plaintext localhost:50051 grpc.health.v1.Health/Check + +list-services: + @grpcurl -plaintext localhost:50051 list -- cgit v1.2.3