-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (74 loc) · 2.26 KB
/
Copy pathMakefile
File metadata and controls
95 lines (74 loc) · 2.26 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
90
91
92
93
94
95
SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)
KIND_CLUSTER ?= gateway-e2e
CHAINSAW ?= $(LOCALBIN)/chainsaw
CHAINSAW_VERSION ?= v0.2.15
.PHONY: all
all: build
.PHONY: build
build:
cd src && go build -o ../bin/gateway .
.PHONY: test
test:
cd src && go test ./...
.PHONY: vet
vet:
cd src && go vet ./...
.PHONY: fmt
fmt:
cd src && go fmt ./...
.PHONY: lint
lint:
cd src && golangci-lint run
.PHONY: lint-fix
lint-fix:
cd src && golangci-lint run --fix
.PHONY: helm-lint
helm-lint:
helm lint charts/kargo-loki-gateway
helm template kargo-loki-gateway charts/kargo-loki-gateway
.PHONY: helm-package
helm-package:
helm package charts/kargo-loki-gateway --destination bin/
.PHONY: e2e
e2e: chainsaw
$(CHAINSAW) test test/e2e/
.PHONY: kind-create
kind-create:
kind create cluster --name $(KIND_CLUSTER) --config hack/kind-config.yaml --wait 5m
.PHONY: kind-delete
kind-delete:
kind delete cluster --name $(KIND_CLUSTER)
.PHONY: kind-load
kind-load: docker-build
kind load docker-image kargo-loki-gateway:dev --name $(KIND_CLUSTER)
.PHONY: e2e-infra
e2e-infra:
@chmod +x hack/e2e-infra/setup.sh && hack/e2e-infra/setup.sh
.PHONY: chainsaw
chainsaw: $(CHAINSAW)
$(CHAINSAW): $(LOCALBIN)
@[ -f "$(CHAINSAW)" ] || { \
set -e; \
OS=$$(uname -s | tr '[:upper:]' '[:lower:]'); \
ARCH=$$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/'); \
URL="https://github.com/kyverno/chainsaw/releases/download/$(CHAINSAW_VERSION)/chainsaw_$${OS}_$${ARCH}.tar.gz"; \
echo "Downloading chainsaw $(CHAINSAW_VERSION) from $${URL}"; \
curl -sSfL "$$URL" | tar -xz -C $(LOCALBIN) chainsaw; \
}
.PHONY: docs-gen
docs-gen: ## Regenerate llms.txt, llms-full.txt, AGENTS.md, knowledge.yaml from source annotations.
cd hack/gen-docs && go run .
.PHONY: docs-diff
docs-diff: ## Show what docs-gen would change without writing files (exits 1 if stale).
cd hack/gen-docs && go run . --diff
.PHONY: devenv
devenv: ## Start local dev environment via Tilt (creates kind cluster if needed).
kind get clusters | grep -q $(KIND_CLUSTER) || kind create cluster --name $(KIND_CLUSTER) --config hack/kind-config.yaml --wait 5m
tilt up
.PHONY: docker-build
docker-build:
docker build -t kargo-loki-gateway:dev .