Adjust build scripts
parent
13527bda06
commit
8f8ade727c
|
@ -9,7 +9,7 @@ RUN apt-get update && \
|
||||||
liblz4-dev graphviz && \
|
liblz4-dev graphviz && \
|
||||||
apt-get clean
|
apt-get clean
|
||||||
|
|
||||||
ENV GOLANG_VERSION=go1.12.4.linux-amd64
|
ENV GOLANG_VERSION=go1.13.8.linux-amd64
|
||||||
ENV ROCKSDB_VERSION=v5.18.3
|
ENV ROCKSDB_VERSION=v5.18.3
|
||||||
ENV GOPATH=/go
|
ENV GOPATH=/go
|
||||||
ENV PATH=$PATH:$GOPATH/bin
|
ENV PATH=$PATH:$GOPATH/bin
|
||||||
|
@ -33,17 +33,17 @@ RUN strip /opt/rocksdb/ldb /opt/rocksdb/sst_dump && \
|
||||||
cp /opt/rocksdb/ldb /opt/rocksdb/sst_dump /build
|
cp /opt/rocksdb/ldb /opt/rocksdb/sst_dump /build
|
||||||
|
|
||||||
# install build tools
|
# install build tools
|
||||||
RUN go get github.com/golang/dep/cmd/dep
|
|
||||||
RUN go get github.com/gobuffalo/packr/...
|
RUN go get github.com/gobuffalo/packr/...
|
||||||
|
|
||||||
# download pre-loaded depencencies
|
# download pre-loaded depencencies
|
||||||
RUN \
|
RUN \
|
||||||
cleanup() { rm -rf $GOPATH/src/blockbook; } && \
|
cleanup() { rm -rf $GOPATH/src/github.com/trezor ; } && \
|
||||||
trap cleanup EXIT && \
|
trap cleanup EXIT && \
|
||||||
cd $GOPATH/src && \
|
mkdir -p $GOPATH/src/github.com/trezor && \
|
||||||
|
cd $GOPATH/src/github.com/trezor && \
|
||||||
git clone https://github.com/trezor/blockbook.git && \
|
git clone https://github.com/trezor/blockbook.git && \
|
||||||
cd blockbook && \
|
cd blockbook && \
|
||||||
dep ensure -vendor-only && \
|
env GO111MODULE=on go mod vendor && \
|
||||||
cp -r vendor /build/vendor
|
cp -r vendor /build/vendor
|
||||||
|
|
||||||
ADD Makefile /build/Makefile
|
ADD Makefile /build/Makefile
|
||||||
|
|
|
@ -3,8 +3,8 @@ UPDATE_VENDOR ?= 1
|
||||||
VERSION ?= devel
|
VERSION ?= devel
|
||||||
GITCOMMIT = $(shell cd /src && git describe --always --dirty)
|
GITCOMMIT = $(shell cd /src && git describe --always --dirty)
|
||||||
BUILDTIME = $(shell date --iso-8601=seconds)
|
BUILDTIME = $(shell date --iso-8601=seconds)
|
||||||
LDFLAGS := -X blockbook/common.version=$(VERSION) -X blockbook/common.gitcommit=$(GITCOMMIT) -X blockbook/common.buildtime=$(BUILDTIME)
|
LDFLAGS := -X github.com/trezor/blockbook/common.version=$(VERSION) -X github.com/trezor/blockbook/common.gitcommit=$(GITCOMMIT) -X github.com/trezor/blockbook/common.buildtime=$(BUILDTIME)
|
||||||
BLOCKBOOK_SRC := $(GOPATH)/src/blockbook
|
BLOCKBOOK_SRC := $(GOPATH)/src/github.com/trezor/blockbook
|
||||||
ARGS ?=
|
ARGS ?=
|
||||||
|
|
||||||
all: build tools
|
all: build tools
|
||||||
|
@ -24,13 +24,13 @@ tools:
|
||||||
chown $(PACKAGER) /out/{ldb,sst_dump}
|
chown $(PACKAGER) /out/{ldb,sst_dump}
|
||||||
|
|
||||||
test: prepare-sources generate-data
|
test: prepare-sources generate-data
|
||||||
cd $(BLOCKBOOK_SRC) && go test -tags unittest `go list ./... | grep -vP '^blockbook/(contrib|tests)'` $(ARGS)
|
cd $(BLOCKBOOK_SRC) && go test -tags unittest `go list ./... | grep -vP '^github.com/trezor/blockbook/(contrib|tests)'` $(ARGS)
|
||||||
|
|
||||||
test-integration: prepare-sources generate-data
|
test-integration: prepare-sources generate-data
|
||||||
cd $(BLOCKBOOK_SRC) && go test -tags integration `go list blockbook/tests/...` $(ARGS)
|
cd $(BLOCKBOOK_SRC) && go test -tags integration `go list blockbook/tests/...` $(ARGS)
|
||||||
|
|
||||||
test-all: prepare-sources generate-data
|
test-all: prepare-sources generate-data
|
||||||
cd $(BLOCKBOOK_SRC) && go test -tags 'unittest integration' `go list ./... | grep -v '^blockbook/contrib'` $(ARGS)
|
cd $(BLOCKBOOK_SRC) && go test -tags 'unittest integration' `go list ./... | grep -v '^github.com/trezor/blockbook/contrib'` $(ARGS)
|
||||||
|
|
||||||
prepare-sources:
|
prepare-sources:
|
||||||
@ [ -n "`ls /src 2> /dev/null`" ] || (echo "/src doesn't exist or is empty" 1>&2 && exit 1)
|
@ [ -n "`ls /src 2> /dev/null`" ] || (echo "/src doesn't exist or is empty" 1>&2 && exit 1)
|
||||||
|
@ -41,7 +41,7 @@ prepare-sources:
|
||||||
prepare-vendor:
|
prepare-vendor:
|
||||||
@ if [ "$(UPDATE_VENDOR)" -eq 1 ]; then \
|
@ if [ "$(UPDATE_VENDOR)" -eq 1 ]; then \
|
||||||
echo "Updating vendor"; \
|
echo "Updating vendor"; \
|
||||||
cd $(BLOCKBOOK_SRC) && rm -rf vendor* && cp -r /build/vendor . && dep ensure -vendor-only ; \
|
cd $(BLOCKBOOK_SRC) && rm -rf vendor* && cp -r /build/vendor . && env GO111MODULE=on go mod vendor ; \
|
||||||
else \
|
else \
|
||||||
echo "Update of vendor not demanded, keeping version from src" ; \
|
echo "Update of vendor not demanded, keeping version from src" ; \
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -15,7 +15,7 @@ mkdir -p build
|
||||||
cp -r /src/build/templates build
|
cp -r /src/build/templates build
|
||||||
cp -r /src/build/scripts build
|
cp -r /src/build/scripts build
|
||||||
cp -r /src/configs .
|
cp -r /src/configs .
|
||||||
mkdir -p /go/src/blockbook/build && cp -r /src/build/tools /go/src/blockbook/build/tools
|
mkdir -p /go/src/github.com/trezor/blockbook/build && cp -r /src/build/tools /go/src/github.com/trezor/blockbook/build/tools
|
||||||
go run build/templates/generate.go $coin
|
go run build/templates/generate.go $coin
|
||||||
|
|
||||||
# backend
|
# backend
|
||||||
|
|
Loading…
Reference in New Issue