1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-16 05:19:12 +00:00
trezor-wallet/scripts/docker-build.sh
2018-10-24 23:35:48 +02:00

19 lines
715 B
Bash
Executable File

#!/bin/bash
cd "$(dirname "$0")"
if [[ "$1" == "dev" || "$1" == "beta" || "$1" == "stable" ]]
then
mkdir -p ../build
rm -rf ../build/$1
docker ps -q --filter "name=trezor-wallet" | grep -q . && docker stop trezor-wallet && docker rm -fv trezor-wallet
docker build -t trezor-wallet ../ --build-arg BUILD_TYPE=$1
docker run -p 8080:8080 -d --name trezor-wallet trezor-wallet:latest
docker cp trezor-wallet:/trezor-wallet-app/build/$1 ../build/$1
docker stop trezor-wallet
docker rm trezor-wallet
echo "DONE!"
echo "Build directory: build/"$1
else
echo "invalid parameters... valid parameters are (dev, beta, stable)"
fi