代码拉取完成,页面将自动刷新
同步操作将从 gzydong/go-chat 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
PROTO_FILES := $(shell find api -iname *.proto)
.PHONY: install
install:
go install github.com/google/wire/cmd/wire@latest \
&& go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest \
&& go install google.golang.org/protobuf/cmd/protoc-gen-go@latest \
&& go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest \
&& go install github.com/envoyproxy/protoc-gen-validate@latest \
&& go install github.com/srikrsna/protoc-gen-gotag@latest \
.PHONY: conf
conf:
cp config.example.yaml config.yaml
.PHONY: generate
generate:
go generate ./...
lint:
golangci-lint run --timeout=5m --config ./.golangci.yml
test:
go test -v ./...
http: generate
go run ./cmd/lumenim http
commet: generate
go run ./cmd/lumenim commet
migrate:
go run ./cmd/lumenim migrate
.PHONY: build
build:generate
go build -o ./bin/lumenim ./cmd/lumenim
.PHONY: build-all
build-all:generate lint
# 构建 windows
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ./bin/lumenim ./cmd/lumenim
cp ./config.example.yaml ./build/windows/config.yaml
# 构建 linux
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./bin/lumenim ./cmd/lumenim
cp ./config.example.yaml ./build/linux/config.yaml
# 构建 mac amd
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ./bin/lumenim ./cmd/lumenim
cp ./config.example.yaml ./build/mac/config.yaml
# 构建 mac m1
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o ./bin/lumenim ./cmd/lumenim
cp ./config.example.yaml ./build/macm1/config.yaml
.PHONY: proto
proto:
@if [ -n "$(PROTO_FILES)" ]; then \
protoc --proto_path=./api/proto \
--proto_path=./third_party \
--go_out=paths=source_relative:./api/pb/ \
--validate_out=paths=source_relative,lang=go:./api/pb/ $(PROTO_FILES) \
&& protoc --proto_path=./third_party --proto_path=./api/proto --gotag_out=outdir="./api/pb/":./ $(PROTO_FILES) \
&& echo "protoc generate success"; \
fi
.PHONY: deploy
deploy:
git reset --hard origin/develop && git pull && make build && supervisorctl reload
#--go-grpc_out=paths=source_relative:./api/pb/ \
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。