Merge pull request #323 from nspcc-dev/make-config-fixes
Make & config fixes
This commit is contained in:
commit
27558c89f7
3 changed files with 5 additions and 11 deletions
|
@ -15,10 +15,9 @@ ARG VERSION=dev
|
||||||
# https://github.com/golang/go/wiki/Modules#how-do-i-use-vendoring-with-modules-is-vendoring-going-away
|
# https://github.com/golang/go/wiki/Modules#how-do-i-use-vendoring-with-modules-is-vendoring-going-away
|
||||||
# go build -mod=vendor
|
# go build -mod=vendor
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& export BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
|
||||||
&& export GOGC=off \
|
&& export GOGC=off \
|
||||||
&& export CGO_ENABLED=0 \
|
&& export CGO_ENABLED=0 \
|
||||||
&& export LDFLAGS="-X ${REPO}/config.Version=${VERSION} -X ${REPO}/config.BuildTime=${BUILD_TIME}" \
|
&& export LDFLAGS="-X ${REPO}/config.Version=${VERSION}" \
|
||||||
&& go build -v -mod=vendor -ldflags "${LDFLAGS}" -o /go/bin/node ./cli/main.go
|
&& go build -v -mod=vendor -ldflags "${LDFLAGS}" -o /go/bin/node ./cli/main.go
|
||||||
|
|
||||||
# Executable image
|
# Executable image
|
||||||
|
|
9
Makefile
9
Makefile
|
@ -1,19 +1,18 @@
|
||||||
BRANCH = "master"
|
BRANCH = "master"
|
||||||
BUILD_TIME = "$(shell date -u +\"%Y-%m-%dT%H:%M:%SZ\")"
|
|
||||||
REPONAME = "neo-go"
|
REPONAME = "neo-go"
|
||||||
NETMODE ?= "privnet"
|
NETMODE ?= "privnet"
|
||||||
|
BINARY = "./bin/neo-go"
|
||||||
|
|
||||||
REPO ?= "$(shell go list -m)"
|
REPO ?= "$(shell go list -m)"
|
||||||
VERSION ?= "$(shell git describe --tags 2>/dev/null | sed 's/^v//')"
|
VERSION ?= "$(shell git describe --tags 2>/dev/null | sed 's/^v//')"
|
||||||
BUILD_FLAGS = "-X $(REPO)/config.Version=$(VERSION) -X $(REPO)/config.BuildTime=$(BUILD_TIME)"
|
BUILD_FLAGS = "-X $(REPO)/config.Version=$(VERSION)"
|
||||||
|
|
||||||
build: deps
|
build: deps
|
||||||
@echo "=> Building binary"
|
@echo "=> Building binary"
|
||||||
@set -x \
|
@set -x \
|
||||||
&& export GOGC=off \
|
&& export GOGC=off \
|
||||||
&& export CGO_ENABLED=0 \
|
&& export CGO_ENABLED=0 \
|
||||||
&& echo $(VERSION)-$(BUILD_TIME) \
|
&& go build -v -mod=vendor -ldflags $(BUILD_FLAGS) -o ${BINARY} ./cli/main.go
|
||||||
&& go build -v -mod=vendor -ldflags $(BUILD_FLAGS) -o ./bin/node ./cli/main.go
|
|
||||||
|
|
||||||
image: deps
|
image: deps
|
||||||
@echo "=> Building image"
|
@echo "=> Building image"
|
||||||
|
@ -46,7 +45,7 @@ push-to-registry:
|
||||||
@docker push CityOfZion/${REPONAME}
|
@docker push CityOfZion/${REPONAME}
|
||||||
|
|
||||||
run: build
|
run: build
|
||||||
./bin/neo-go node -config-path ./config -${NETMODE}
|
${BINARY} node -config-path ./config -${NETMODE}
|
||||||
|
|
||||||
run-cluster: build-linux
|
run-cluster: build-linux
|
||||||
@echo "=> Starting docker-compose cluster"
|
@echo "=> Starting docker-compose cluster"
|
||||||
|
|
|
@ -25,10 +25,6 @@ const (
|
||||||
var (
|
var (
|
||||||
// Version the version of the node, set at build time.
|
// Version the version of the node, set at build time.
|
||||||
Version string
|
Version string
|
||||||
|
|
||||||
// BuildTime the time and date the current version of the node built,
|
|
||||||
// set at build time.
|
|
||||||
BuildTime string
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
|
Loading…
Reference in a new issue