Skip to content

Commit

Permalink
Fixes for the recent version(s) of docker compose
Browse files Browse the repository at this point in the history
- Updates the syntax for setting logging levels and binding volumes.
- resolves bcgov#161

Signed-off-by: Wade Barnes <wade@neoterictech.ca>
  • Loading branch information
WadeBarnes committed Sep 9, 2021
1 parent 29b8a03 commit 8da3bc7
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions manage
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ function runCliCommand() {
cliUsage
fi

cmd="${terminalEmu} docker-compose \
--log-level ERROR run "
cmd="${terminalEmu} docker --log-level error \
compose run "

if [ -z "${VOLUMES}" ] && [ -d "${DEFAULT_CLI_SCRIPT_DIR}" ] ; then
VOLUMES=$(realpath ${DEFAULT_CLI_SCRIPT_DIR})
Expand All @@ -305,14 +305,14 @@ function runCliCommand() {
# When running on Windows, you need to prefix the path with an extra '/'
path="/${path}"
fi
cmd+=" --volume='${path}:/home/indy/${mountPoint}:Z'"
cmd+=" -v='${path}:/home/indy/${mountPoint}:Z'"
done
fi

# Need to escape quotes and commas so they don't get removed along the way ...
escapedArgs=$(echo $@ | sed "s~'~\\\'~g" | sed 's~\"~\\"~g')

# Quote the escaped args so docker-compose does not try to perform any processing on them ...
# Quote the escaped args so docker compose does not try to perform any processing on them ...
# Separate the command and the args so they don't get treated as one argument by the scripts in the container ...
cmd+="
--rm client \
Expand Down Expand Up @@ -341,9 +341,9 @@ function logs() {
log_args=()
(( no_tail != 1 )) && log_args+=( '-f' )
if [ ! -z "${TAIL_LOGS}" ] || [ ! -z "${_force}" ]; then
docker-compose \
--log-level ERROR logs \
"${log_args[@]}" "$@"
docker --log-level error \
compose logs \
"${log_args[@]}" "$@"
fi
)
}
Expand Down Expand Up @@ -644,8 +644,8 @@ case "${COMMAND}" in
start|up)
initEnv "$@"
install_taa
docker-compose \
--log-level ERROR up \
docker --log-level error \
compose up \
-d webserver node1 node2 node3 node4
wait_for_ledger
logs
Expand All @@ -654,8 +654,8 @@ case "${COMMAND}" in
start-combined)
initEnv "$@"
install_taa
docker-compose \
--log-level ERROR up \
docker --log-level error \
compose up \
-d webserver nodes
wait_for_ledger
logs
Expand All @@ -665,16 +665,16 @@ case "${COMMAND}" in
if [ -z "$LEDGER_SEED" ]; then
export ANONYMOUS=1
fi
docker-compose \
--log-level ERROR up \
docker --log-level error \
compose up \
-d webserver
wait_for_ledger
logs webserver
;;
synctest)
initEnv "$@"
docker-compose \
--log-level ERROR up \
docker --log-level error \
compose up \
-d synctest node1 node2 node3 node4
logs -f synctest
;;
Expand All @@ -690,8 +690,8 @@ case "${COMMAND}" in
;;
stop)
initEnv "$@"
docker-compose \
--log-level ERROR stop
docker --log-level error \
compose stop
remove_taa
;;
down|rm)
Expand Down

0 comments on commit 8da3bc7

Please sign in to comment.