Files
backend_v2/Makefile
toom1996 30c9f21da4 update
2026-08-26 10:45:21 +08:00

31 lines
586 B
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.

.PHONY: build run migrate test tidy docker clean
# 编译 server 与 migrate 两个二进制到 bin/
build:
go build -o bin/server ./cmd/server
go build -o bin/migrate ./cmd/migrate
# 构建并启动 API 服务(默认读取 configs/config.yml)
run: build
./bin/server
# 执行一次结构迁移
migrate: build
./bin/migrate
# 跑单测
test:
go test ./...
# 整理依赖(需联网拉取测试依赖,离线环境慎用)
tidy:
go mod tidy
# 构建镜像
docker:
docker build -t fashionapi .
# 清理产物
clean:
rm -rf bin server server.exe migrate migrate.exe