Makefile 1.2 KB
Newer Older
U
UlricQin 已提交
1 2 3 4
.PHONY: start build

NOW = $(shell date -u '+%Y%m%d%I%M%S')

U
Ulric Qin 已提交
5
RELEASE_VERSION = 5.9.3
U
UlricQin 已提交
6 7

APP 			= n9e
U
UlricQin 已提交
8
SERVER_BIN  	= $(APP)
U
UlricQin 已提交
9 10 11 12 13 14 15 16 17
# RELEASE_ROOT 	= release
# RELEASE_SERVER 	= release/${APP}
# GIT_COUNT 		= $(shell git rev-list --all --count)
# GIT_HASH        = $(shell git rev-parse --short HEAD)
# RELEASE_TAG     = $(RELEASE_VERSION).$(GIT_COUNT).$(GIT_HASH)

all: build

build:
18
	go build -ldflags "-w -s -X github.com/didi/nightingale/v5/src/pkg/version.VERSION=$(RELEASE_VERSION)" -o $(SERVER_BIN) ./src
U
UlricQin 已提交
19 20 21

# start:
# 	@go run -ldflags "-X main.VERSION=$(RELEASE_TAG)" ./cmd/${APP}/main.go web -c ./configs/config.toml -m ./configs/model.conf --menu ./configs/menu.yaml
U
Ulric Qin 已提交
22 23 24 25 26
run_webapi:
	nohup ./n9e webapi > webapi.log 2>&1 &

run_server:
	nohup ./n9e server > server.log 2>&1 &
U
UlricQin 已提交
27 28 29 30 31 32 33 34 35 36 37 38 39

# swagger:
# 	@swag init --parseDependency --generalInfo ./cmd/${APP}/main.go --output ./internal/app/swagger

# wire:
# 	@wire gen ./internal/app

# test:
# 	cd ./internal/app/test && go test -v

# clean:
# 	rm -rf data release $(SERVER_BIN) internal/app/test/data cmd/${APP}/data

U
UlricQin 已提交
40 41
pack: build
	rm -rf $(APP)-$(RELEASE_VERSION).tar.gz
U
UlricQin 已提交
42
	tar -zcvf $(APP)-$(RELEASE_VERSION).tar.gz docker etc $(SERVER_BIN) pub/font pub/index.html pub/assets pub/image