Dependencies (vendor) are pre-loaded in build image

This commit is contained in:
Jakub Matys 2018-10-10 14:28:17 +02:00
parent f579b97502
commit 56302a5d47
2 changed files with 11 additions and 2 deletions

View File

@ -34,6 +34,15 @@ RUN strip /opt/rocksdb/ldb /opt/rocksdb/sst_dump && \
RUN go get github.com/golang/dep/cmd/dep RUN go get github.com/golang/dep/cmd/dep
RUN \
cleanup() { rm -rf $GOPATH/src/blockbook; } && \
trap cleanup EXIT && \
cd $GOPATH/src && \
git clone https://github.com/trezor/blockbook.git && \
cd blockbook && \
dep ensure -vendor-only && \
cp -r vendor /build/vendor
ADD Makefile /build/Makefile ADD Makefile /build/Makefile
VOLUME /out VOLUME /out

View File

@ -42,7 +42,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?* && dep ensure -vendor-only ; \ cd $(BLOCKBOOK_SRC) && rm -rf vendor* && cp -r /build/vendor . && dep ensure -vendor-only ; \
else \ else \
echo "Update of vendor not demanded, keeping version from src" ; \ echo "Update of vendor not demanded, keeping version from src" ; \
fi fi