forked from agentgateway/agentgateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
89 lines (73 loc) · 2 KB
/
Makefile
File metadata and controls
89 lines (73 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Image configuration
DOCKER_REGISTRY ?= ghcr.io
DOCKER_REPO ?= agentgateway
IMAGE_NAME ?= agentgateway
VERSION ?= $(shell git describe --tags --always --dirty)
GIT_REVISION ?= $(shell git rev-parse HEAD)
IMAGE_TAG ?= $(VERSION)
IMAGE_FULL_NAME ?= $(DOCKER_REGISTRY)/$(DOCKER_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
DOCKER_BUILDER ?= docker
DOCKER_BUILD_ARGS ?= --build-arg VERSION=$(VERSION) --build-arg GIT_REVISION=$(GIT_REVISION)
export PATH := ./tools:$(PATH)
# docker
.PHONY: docker
docker:
ifeq ($(OS),Windows_NT)
$(DOCKER_BUILDER) build $(DOCKER_BUILD_ARGS) -f Dockerfile.windows -t $(IMAGE_FULL_NAME) .
else
$(DOCKER_BUILDER) build $(DOCKER_BUILD_ARGS) -t $(IMAGE_FULL_NAME) . --progress=plain
endif
.PHONY: docker-musl
docker-musl:
$(DOCKER_BUILDER) build $(DOCKER_BUILD_ARGS) -t $(IMAGE_FULL_NAME)-musl --build-arg=BUILDER=musl . --progress=plain
CARGO_BUILD_ARGS ?=
# build
.PHONY: build
build:
cargo build --release --features ui $(CARGO_BUILD_ARGS)
.PHONY: build-target
build-target:
cargo build --features ui $(CARGO_BUILD_ARGS) --target $(TARGET) --profile $(PROFILE)
# lint
.PHONY: lint
lint:
cargo fmt --check
cargo clippy --all-targets -- -D warnings
.PHONY: fix-lint
fix-lint:
cargo clippy --fix --allow-staged --allow-dirty --allow-no-vcs
cargo fmt
.PHONY: format
format:
cargo fmt
# test
.PHONY: test
test:
cargo test --all-targets
# clean
.PHONY: clean
clean:
cargo clean
objects := $(wildcard examples/*/config.json)
.PHONY: check-clean-repo
check-clean-repo:
@tools/check_clean_repo.sh
.PHONY: gen
gen: generate-apis generate-schema format
@:
.PHONY: generate-schema
generate-schema:
@cargo xtask schema
# Code generation for xds apis
.PHONY: generate-apis
generate-apis:
@PATH="./common/tools:$(PATH)" buf generate --path crates/agentgateway/proto/resource.proto
.PHONY: run-validation-deps
run-validation-deps:
@tools/manage-validation-deps.sh start
.PHONY: stop-validation-deps
stop-validation-deps:
@tools/manage-validation-deps.sh stop
.PHONY: validate
validate:
@tools/validate-configs.sh