From b64ac9f5172ddb7e5bf88a1d3b2ccc9024486712 Mon Sep 17 00:00:00 2001 From: Olivier DOSSMANN Date: Thu, 14 Jan 2016 11:25:02 +0100 Subject: [PATCH] [FIX] Launch script: multiple error by using GISSMO_CFG feature. --- launch.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/launch.sh b/launch.sh index 014d22f..3f9ef08 100755 --- a/launch.sh +++ b/launch.sh @@ -183,7 +183,7 @@ dev() { if [ $? -eq 1 ]; then $docker_cmd run -it --rm --link ${POSTGRES_DOCKER_NAME}:db -p ${GISSMO_DOCKER_PORT}:8000 -v ${GISSMO_DIR}:/opt/gissmo --name ${GISSMO_DOCKER_NAME} gissmo:${GISSMO_VERSION} development || error_and_quit "Failed to create and launch ${GISSMO_DOCKER_NAME} container." else - error_and_quit "${GISSMO_DOCKER_NAME} is already launched!" + error_and_quit "${GISSMO_DOCKER_NAME} is already launched! If you need another name please set GISSMO_DOCKER_NAME in configuration file." fi } @@ -218,7 +218,7 @@ init() { } test_migrate() { - test_start + test_initial_start } migrate() { @@ -253,6 +253,9 @@ test_initial_start() { if test -z "$GISSMO_VERSION"; then error_and_quit "No Gissmo version given (GISSMO_VERSION in config file)." fi + if ! test -f "$DOCKERFILE"; then + error_and_quit "Docker file don't exists: ${DOCKERFILE}" + fi if test -z "$GISSMO_DOCKER_PORT"; then error_and_quit "No Gissmo Docker container port given (GISSMO_DOCKER_PORT in config file)." fi @@ -264,7 +267,7 @@ initial_start() { # Build Gissmo Docker images if missing if [[ "$($docker_cmd images -q gissmo:${GISSMO_VERSION} 2> /dev/null)" == "" ]]; then cd $GISSMO_DIR - $docker_cmd build -t gissmo:${GISSMO_VERSION} . || error_and_quit "Failed to build Gissmo Docker container." + $docker_cmd build -t gissmo:${GISSMO_VERSION} -f ${DOCKERFILE} || error_and_quit "Failed to build Gissmo Docker container." cd $CURRENT_DIR fi # Check postgreSQL Docker container exists and is launched. @@ -281,7 +284,7 @@ start() { if [ $? -eq 1 ]; then $docker_cmd run -it --rm --link ${POSTGRES_DOCKER_NAME}:db -p ${GISSMO_DOCKER_PORT}:8000 -e SECRET_KEY="abcdefg" --name ${GISSMO_DOCKER_NAME} gissmo:${GISSMO_VERSION} $ARGS || error_and_quit "Failed to create and launch ${GISSMO_DOCKER_NAME} container." else - error_and_quit "${GISSMO_DOCKER_NAME} is already launched!" + error_and_quit "${GISSMO_DOCKER_NAME} is already launched! If you need another name please set GISSMO_DOCKER_NAME in configuration file." fi } @@ -317,10 +320,6 @@ if test -z $DOCKERFILE_NAME; then error_and_quit "No docker filename given." fi -if ! test -f $DOCKERFILE && ! test "$COMMAND" == "init"; then - error_and_quit "Docker file don't exists: ${DOCKERFILE}" -fi - if ! test -z $COMMAND; then check_command "$COMMAND" $COMMAND