2018-03-23 20:40:24 +00:00
|
|
|
#!/usr/bin/env bash
|
2018-03-23 20:39:39 +00:00
|
|
|
set -eo pipefail
|
2018-03-23 16:58:24 +00:00
|
|
|
|
2018-03-24 10:47:38 +00:00
|
|
|
TFW_POSTFIX=tutorial-framework
|
|
|
|
BASEIMAGE=baseimage-${TFW_POSTFIX}
|
|
|
|
BACKEND=test-${TFW_POSTFIX}
|
|
|
|
FRONTEND=frontend-${TFW_POSTFIX}
|
|
|
|
LOGFILE=/tmp/bootstrap_tfw.log
|
2018-03-24 11:18:59 +00:00
|
|
|
|
|
|
|
showlog() { echo && echo "Error! Showing logs:" && cat $LOGFILE; }
|
|
|
|
cleanlog() { rm $LOGFILE; }
|
|
|
|
trap showlog ERR
|
|
|
|
trap cleanlog EXIT
|
2018-03-23 16:58:24 +00:00
|
|
|
|
2018-03-24 10:48:54 +00:00
|
|
|
: > $LOGFILE
|
2018-03-23 22:09:39 +00:00
|
|
|
echo -n "Cloning TFW repositories... "
|
2018-03-24 10:47:38 +00:00
|
|
|
echo -n "baseimage... " && git clone git@github.com:avatao-content/${BASEIMAGE}.git >> $LOGFILE 2>&1
|
|
|
|
echo -n "frontend... " && git clone git@github.com:avatao-content/${FRONTEND}.git >> $LOGFILE 2>&1
|
|
|
|
echo -n "test... " && git clone git@github.com:avatao-content/${BACKEND}.git >> $LOGFILE 2>&1
|
2018-03-23 22:09:39 +00:00
|
|
|
echo "Done!"
|
|
|
|
echo
|
2018-03-23 16:58:24 +00:00
|
|
|
|
2018-03-27 13:44:08 +00:00
|
|
|
echo -n "Installing frontend dependencies... "
|
|
|
|
cd ${FRONTEND}
|
2018-03-23 16:58:24 +00:00
|
|
|
yarn install >> $LOGFILE 2>&1
|
|
|
|
|
2018-03-23 17:07:40 +00:00
|
|
|
wait
|
2018-03-23 22:09:39 +00:00
|
|
|
echo "Done!"
|
2018-03-24 11:01:37 +00:00
|
|
|
echo
|
2018-03-27 13:44:08 +00:00
|
|
|
echo "You can build & start TFW by executing the ${BACKEND}/hack/tfw_magic_start.sh script."
|