rework docker build script

This commit is contained in:
Pavol Rusnak 2014-12-27 16:33:44 +01:00
parent b5eecb30be
commit 62ce3c6988
2 changed files with 12 additions and 8 deletions

View File

@ -13,14 +13,9 @@ RUN apt-get install -y build-essential git gcc-arm-none-eabi=$GCC_ARM_VERSION py
# clone the source code
RUN git clone https://github.com/libopencm3/libopencm3 && git clone https://github.com/trezor/trezor-mcu
RUN git clone https://github.com/libopencm3/libopencm3
# build libopencm3
ENV LIBOPENCM3_GITREV 8a15cec6bf99f59065879a14895fb8af8a8a53e7
RUN cd libopencm3 && git checkout $LIBOPENCM3_GITREV && make
# build the firmware
ENV TREZOR_MCU_GITREV v1.3.0
RUN cd trezor-mcu && git checkout $TREZOR_MCU_GITREV && git submodule update --init && make && cd firmware && make

View File

@ -1,9 +1,18 @@
#!/bin/bash
IMAGETAG=trezor-mcu-build
FIRMWARETAG=v1.3.0
docker rmi $IMAGETAG || :
docker build -t $IMAGETAG .
docker run -t -v $(pwd):/output $IMAGETAG /bin/cp /trezor-mcu/firmware/trezor.bin /output
docker run -t -v $(pwd):/output $IMAGETAG /bin/sh -c "\
git clone https://github.com/trezor/trezor-mcu && \
cd trezor-mcu && \
git checkout $FIRMWARETAG && \
git submodule update --init && \
make && \
cd firmware && \
make && \
cp trezor.bin /output \
"
echo "---------------------"
echo "Firmware fingerprint:"