2018-10-02 13:43:03 +00:00
|
|
|
#!/bin/bash
|
2018-10-02 13:48:51 +00:00
|
|
|
|
|
|
|
cd "$(dirname "$0")"
|
2018-10-24 15:18:28 +00:00
|
|
|
|
2018-10-24 21:01:23 +00:00
|
|
|
if [[ "$1" == "dev" || "$1" == "beta" || "$1" == "stable" ]]
|
2018-10-24 15:18:28 +00:00
|
|
|
then
|
2018-10-24 16:47:04 +00:00
|
|
|
mkdir -p ../build
|
2018-10-24 15:31:49 +00:00
|
|
|
rm -rf ../build/$1
|
|
|
|
docker ps -q --filter "name=trezor-wallet" | grep -q . && docker stop trezor-wallet && docker rm -fv trezor-wallet
|
2018-10-24 15:18:28 +00:00
|
|
|
docker build -t trezor-wallet ../ --build-arg BUILD_TYPE=$1
|
|
|
|
docker run -p 8080:8080 -d --name trezor-wallet trezor-wallet:latest
|
2018-10-24 16:38:39 +00:00
|
|
|
docker cp trezor-wallet:/trezor-wallet-app/build/$1 ../build/$1
|
2018-10-24 15:18:28 +00:00
|
|
|
docker stop trezor-wallet
|
|
|
|
docker rm trezor-wallet
|
2018-10-24 21:01:23 +00:00
|
|
|
echo "DONE!"
|
2018-10-24 21:35:48 +00:00
|
|
|
echo "Build directory: build/"$1
|
2018-10-24 15:18:28 +00:00
|
|
|
else
|
2018-10-24 21:01:23 +00:00
|
|
|
echo "invalid parameters... valid parameters are (dev, beta, stable)"
|
2018-10-24 15:18:28 +00:00
|
|
|
fi
|