forked from mem9-ai/mem9
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (27 loc) · 1.1 KB
/
Copy pathMakefile
File metadata and controls
38 lines (27 loc) · 1.1 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
MAKEFILE_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
IMG ?= $(REGISTRY)/mnemo-server:$(COMMIT)
.PHONY: build vet clean run dev test test-cover test-integration docker
build:
mkdir -p $(MAKEFILE_DIR)/server/bin
cd server && CGO_ENABLED=0 go build -o ./bin/mnemo-server ./cmd/mnemo-server
build-linux:
mkdir -p $(MAKEFILE_DIR)/server/bin
cd server && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./bin/mnemo-server ./cmd/mnemo-server
vet:
cd server && go vet ./...
test:
cd server && go test -race -count=1 ./...
test-cover:
cd server && mkdir -p coverage
cd server && go test -race -count=1 -covermode=atomic -coverprofile=coverage/coverage.out ./...
cd server && go tool cover -func=coverage/coverage.out > coverage/coverage.txt
test-integration:
cd server && go test -tags=integration -race -count=1 -v ./internal/repository/tidb/
clean:
rm -f server/bin/mnemo-server
run: build
cd server && MNEMO_DSN="$(MNEMO_DSN)" ./bin/mnemo-server
dev:
cd server && bash ./scripts/dev-watch.sh
docker: build-linux
docker build --platform=linux/amd64 -q -f ./server/Dockerfile -t $(IMG) .