From 8152b32c8d7e6dab55ff34c1af98fa19fba18f14 Mon Sep 17 00:00:00 2001 From: Sebastian Gerske Date: Mon, 17 Dec 2018 10:22:39 +0100 Subject: [PATCH] added --froce-pull fixed --purge --- start_ocean.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/start_ocean.sh b/start_ocean.sh index 35fa74d..f418d86 100755 --- a/start_ocean.sh +++ b/start_ocean.sh @@ -4,6 +4,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" COMPOSE_DIR="${DIR}/compose-files" export PROJECT_NAME="ocean" +export forcepull="false" + # default to latest versions export OCEAN_VERSION=stable @@ -60,6 +62,10 @@ while :; do export OCEAN_VERSION=latest printf $COLOR_Y'Switched to latest components...\n\n'$COLOR_RESET ;; + --force-pull) + export forcepull='true' + printf $COLOR_Y'Pulling latest components...\n\n'$COLOR_RESET + ;; ################################################# # Exclude switches ################################################# @@ -123,8 +129,11 @@ while :; do # Cleaning switches ################################################# --purge) - docker network rm ${PROJECT_NAME}_backend || true + printf $COLOR_R'Doing a deep clean ...\n\n'$COLOR_RESET + docker-compose --project-name=$PROJECT_NAME $COMPOSE_FILES -f ${NODE_COMPOSE_FILE} down docker network rm ${PROJECT_NAME}_default || true + docker network rm ${PROJECT_NAME}_backend || true + docker network rm ${PROJECT_NAME}_secretstore || true docker volume rm ${PROJECT_NAME}_keeper-node || true docker volume rm ${PROJECT_NAME}_secret-store || true read -p "Are you sure you want to delete $KEEPER_ARTIFACTS_FOLDER? " -n 1 -r @@ -144,6 +153,10 @@ 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 docker-compose --project-name=$PROJECT_NAME $COMPOSE_FILES -f ${NODE_COMPOSE_FILE} up --remove-orphans break esac