thread-master/apps/backend/Makefile

38 lines
1.2 KiB
Makefile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 只保留會重複打的指令;其餘直接 go / migrate。
.PHONY: build test test-integration gen-api tidy migrate-up migrate-down
build:
go build -o bin/gateway .
go build -o bin/worker ./cmd/worker
test:
go test ./...
# M1–M5 integration gates
test-integration:
go test ./internal/module/member/usecase/ ./internal/middleware/ \
./internal/module/threads/... ./internal/module/job/... ./internal/module/appnotif/... \
./internal/module/usage/... ./internal/module/ai/... ./internal/module/search/... \
./internal/module/permission/... ./internal/module/studio/... \
./internal/module/inspire/... ./internal/module/scout/... \
./internal/logic/extension/ ./internal/logic/media/ \
-count=1 -timeout 180s
# 改 generate/api/*.api 後執行;handler 勿手寫
gen-api:
goctl api go -api generate/api/gateway.api -dir . -style go_zero --home generate/goctl
tidy:
go mod tidy
# DB:檔案在 generate/database/mongo;需本機已裝 migrate(mongodb tag)
# 例:MONGO_URL=mongodb://127.0.0.1:27017/haixun
MONGO_URL ?= mongodb://127.0.0.1:27017/haixun
migrate-up:
migrate -path generate/database/mongo -database "$(MONGO_URL)" up
migrate-down:
migrate -path generate/database/mongo -database "$(MONGO_URL)" down 1