From 32ae5cbae6154aeb440ef4aefdf8cca90298dd33 Mon Sep 17 00:00:00 2001 From: Michael Robinson <68482867+merobi-hub@users.noreply.github.com> Date: Wed, 14 Feb 2024 13:12:26 -0500 Subject: [PATCH] Upgrade docker/down.sh to compose v2 (#2678) * Adds no-compose option and arg and help arg to docker/down. Signed-off-by: merobi-hub * Adds os check and compose command for linux. Signed-off-by: merobi-hub * Migrate down cmd to compose v2. Signed-off-by: merobi-hub --------- Signed-off-by: merobi-hub Co-authored-by: Willy Lulciuc --- docker/down.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/docker/down.sh b/docker/down.sh index 98a3033151..e8ee59b4b5 100755 --- a/docker/down.sh +++ b/docker/down.sh @@ -22,14 +22,31 @@ project_root=$(git rev-parse --show-toplevel) cd "${project_root}/" compose_files="-f docker-compose.yml" -args="--remove-orphans" +compose_args="--remove-orphans" + +# Parse args +while [ $# -gt 0 ]; do + case $1 in + -h|'--help') + usage + exit 0 + ;; + esac + shift +done # We can ignore the tag and port(s) when cleaning up running # containers and volumes TAG=any -API_PORT=${RANDOM} API_ADMIN_PORT=${RANDOM} WEB_PORT=${RANDOM} TAG=${RANDOM} docker-compose $compose_files down $args && \ - docker volume rm marquez_data && \ +API_PORT=${RANDOM} +API_ADMIN_PORT=${RANDOM} +WEB_PORT=${RANDOM} +TAG=${RANDOM} + +docker compose $compose_files down $compose_args + +docker volume rm marquez_data && \ docker volume rm marquez_db-backup && \ docker volume rm marquez_db-conf && \ docker volume rm marquez_db-init