From 8a79ca06bf2d563670d4c9acf37b42b280948f5d Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Wed, 16 Jan 2019 16:06:27 +0100 Subject: [PATCH] Added --no-ansi and --only-secret-store --- start_ocean.sh | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/start_ocean.sh b/start_ocean.sh index c0ab1ef..1708704 100755 --- a/start_ocean.sh +++ b/start_ocean.sh @@ -8,7 +8,7 @@ DIR="${DIR/ /\\ }" COMPOSE_DIR="${DIR}/compose-files" export PROJECT_NAME="ocean" -export forcepull="false" +export FORCEPULL="false" # default to latest versions export OCEAN_VERSION=stable @@ -58,9 +58,18 @@ COMPOSE_FILES+=" -f ${COMPOSE_DIR}/aquarius.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/brizo.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/secret_store.yml" +DOCKER_COMPOSE_EXTRA_OPTS="${DOCKER_COMPOSE_EXTRA_OPTS:-}" + while :; do case $1 in ################################################# + # Disable color + ################################################# + --no-ansi) + DOCKER_COMPOSE_EXTRA_OPTS+=" --no-ansi" + unset COLOR_R COLOR_G COLOR_Y COLOR_B COLOR_M COLOR_C COLOR_RESET + ;; + ################################################# # Version switches ################################################# --latest) @@ -72,7 +81,7 @@ while :; do export PLEUSTON_VERSION=${PLEUSTON_VERSION:-$OCEAN_VERSION} ;; --force-pull) - export forcepull="true" + export FORCEPULL="true" printf $COLOR_Y'Pulling latest components...\n\n'$COLOR_RESET ;; ################################################# @@ -94,6 +103,17 @@ while :; do COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/secret_store.yml/}" printf $COLOR_Y'Starting without Secret Store...\n\n'$COLOR_RESET ;; + + ################################################# + # Only Secret Store + ################################################# + --only-secret-store) + COMPOSE_FILES="" + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/network_volumes.yml" + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/secret_store.yml" + NODE_COMPOSE_FILE="" + printf $COLOR_Y'Starting only Secret Store...\n\n'$COLOR_RESET + ;; ################################################# # Contract/Storage switches ################################################# @@ -169,11 +189,9 @@ while :; do ;; *) printf $COLOR_Y'Starting Ocean...\n\n'$COLOR_RESET - if [[ $forcepull == "true" ]] - then - docker-compose --project-name=$PROJECT_NAME $COMPOSE_FILES -f ${NODE_COMPOSE_FILE} pull - fi - eval docker-compose --project-name=$PROJECT_NAME $COMPOSE_FILES -f ${NODE_COMPOSE_FILE} up --remove-orphans + [ ! -z ${NODE_COMPOSE_FILE} ] && COMPOSE_FILES+=" -f ${NODE_COMPOSE_FILE}" + [ ${FORCEPULL} = "true" ] && docker-compose $DOCKER_COMPOSE_EXTRA_OPTS --project-name=$PROJECT_NAME $COMPOSE_FILES pull + eval docker-compose $DOCKER_COMPOSE_EXTRA_OPTS --project-name=$PROJECT_NAME $COMPOSE_FILES up --remove-orphans break esac shift