Merge pull request #558 from MSFTserver/patch-2

better (build.sh)
This commit is contained in:
Alex Grin 2017-09-21 09:23:43 -04:00 committed by GitHub
commit 054a548fc4

View file

@ -1,7 +1,6 @@
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
set -x
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
cd "$ROOT" cd "$ROOT"
@ -10,9 +9,13 @@ BUILD_DIR="$ROOT/build"
LINUX=false LINUX=false
OSX=false OSX=false
if [ "$(uname)" == "Darwin" ]; then if [ "$(uname)" == "Darwin" ]; then
set -x
OSX=true OSX=true
set +x
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
set -x
LINUX=true LINUX=true
set +x
else else
echo -e "\033[1;31mPlatform detection failed\x1b[m" echo -e "\033[1;31mPlatform detection failed\x1b[m"
exit 1 exit 1
@ -23,14 +26,16 @@ if $OSX; then
else else
ICON="$BUILD_DIR/icons/48x48.png" ICON="$BUILD_DIR/icons/48x48.png"
fi fi
set -x
FULL_BUILD="${FULL_BUILD:-false}" FULL_BUILD="${FULL_BUILD:-false}"
set +x
if [ -n "${TEAMCITY_VERSION:-}" -o -n "${APPVEYOR:-}" ]; then if [ -n "${TEAMCITY_VERSION:-}" -o -n "${APPVEYOR:-}" ]; then
FULL_BUILD="true" FULL_BUILD="true"
fi fi
if [ "$FULL_BUILD" == "true" ]; then if [ "$FULL_BUILD" == "true" ]; then
# install dependencies # install dependencies
echo -e "\033[0;32mInstalling Dependencies\x1b[m"
$BUILD_DIR/prebuild.sh $BUILD_DIR/prebuild.sh
VENV="$BUILD_DIR/venv" VENV="$BUILD_DIR/venv"
@ -57,7 +62,7 @@ yarn install
############ ############
# UI # # UI #
############ ############
echo -e "\033[0;32mCompiling UI\x1b[m"
( (
cd "$ROOT/ui" cd "$ROOT/ui"
yarn install yarn install
@ -73,7 +78,7 @@ yarn install
#################### ####################
# daemon and cli # # daemon and cli #
#################### ####################
echo -e "\033[0;32mGrabbing Daemon and CLI\x1b[m"
if $OSX; then if $OSX; then
OSNAME="macos" OSNAME="macos"
else else
@ -99,7 +104,7 @@ fi
################### ###################
# Build the app # # Build the app #
################### ###################
echo -e '\033[0;32mBuilding Lbry-app\x1b[m'
( (
cd "$ROOT/app" cd "$ROOT/app"
yarn install yarn install