mirror of
https://github.com/avatao-content/test-tutorial-framework
synced 2025-01-15 21:31:56 +00:00
Make naming conventions in tfw.sh more obvious
This commit is contained in:
parent
2a8342d92b
commit
1f784e1502
26
hack/tfw.sh
26
hack/tfw.sh
@ -6,15 +6,15 @@ SCRIPT_DIR="$(dirname $($readlink_cmd -f $0))"
|
|||||||
|
|
||||||
TAO_PATH="${TAO_PATH:-$SCRIPT_DIR/../..}"
|
TAO_PATH="${TAO_PATH:-$SCRIPT_DIR/../..}"
|
||||||
BASEIMAGE_REPO="${BASEIMAGE_REPO:-baseimage-tutorial-framework}"
|
BASEIMAGE_REPO="${BASEIMAGE_REPO:-baseimage-tutorial-framework}"
|
||||||
BACKEND_REPO="${BACKEND_REPO:-test-tutorial-framework}"
|
TEST_REPO="${TEST_REPO:-test-tutorial-framework}"
|
||||||
FRONTEND_REPO="${FRONTEND_REPO:-frontend-tutorial-framework}"
|
FRONTEND_REPO="${FRONTEND_REPO:-frontend-tutorial-framework}"
|
||||||
BASEIMAGE_PATH="${TAO_PATH}/${BASEIMAGE_REPO}"
|
BASEIMAGE_PATH="${TAO_PATH}/${BASEIMAGE_REPO}"
|
||||||
BACKEND_PATH="${TAO_PATH}/${BACKEND_REPO}"
|
TEST_PATH="${TAO_PATH}/${TEST_REPO}"
|
||||||
FRONTEND_PATH="${TAO_PATH}/${FRONTEND_REPO}"
|
FRONTEND_PATH="${TAO_PATH}/${FRONTEND_REPO}"
|
||||||
|
|
||||||
BASEIMAGE_NAME="${BASEIMAGE_NAME:-baseimage-tutorial-framework}"
|
BASEIMAGE_NAME="${BASEIMAGE_NAME:-baseimage-tutorial-framework}"
|
||||||
IMAGE_NAME="${IMAGE_NAME:-test-tutorial-framework}"
|
IMAGE_NAME="${IMAGE_NAME:-test-tutorial-framework}"
|
||||||
BACKEND_PORT="${BACKEND_PORT:-8888}"
|
TEST_PORT="${TEST_PORT:-8888}"
|
||||||
AVATAO_SECRET="${AVATAO_SECRET:-secret}"
|
AVATAO_SECRET="${AVATAO_SECRET:-secret}"
|
||||||
BUILD_CONTEXT="${BUILD_CONTEXT:-solvable}"
|
BUILD_CONTEXT="${BUILD_CONTEXT:-solvable}"
|
||||||
|
|
||||||
@ -37,21 +37,21 @@ baseimage_releasename()
|
|||||||
printf "${VERSION}-${DATE}"
|
printf "${VERSION}-${DATE}"
|
||||||
}
|
}
|
||||||
|
|
||||||
build_backend()
|
build_test()
|
||||||
{
|
{
|
||||||
cd $BACKEND_PATH
|
cd $TEST_PATH
|
||||||
docker build -t $IMAGE_NAME -f ${BUILD_CONTEXT}/Dockerfile --build-arg BUILD_CONTEXT=$BUILD_CONTEXT --build-arg NOFRONTEND=1 .
|
docker build -t $IMAGE_NAME -f ${BUILD_CONTEXT}/Dockerfile --build-arg BUILD_CONTEXT=$BUILD_CONTEXT --build-arg NOFRONTEND=1 .
|
||||||
}
|
}
|
||||||
|
|
||||||
run_backend()
|
run_test()
|
||||||
{
|
{
|
||||||
docker run --rm -p $BACKEND_PORT:$BACKEND_PORT -e AVATAO_SECRET=$AVATAO_SECRET $IMAGE_NAME
|
docker run --rm -p $TEST_PORT:$TEST_PORT -e AVATAO_SECRET=$AVATAO_SECRET $IMAGE_NAME
|
||||||
}
|
}
|
||||||
|
|
||||||
build_and_run_backend()
|
build_and_run_test()
|
||||||
{
|
{
|
||||||
build_backend
|
build_test
|
||||||
run_backend
|
run_test
|
||||||
}
|
}
|
||||||
|
|
||||||
build_and_start_tfw()
|
build_and_start_tfw()
|
||||||
@ -59,7 +59,7 @@ build_and_start_tfw()
|
|||||||
trap 'exit' INT TERM
|
trap 'exit' INT TERM
|
||||||
trap 'kill 0' EXIT
|
trap 'kill 0' EXIT
|
||||||
build_baseimage
|
build_baseimage
|
||||||
run_frontend & build_and_run_backend
|
run_frontend & build_and_run_test
|
||||||
wait
|
wait
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ start_tfw()
|
|||||||
{
|
{
|
||||||
trap 'exit' INT TERM
|
trap 'exit' INT TERM
|
||||||
trap 'kill 0' EXIT
|
trap 'kill 0' EXIT
|
||||||
run_frontend & run_backend
|
run_frontend & run_test
|
||||||
wait
|
wait
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ case $1 in
|
|||||||
build_baseimage
|
build_baseimage
|
||||||
;;
|
;;
|
||||||
build)
|
build)
|
||||||
build_backend
|
build_test
|
||||||
;;
|
;;
|
||||||
start)
|
start)
|
||||||
start_tfw
|
start_tfw
|
||||||
|
Loading…
Reference in New Issue
Block a user