From 5c50948a1fda8a693c6a5e49bcb533e2c24cb40f Mon Sep 17 00:00:00 2001 From: Olivier DOSSMANN Date: Fri, 15 Jan 2016 16:57:51 +0100 Subject: [PATCH] [FIX] Move Docker image check from start to initial_start so that migrate command can also takes benefit from Docker images existence. --- launch.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/launch.sh b/launch.sh index 143e16d..afb5402 100755 --- a/launch.sh +++ b/launch.sh @@ -259,6 +259,14 @@ test_initial_start() { if ! test -f "$DOCKERFILE"; then error_and_quit "Docker file don't exists: ${DOCKERFILE}" fi + # Build Gissmo Docker images if missing + if [[ "$($docker_cmd images -q gissmo:${GISSMO_VERSION} 2> /dev/null)" == "" ]]; then + cd $GISSMO_DIR + info "Building Docker images…" + $docker_cmd build -t gissmo:${GISSMO_VERSION} -f ${DOCKERFILE} . || error_and_quit "Failed to build Gissmo Docker container." + info "…done." + cd $CURRENT_DIR + fi if test -z "$GISSMO_DOCKER_PORT"; then error_and_quit "No Gissmo Docker container port given (GISSMO_DOCKER_PORT in config file)." @@ -268,14 +276,6 @@ test_initial_start() { initial_start() { test_initial_start - # Build Gissmo Docker images if missing - if [[ "$($docker_cmd images -q gissmo:${GISSMO_VERSION} 2> /dev/null)" == "" ]]; then - cd $GISSMO_DIR - info "Building Docker images…" - $docker_cmd build -t gissmo:${GISSMO_VERSION} -f ${DOCKERFILE} . || error_and_quit "Failed to build Gissmo Docker container." - info "…done." - cd $CURRENT_DIR - fi # Check postgreSQL Docker container exists and is launched. test_postgresql_launched if [ $? -eq 1 ]; then