diff --git a/.gitignore b/.gitignore index c318d94..133af2e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ __debug_bin .vscode .idea tmp/ -docker-compose.yml \ No newline at end of file +docker-compose.yml +atom \ No newline at end of file diff --git a/Makefile b/Makefile index d19ad28..d2297c9 100644 --- a/Makefile +++ b/Makefile @@ -1,36 +1,19 @@ buildAt=`date +%Y/%m/%d-%H:%M:%S` 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 -flags="-X 'app/utils.Version=${version}' -X 'app/utils.BuildAt=${buildAt}' -X 'app/utils.GitHash=${gitHash}'" +flags="-X 'atom/utils.Version=${version}' -X 'atom/utils.BuildAt=${buildAt}' -X 'atom/utils.GitHash=${gitHash}'" GOPATH:=$(shell go env GOPATH) -.PHONY: init -init: - @go get -u google.golang.org/protobuf/proto - @go install github.com/golang/protobuf/protoc-gen-go@latest - @go install github.com/go-micro/generator/cmd/protoc-gen-micro@latest - -.PHONY: proto -proto: - @protoc --proto_path=. --micro_out=. --go_out=:. proto/web_api.proto - -.PHONY: update -update: - @go get -u - .PHONY: tidy tidy: @go mod tidy -.PHONY: build -build: - @go build -ldflags=${flags} +.PHONY: dist +dist: + @go build -ldflags=${flags} -o bin/atom + @cp config.toml bin/ .PHONY: test test: - @go test -v ./... -cover - -.PHONY: docker -docker: - @docker build -t web_api:latest . \ No newline at end of file + @go test -v ./... -cover \ No newline at end of file diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file