From 1f784e1502eb275be718194a3dd749700e7ab398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Fri, 30 Mar 2018 19:38:36 +0200 Subject: [PATCH] Make naming conventions in tfw.sh more obvious --- hack/tfw.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/hack/tfw.sh b/hack/tfw.sh index 0651115..aab7bdc 100755 --- a/hack/tfw.sh +++ b/hack/tfw.sh @@ -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