From 2865c9853cabec72029b7788f7c83a6bf61300bd Mon Sep 17 00:00:00 2001 From: Yura Pakhuchiy Date: Mon, 2 Jul 2018 01:17:20 +0700 Subject: [PATCH] Docker: support local build and build from other gh repos Similar to recent trezor-mcu changes --- build-docker.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/build-docker.sh b/build-docker.sh index 1219d76ed4..decafdf479 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -3,11 +3,18 @@ set -e IMAGE=trezor-core-build TAG=${1:-master} +REPOSITORY=${2:-trezor} + +if [ "$REPOSITORY" = "local" ]; then + REPOSITORY=file:///local/ +else + REPOSITORY=https://github.com/$REPOSITORY/trezor-core.git +fi docker build -t $IMAGE . -docker run -t -v $(pwd)/build-docker:/build:z $IMAGE /bin/sh -c "\ - git clone https://github.com/trezor/trezor-core && \ +docker run -t -v $(pwd):/local -v $(pwd)/build-docker:/build:z $IMAGE /bin/sh -c "\ + git clone $REPOSITORY trezor-core && \ cd trezor-core && \ ln -s /build build && git checkout $TAG && \