1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2024-11-15 02:07:17 +00:00

Use pushd and popd instald of cding around

This commit is contained in:
Kristóf Tóth 2018-04-27 11:27:23 +02:00
parent 1f1a1149c6
commit adcdf74673

View File

@ -5,12 +5,17 @@ set -o errtrace
shopt -s expand_aliases shopt -s expand_aliases
[ "$(uname)" == "Darwin" ] && alias sed="gsed" || : [ "$(uname)" == "Darwin" ] && alias sed="gsed" || :
pushd() { command pushd "$@" > /dev/null; }
popd() { command popd "$@" > /dev/null; }
TFWDEV="${TFWDEV:-0}" TFWDEV="${TFWDEV:-0}"
TFW_POSTFIX=tutorial-framework TFW_POSTFIX=tutorial-framework
BASEIMAGE=baseimage-${TFW_POSTFIX} BASEIMAGE=baseimage-${TFW_POSTFIX}
TEST=test-${TFW_POSTFIX} TEST=test-${TFW_POSTFIX}
FRONTEND=frontend-${TFW_POSTFIX} FRONTEND=frontend-${TFW_POSTFIX}
LOGFILE=/tmp/bootstrap_tfw.log LOGFILE=/tmp/bootstrap_tfw.log
logged() { "$@" >> $LOGFILE 2>&1; }
run() run()
{ {
@ -39,18 +44,18 @@ err_cleanup() { rm -rf "$BASEIMAGE" "$FRONTEND" "$TEST"; }
clone_repos() clone_repos()
{ {
echo -n "Cloning TFW repositories... " echo -n "Cloning TFW repositories... "
echo -n "baseimage... " && git clone git@github.com:avatao-content/${BASEIMAGE}.git >> $LOGFILE 2>&1 echo -n "baseimage... " && logged git clone git@github.com:avatao-content/${BASEIMAGE}.git
echo -n "frontend... " && git clone git@github.com:avatao-content/${FRONTEND}.git >> $LOGFILE 2>&1 echo -n "frontend... " && logged git clone git@github.com:avatao-content/${FRONTEND}.git
echo -n "test... " && git clone git@github.com:avatao-content/${TEST}.git >> $LOGFILE 2>&1 echo -n "test... " && logged git clone git@github.com:avatao-content/${TEST}.git
echo "Done!" echo "Done!"
} }
install_frontend_deps() install_frontend_deps()
{ {
echo -n "Installing frontend dependencies... " echo -n "Installing frontend dependencies... "
cd "$FRONTEND" pushd "$FRONTEND"
yarn install >> $LOGFILE 2>&1 logged yarn install
cd .. popd
echo "Done!" echo "Done!"
} }
@ -65,10 +70,10 @@ pin_latest_baseimage()
build_latest_baseimage() build_latest_baseimage()
{ {
echo -n "Building baseimage at ${LATESTTAG}... " echo -n "Building baseimage at ${LATESTTAG}... "
cd "$BASEIMAGE" pushd "$BASEIMAGE"
git checkout "$LATESTTAG" >> $LOGFILE 2>&1 logged git checkout "$LATESTTAG"
cd .. popd
TFWTAG=$LATESTTAG ${TEST}/hack/tfw.sh buildtfw >> $LOGFILE 2>&1 TFWTAG=$LATESTTAG logged ${TEST}/hack/tfw.sh buildtfw
echo "Done!" echo "Done!"
} }