diff --git a/config.example b/config.example index 12b980e..3dcd846 100644 --- a/config.example +++ b/config.example @@ -21,3 +21,4 @@ GIT_BRANCH="restful" GISSMO_VERSION="1.5" # GISSMO_DOCKER_NAME="gissmo" GISSMO_DOCKER_PORT="8002" +UPLOAD_DIR="${HOME}/gissmo_project/gissmo/upload" diff --git a/launch.sh b/launch.sh index a80502d..b0ef32b 100755 --- a/launch.sh +++ b/launch.sh @@ -290,6 +290,9 @@ test_initial_start() { if ! test -f "$DOCKERFILE"; then error_and_quit "Docker file don't exists: ${DOCKERFILE}" fi + if test -z "$UPLOAD_DIR"; then + error_and_quit "No Gissmo upload directory given (UPLOAD_DIR in config file)." + fi # Build Gissmo Docker images if missing if [[ "$($docker_cmd images -q gissmo:${GISSMO_VERSION} 2> /dev/null)" == "" ]]; then cd "$GISSMO_DIR" @@ -319,7 +322,7 @@ start() { # Run existing Docker container, otherwise create a new one GISSMO_RUNNING=$($docker_cmd inspect --format="{{ .State.Running }}" ${GISSMO_DOCKER_NAME} 2> /dev/null) 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." + $docker_cmd run -it --rm --link ${POSTGRES_DOCKER_NAME}:db -p ${GISSMO_DOCKER_PORT}:8000 -e SECRET_KEY="abcdefg" --name ${GISSMO_DOCKER_NAME} -v ${UPLOAD_DIR}:/opt/gissmo/upload 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! If you need another name please set GISSMO_DOCKER_NAME in configuration file."