mirror of
https://github.com/avatao-content/test-tutorial-framework
synced 2024-11-14 17:57:17 +00:00
Use pushd and popd instald of cding around
This commit is contained in:
parent
1f1a1149c6
commit
adcdf74673
@ -5,12 +5,17 @@ set -o errtrace
|
||||
shopt -s expand_aliases
|
||||
[ "$(uname)" == "Darwin" ] && alias sed="gsed" || :
|
||||
|
||||
pushd() { command pushd "$@" > /dev/null; }
|
||||
popd() { command popd "$@" > /dev/null; }
|
||||
|
||||
TFWDEV="${TFWDEV:-0}"
|
||||
TFW_POSTFIX=tutorial-framework
|
||||
BASEIMAGE=baseimage-${TFW_POSTFIX}
|
||||
TEST=test-${TFW_POSTFIX}
|
||||
FRONTEND=frontend-${TFW_POSTFIX}
|
||||
|
||||
LOGFILE=/tmp/bootstrap_tfw.log
|
||||
logged() { "$@" >> $LOGFILE 2>&1; }
|
||||
|
||||
run()
|
||||
{
|
||||
@ -39,18 +44,18 @@ err_cleanup() { rm -rf "$BASEIMAGE" "$FRONTEND" "$TEST"; }
|
||||
clone_repos()
|
||||
{
|
||||
echo -n "Cloning TFW repositories... "
|
||||
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/${TEST}.git >> $LOGFILE 2>&1
|
||||
echo -n "baseimage... " && logged git clone git@github.com:avatao-content/${BASEIMAGE}.git
|
||||
echo -n "frontend... " && logged git clone git@github.com:avatao-content/${FRONTEND}.git
|
||||
echo -n "test... " && logged git clone git@github.com:avatao-content/${TEST}.git
|
||||
echo "Done!"
|
||||
}
|
||||
|
||||
install_frontend_deps()
|
||||
{
|
||||
echo -n "Installing frontend dependencies... "
|
||||
cd "$FRONTEND"
|
||||
yarn install >> $LOGFILE 2>&1
|
||||
cd ..
|
||||
pushd "$FRONTEND"
|
||||
logged yarn install
|
||||
popd
|
||||
echo "Done!"
|
||||
}
|
||||
|
||||
@ -65,10 +70,10 @@ pin_latest_baseimage()
|
||||
build_latest_baseimage()
|
||||
{
|
||||
echo -n "Building baseimage at ${LATESTTAG}... "
|
||||
cd "$BASEIMAGE"
|
||||
git checkout "$LATESTTAG" >> $LOGFILE 2>&1
|
||||
cd ..
|
||||
TFWTAG=$LATESTTAG ${TEST}/hack/tfw.sh buildtfw >> $LOGFILE 2>&1
|
||||
pushd "$BASEIMAGE"
|
||||
logged git checkout "$LATESTTAG"
|
||||
popd
|
||||
TFWTAG=$LATESTTAG logged ${TEST}/hack/tfw.sh buildtfw
|
||||
echo "Done!"
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user