-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (32 loc) · 1.4 KB
/
Makefile
File metadata and controls
39 lines (32 loc) · 1.4 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
TAG ?= latest
.PHONY: init
init:
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install github.com/golang/mock/mockgen@latest
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6
.PHONY:mock
mock:
mockgen -source=./internal/store/codegraph/store.go -destination=./internal/store/codegraph/mocks/graph_store_mock.go -package=mocks
mockgen -source=internal/store/vector/vector_store.go -destination=internal/store/vector/mocks/vector_store_mock.go --package=mocks
mockgen -source=./internal/store/codebase/codebase_store.go -destination=./internal/store/codebase/mocks/codebase_store_mock.go -package=mocks
mockgen -source=./internal/store/codebase/wrapper/minio_wrapper.go -destination=./internal/store/codebase/wrapper/mocks/minio_client_mock.go -package=mocks
mockgen -source=internal/store/mq/mq.go -destination=internal/store/mq/mocks/mq_mock.go --package=mocks
.PHONY:proto
proto:
protoc --go_out=. internal/store/codegraph/definition.proto
protoc --go_out=. internal/store/codegraph/document.proto
protoc --go_out=. internal/store/codegraph/keys.proto
.PHONY:test
test:
go test ./internal/...
.PHONY:build
build:
go mod tidy
go build -ldflags="-s -w" -o ./bin/main ./cmd/main.go
.PHONY:docker
docker:
docker build -t zgsm/codebase-indexer:$(TAG) .
docker push zgsm/codebase-indexer:$(TAG)
.PHONY:lint
lint:
golangci-lint run ./...