Skip to content

Commit

Permalink
Add a new script for stopping docker (#2380)
Browse files Browse the repository at this point in the history
* Add a new script for stopping docker deployment

Signed-off-by: Ross Turk <ross@rossturk.com>

* add docker/down.sh

Signed-off-by: Ross Turk <ross@rossturk.com>

Signed-off-by: Ross Turk <ross@rossturk.com>
Co-authored-by: Willy Lulciuc <willy@datakin.com>
  • Loading branch information
rossturk and wslulciuc authored Jan 26, 2023
1 parent 74028c5 commit 5e92e75
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [Unreleased](https://github.com/MarquezProject/marquez/compare/0.29.0...HEAD)

* Added new `docker/down.sh` script that makes it easier to stop local deployment when run detached [`#2380`](https://github.com/MarquezProject/marquez/pull/2380)

## [0.29.0](https://github.com/MarquezProject/marquez/compare/0.28.0...0.29.0) - 2022-12-19

### Added
Expand Down Expand Up @@ -897,4 +899,4 @@
----
SPDX-License-Identifier: Apache-2.0
Copyright 2018-2023 contributors to the Marquez project.
Copyright 2018-2023 contributors to the Marquez project.
63 changes: 63 additions & 0 deletions docker/down.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash
#
# SPDX-License-Identifier: Apache-2.0

set -e

title() {
echo -e "\033[1m${1}\033[0m"
}

usage() {
echo "usage: ./$(basename -- ${0}) [--api-port PORT] [--web-port PORT] [--tag TAG]"
echo "A script used to bring down Marquez when run via Docker"
echo
title "ARGUMENTS:"
echo " -a, --api-port int api port (default: 5000)"
echo " -m, --api-admin-port int api admin port (default: 5001)"
echo " -w, --web-port int web port (default: 3000)"
echo " -t, --tag string image tag (default: latest)"
echo
}

# Change working directory to project root
project_root=$(git rev-parse --show-toplevel)
cd "${project_root}/"

compose_files="-f docker-compose.yml"
args="--remove-orphans"

API_PORT=5000
API_ADMIN_PORT=5001
WEB_PORT=3000
TAG=0.19.0
while [ $# -gt 0 ]; do
case $1 in
-a|'--api-port')
shift
API_PORT="${1}"
;;
-m|'--api-admin-port')
shift
API_ADMIN_PORT="${1}"
;;
-w|'--web-port')
shift
WEB_PORT="${1}"
;;
-t|'--tag')
shift
TAG="${1}"
;;
-h|'--help')
usage
exit 0
;;
*) usage
exit 1
;;
esac
shift
done

API_PORT=${API_PORT} API_ADMIN_PORT=${API_ADMIN_PORT} WEB_PORT=${WEB_PORT} TAG="${TAG}" docker-compose $compose_files down $args

0 comments on commit 5e92e75

Please sign in to comment.