-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new script for stopping docker (#2380)
* 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
Showing
2 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |