mirror of
https://github.com/avatao-content/test-tutorial-framework
synced 2025-07-03 02:26:23 +00:00
Improve tfw.sh (refactor & new baseimage compliance)
This commit is contained in:
23
hack/tfw.sh
23
hack/tfw.sh
@ -21,9 +21,21 @@ source "${SCRIPT_DIR}/libhack/challenge.sh"
|
||||
source "${SCRIPT_DIR}/libhack/frontend.sh"
|
||||
|
||||
|
||||
build_baseimage() {
|
||||
frontend_version="$(frontend::latest_tag)"
|
||||
baseimage::build
|
||||
}
|
||||
|
||||
|
||||
try_build_baseimage() {
|
||||
frontend_version="$(frontend::latest_tag)"
|
||||
baseimage::build_if_exists
|
||||
}
|
||||
|
||||
|
||||
case ${1:-} in
|
||||
start)
|
||||
baseimage::build_if_exists
|
||||
try_build_baseimage
|
||||
challenge::build
|
||||
challenge::run ${@:2}
|
||||
;;
|
||||
@ -31,22 +43,21 @@ case ${1:-} in
|
||||
challenge:run ${@:2}
|
||||
;;
|
||||
build-baseimage)
|
||||
baseimage::build_if_exists
|
||||
build_baseimage
|
||||
;;
|
||||
build)
|
||||
baseimage::build_if_exists
|
||||
try_build_baseimage
|
||||
challenge::build_no_cache
|
||||
;;
|
||||
build-frontend)
|
||||
frontend::assert_exists
|
||||
frontend::build
|
||||
;;
|
||||
release-baseimage)
|
||||
baseimage::assert_exists
|
||||
build_baseimage
|
||||
baseimage::release
|
||||
;;
|
||||
release-frontend)
|
||||
frontend::assert_exists
|
||||
frontend::build
|
||||
frontend::release
|
||||
;;
|
||||
*)
|
||||
|
Reference in New Issue
Block a user