-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (49 loc) · 2.16 KB
/
Copy pathMakefile
File metadata and controls
69 lines (49 loc) · 2.16 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
export VERSION ?= $(shell git show -q --format=%h)
export IMAGE ?= kodefluence/altair
test:
go test -race -cover -coverprofile=cover.out $$(go list ./... | grep -Ev "altair$$|core|mock|interfaces|testhelper|/e2e")
# End-to-end smoke test. Builds the binary, scaffolds via `altair new`,
# spawns a real altair subprocess against an in-process echo upstream, and
# exercises the proxy path (forwarding, headers, timeout, body cap).
# Build-tagged so `make test` stays fast; opt in with `make smoke`.
# Phase A is gateway-only (no MySQL); Phase B will add the oauth+MySQL
# matrix per docs/superpowers/specs/2026-04-23-altair-smoke-test-design.md.
smoke:
go test -tags=e2e -count=1 -v -timeout=5m ./e2e/...
mock_metric:
mockgen -source core/metric.go -destination mock/mock_metric.go -package mock
mock_plugin:
mockgen -source core/plugin.go -destination mock/mock_plugin.go -package mock
mock_loader:
mockgen -source core/cfg.go -destination mock/mock_cfg.go -package mock
mock_routing:
mockgen -source core/routing.go -destination mock/mock_routing.go -package mock
mock_all: mock_service mock_formatter mock_model mock_validator mock_plugin mock_routing
build_linux:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s" -o ./build_output/linux/altair
upx -9 -k ./build_output/linux/altair
build_darwin:
GOOS=darwin GOARCH=386 CGO_ENABLED=0 go build -ldflags="-s" -o ./build_output/darwin/altair
upx -9 -k ./build_output/darwin/altair
build_windows:
GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -ldflags="-s" -o ./build_output/windows/altair
upx -9 -k ./build_output/windows/altair
build: build_linux build_darwin build_windows
build_docker: build_docker_latest
docker build -t $(IMAGE):$(VERSION) -f ./Dockerfile .
build_docker_latest:
docker build -t $(IMAGE):latest -f ./Dockerfile .
push_docker: push_docker_latest
docker push $(IMAGE):$(VERSION)
tag_docker_latest:
docker tag $(IMAGE):latest $(IMAGE):latest
push_docker_latest:
docker push $(IMAGE):latest
docker-compose-up:
docker-compose --env-file .env up -d
docker-compose-start:
docker-compose --env-file .env start
docker-compose-stop:
docker-compose stop
docker-compose-down:
docker-compose down