fix: makefile
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
buildAt=`date +%Y/%m/%d-%H:%M:%S`
|
buildAt=`date +%Y/%m/%d-%H:%M:%S`
|
||||||
gitHash=`git rev-parse HEAD`
|
gitHash=`git rev-parse HEAD`
|
||||||
version=`git rev-parse --abbrev-ref HEAD | grep -v HEAD || git describe --exact-match HEAD || git rev-parse HEAD` ## todo: use current release git tag
|
version=`git rev-parse --abbrev-ref HEAD | grep -v HEAD || git describe --exact-match HEAD || git rev-parse HEAD` ## todo: use current release git tag
|
||||||
flags="-X 'atom/utils.Version=${version}' -X 'atom/utils.BuildAt=${buildAt}' -X 'atom/utils.GitHash=${gitHash}'"
|
flags="-X 'atom/utils.Version=${version}' -X 'atom/utils.BuildAt=${buildAt}' -X 'atom/utils.GitHash=${gitHash}'"
|
||||||
release_flags="-w -s ${flags}"
|
release_flags="-w -s ${flags}"
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ tidy:
|
|||||||
|
|
||||||
.PHONY: release
|
.PHONY: release
|
||||||
release:
|
release:
|
||||||
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags=${flags} -o bin/release/{{.ProjectName}} .
|
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags=${flags} -o bin/release/{{.ProjectName}} .
|
||||||
@cp config.toml bin/release/
|
@cp config.toml bin/release/
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
@@ -23,11 +23,20 @@ test:
|
|||||||
lint:
|
lint:
|
||||||
@golangci-lint run
|
@golangci-lint run
|
||||||
|
|
||||||
.PHONY: init
|
.PHONY: tools
|
||||||
init:
|
tools:
|
||||||
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway
|
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway
|
||||||
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2
|
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2
|
||||||
go install google.golang.org/protobuf/cmd/protoc-gen-go
|
go install google.golang.org/protobuf/cmd/protoc-gen-go
|
||||||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc
|
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc
|
||||||
go install github.com/bufbuild/buf/cmd/buf
|
go install github.com/bufbuild/buf/cmd/buf
|
||||||
go install github.com/golangci/golangci-lint/cmd/golangci-lint
|
go install github.com/golangci/golangci-lint/cmd/golangci-lint
|
||||||
|
|
||||||
|
.PHONY: init
|
||||||
|
init:
|
||||||
|
@atomctl swag init
|
||||||
|
@atomctl gen route
|
||||||
|
@atomctl gen enum
|
||||||
|
@atomctl gen provider
|
||||||
|
@buf generate
|
||||||
|
@go mod tidy
|
||||||
|
|||||||
Reference in New Issue
Block a user