1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2024-11-12 19:47:18 +00:00

Make naming conventions in tfw.sh more obvious

This commit is contained in:
Kristóf Tóth 2018-03-30 19:38:36 +02:00
parent 2a8342d92b
commit 1f784e1502

View File

@ -6,15 +6,15 @@ SCRIPT_DIR="$(dirname $($readlink_cmd -f $0))"
TAO_PATH="${TAO_PATH:-$SCRIPT_DIR/../..}"
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}"
BASEIMAGE_PATH="${TAO_PATH}/${BASEIMAGE_REPO}"
BACKEND_PATH="${TAO_PATH}/${BACKEND_REPO}"
TEST_PATH="${TAO_PATH}/${TEST_REPO}"
FRONTEND_PATH="${TAO_PATH}/${FRONTEND_REPO}"
BASEIMAGE_NAME="${BASEIMAGE_NAME:-baseimage-tutorial-framework}"
IMAGE_NAME="${IMAGE_NAME:-test-tutorial-framework}"
BACKEND_PORT="${BACKEND_PORT:-8888}"
TEST_PORT="${TEST_PORT:-8888}"
AVATAO_SECRET="${AVATAO_SECRET:-secret}"
BUILD_CONTEXT="${BUILD_CONTEXT:-solvable}"
@ -37,21 +37,21 @@ baseimage_releasename()
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 .
}
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
run_backend
build_test
run_test
}
build_and_start_tfw()
@ -59,7 +59,7 @@ build_and_start_tfw()
trap 'exit' INT TERM
trap 'kill 0' EXIT
build_baseimage
run_frontend & build_and_run_backend
run_frontend & build_and_run_test
wait
}
@ -67,7 +67,7 @@ start_tfw()
{
trap 'exit' INT TERM
trap 'kill 0' EXIT
run_frontend & run_backend
run_frontend & run_test
wait
}
@ -76,7 +76,7 @@ case $1 in
build_baseimage
;;
build)
build_backend
build_test
;;
start)
start_tfw