chore(ci): silence pull progress in docker-compose testruns

This commit is contained in:
Andrew Mayorov 2023-11-08 22:31:18 +07:00
parent 7250059c60
commit b9b506c4a2
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
1 changed files with 9 additions and 13 deletions

View File

@ -40,6 +40,7 @@ ATTACH='no'
STOP='no' STOP='no'
IS_CI='no' IS_CI='no'
ODBC_REQUEST='no' ODBC_REQUEST='no'
UP='up'
while [ "$#" -gt 0 ]; do while [ "$#" -gt 0 ]; do
case $1 in case $1 in
-h|--help) -h|--help)
@ -72,6 +73,7 @@ while [ "$#" -gt 0 ]; do
;; ;;
--ci) --ci)
IS_CI='yes' IS_CI='yes'
UP='up --quiet-pull'
shift 1 shift 1
;; ;;
--) --)
@ -254,10 +256,8 @@ else
INSTALL_ODBC="echo 'msodbc driver not requested'" INSTALL_ODBC="echo 'msodbc driver not requested'"
fi fi
F_OPTIONS=""
for file in "${FILES[@]}"; do for file in "${FILES[@]}"; do
F_OPTIONS="$F_OPTIONS -f $file" DC="$DC -f $file"
done done
DOCKER_USER="$(id -u)" DOCKER_USER="$(id -u)"
@ -275,15 +275,14 @@ if [ "$STOP" = 'no' ]; then
# some left-over log file has to be deleted before a new docker-compose up # some left-over log file has to be deleted before a new docker-compose up
rm -f '.ci/docker-compose-file/redis/*.log' rm -f '.ci/docker-compose-file/redis/*.log'
set +e set +e
# shellcheck disable=2086 # no quotes for F_OPTIONS # shellcheck disable=2086 # no quotes for UP
$DC $F_OPTIONS up -d --build --remove-orphans $DC $UP -d --build --remove-orphans
RESULT=$? RESULT=$?
if [ $RESULT -ne 0 ]; then if [ $RESULT -ne 0 ]; then
mkdir -p _build/test/logs mkdir -p _build/test/logs
LOG='_build/test/logs/docker-compose.log' LOG='_build/test/logs/docker-compose.log'
echo "Dumping docker-compose log to $LOG" echo "Dumping docker-compose log to $LOG"
# shellcheck disable=2086 # no quotes for F_OPTIONS $DC logs --no-color --timestamps > "$LOG"
$DC $F_OPTIONS logs --no-color --timestamps > "$LOG"
exit 1 exit 1
fi fi
set -e set -e
@ -309,8 +308,7 @@ fi
set +e set +e
if [ "$STOP" = 'yes' ]; then if [ "$STOP" = 'yes' ]; then
# shellcheck disable=2086 # no quotes for F_OPTIONS $DC down --remove-orphans
$DC $F_OPTIONS down --remove-orphans
elif [ "$ATTACH" = 'yes' ]; then elif [ "$ATTACH" = 'yes' ]; then
docker exec -it "$ERLANG_CONTAINER" bash docker exec -it "$ERLANG_CONTAINER" bash
elif [ "$CONSOLE" = 'yes' ]; then elif [ "$CONSOLE" = 'yes' ]; then
@ -335,12 +333,10 @@ else
if [ "$RESULT" -ne 0 ]; then if [ "$RESULT" -ne 0 ]; then
LOG='_build/test/logs/docker-compose.log' LOG='_build/test/logs/docker-compose.log'
echo "Dumping docker-compose log to $LOG" echo "Dumping docker-compose log to $LOG"
# shellcheck disable=2086 # no quotes for F_OPTIONS $DC logs --no-color --timestamps > "$LOG"
$DC $F_OPTIONS logs --no-color --timestamps > "$LOG"
fi fi
if [ "$KEEP_UP" != 'yes' ]; then if [ "$KEEP_UP" != 'yes' ]; then
# shellcheck disable=2086 # no quotes for F_OPTIONS $DC down
$DC $F_OPTIONS down
fi fi
exit "$RESULT" exit "$RESULT"
fi fi