diff --git a/hack/bootstrap_tfw_dev.sh b/hack/bootstrap_tfw_dev.sh index e1bd99a..a3ed56a 100755 --- a/hack/bootstrap_tfw_dev.sh +++ b/hack/bootstrap_tfw_dev.sh @@ -27,13 +27,18 @@ run() check_dependencies clone_repos_ask_ssh_or_https - TAG="$(fetch_latest_tag)" + TAG="${BASEIMAGE_ONLY:-$(fetch_latest_tag)}" TAG=$TAG pin_latest_baseimage TAG=$TAG build_latest_baseimage - install_frontend_deps - if [ "$TFWDEV" == "0" ]; then - cleanup_repos - merge_repos + + if [ -z "${BASEIMAGE_ONLY:-}" ]; then + install_frontend_deps + if [ "$TFWDEV" == "0" ]; then + cleanup_repos + merge_repos + fi + else + delete_repos fi echo @@ -43,7 +48,7 @@ run() handle_exit() { if [[ $? -ne 0 ]]; then - err_cleanup + delete_repos showlog fi cleanlog @@ -51,7 +56,7 @@ handle_exit() showlog() { echo && echo "Error! Showing logs:" && cat $LOGFILE; } cleanlog() { rm $LOGFILE; } -err_cleanup() { cd "$BASEDIR" && rm -rf "$BASEIMAGE" "$FRONTEND" "$TEST"; } +delete_repos() { pushd "$BASEDIR" && rm -rf "$BASEIMAGE" "$FRONTEND" "$TEST" && popd; } check_dependencies() { @@ -122,7 +127,7 @@ fetch_latest_tag() pin_latest_baseimage() { - echo -n "Pinning latest TFW baseimage version... " + echo -n "Pinning TFW baseimage version... " echo -n "which is ${TAG}... " sed -i "1 s/.*/&:${TAG}/" "${TEST}/solvable/Dockerfile" echo "Done!"