1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00
trezor-firmware/build-docker.sh
Yura Pakhuchiy 2865c9853c Docker: support local build and build from other gh repos
Similar to recent trezor-mcu changes
2018-07-01 20:35:22 +02:00

23 lines
567 B
Bash
Executable File

#!/bin/bash
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):/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 && \
git submodule update --init --recursive && \
make clean vendor build_boardloader build_bootloader build_prodtest build_firmware"