From d29ce97bcb0c9747d2e76274bc897b4854a41385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Wed, 7 Aug 2019 16:21:43 -0400 Subject: [PATCH] improve build.sh script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- build.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index af55a57..cf64466 100755 --- a/build.sh +++ b/build.sh @@ -1,14 +1,23 @@ #!/usr/bin/env bash -if [[ "${NODE_ENV}" != "production" ]]; then +if [[ "${NODE_ENV}" == "production" ]]; then + export EMBARK_TARGET=livenet + if [[ -z "${WALLET_MNEMONIC}" ]]; then echo "Not defined: WALLET_MNEMONIC"; exit 1; fi + if [[ -z "${WALLET_PASSWORD}" ]]; then echo "Not defined: WALLET_PASSWORD"; exit 1; fi +elif [[ "${NODE_ENV}" == "development" ]]; then + export EMBARK_TARGET=testnet export WALLET_MNEMONIC='erupt point century seek certain escape solution flee elegant hard please pen' export WALLET_PASSWORD='dev_password' +else + echo "Unknown NODE_ENV value: ${NODE_ENV}" + echo "Use 'production' or 'development'." + exit 1 fi echo "removing old full-build" rm -rf full-build app.zip echo "compiling contracts" -./node_modules/.bin/embark build +./node_modules/.bin/embark build "${EMBARK_TARGET}" echo "creating new full-build" mkdir full-build cp -r back-end/* full-build/