Skip to content

Commit

Permalink
Upgrade docker/down.sh to compose v2 (#2678)
Browse files Browse the repository at this point in the history
* Adds no-compose option and arg and help arg to docker/down.

Signed-off-by: merobi-hub <merobi@gmail.com>

* Adds os check and compose command for linux.

Signed-off-by: merobi-hub <merobi@gmail.com>

* Migrate down cmd to compose v2.

Signed-off-by: merobi-hub <merobi@gmail.com>

---------

Signed-off-by: merobi-hub <merobi@gmail.com>
Co-authored-by: Willy Lulciuc <willy@datakin.com>
  • Loading branch information
merobi-hub and wslulciuc authored Feb 14, 2024
1 parent 87dcdf6 commit 32ae5cb
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions docker/down.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 32ae5cb

Please sign in to comment.