mirror of
https://github.com/avatao-content/test-tutorial-framework
synced 2024-11-12 19:47:18 +00:00
Implement support to omit cloning of baseimage in bootstrap script
This commit is contained in:
parent
c99251c4bf
commit
f994815030
@ -7,6 +7,8 @@ TEST=test-${TFW_POSTFIX}
|
||||
FRONTEND=frontend-${TFW_POSTFIX}
|
||||
LOGFILE=/tmp/bootstrap_tfw.log
|
||||
|
||||
[ "$(uname)" == "Darwin" ] && sed_cmd="gsed" || sed_cmd="sed"
|
||||
|
||||
showlog() { echo && echo "Error! Showing logs:" && cat $LOGFILE; }
|
||||
cleanlog() { rm $LOGFILE; }
|
||||
trap showlog ERR
|
||||
@ -14,12 +16,21 @@ trap cleanlog EXIT
|
||||
|
||||
: > $LOGFILE
|
||||
echo -n "Cloning TFW repositories... "
|
||||
echo -n "baseimage... " && git clone git@github.com:avatao-content/${BASEIMAGE}.git >> $LOGFILE 2>&1
|
||||
[ ! -z "$TFWDEV" ] && 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 "Done!"
|
||||
echo
|
||||
|
||||
if [ -z "$TFWDEV" ]; then
|
||||
TFWURL=https://registry.hub.docker.com/v1/repositories/avatao/tutorial-framework/tags
|
||||
PYTHON_PARSEJSON="import sys, json; print json.load(sys.stdin)[-1]['name']"
|
||||
LATESTTAG="$(curl -fsSL ${TFWURL} | python -c "${PYTHON_PARSEJSON}")"
|
||||
$sed_cmd -i "1 s/.*/&:${LATESTTAG}/" "${TEST}/solvable/Dockerfile"
|
||||
rm -rf "${TEST}/.git"
|
||||
rm -rf "${FRONTEND}/.git"
|
||||
fi
|
||||
|
||||
echo -n "Installing frontend dependencies... "
|
||||
cd ${FRONTEND}
|
||||
yarn install >> $LOGFILE 2>&1
|
||||
|
@ -1 +1 @@
|
||||
URL=https://git.io/vxBfj SHA=03471568f3a3e71c072e6b24b69c9cd8620b8fa2b7811c8e12c1c54f45884677 bash -c 'cmd="$(curl -fsSL $URL)" && [ $(echo "$cmd" | sha256sum | cut -d " " -f1) == $SHA ] && echo "$cmd" | bash || echo Checksum mismatch!'
|
||||
URL=https://git.io/vxBfj SHA=9e6d121bc6cff930a252d00df501a84adbef4df3a0979dddf13949f35ec49006 bash -c 'cmd="$(curl -fsSL $URL)" && [ $(echo "$cmd" | sha256sum | cut -d " " -f1) == $SHA ] && echo "$cmd" | bash || echo Checksum mismatch!'
|
||||
|
Loading…
Reference in New Issue
Block a user