1
0
Fork 0
mirror of https://code.forgejo.org/actions/cascading-pr synced 2025-06-26 05:18:01 +02:00

improve verbosity

only output debug information if there is a failure
This commit is contained in:
Earl Warren 2023-11-01 15:44:11 +01:00
parent a98dc1dffc
commit d9ab167f95
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
3 changed files with 95 additions and 41 deletions

View file

@ -29,14 +29,14 @@ function dependencies() {
function retry() {
rm -f $TMPDIR/retry.out
success=false
local success=false
for delay in $RETRY_DELAYS ; do
if "$@" | tee -a $TMPDIR/retry.out > $TMPDIR/retry-attempt.out 2>&1 ; then
if "$@" |& tee -a $TMPDIR/retry.out > $TMPDIR/retry-attempt.out ; then
success=true
break
fi
cat $TMPDIR/retry-attempt.out >&2
log_verbose waiting $delay "$@"
log waiting $delay "$@"
sleep $delay
done
if $success ; then
@ -51,6 +51,7 @@ function retry() {
function debug() {
DEBUG=true
VERBOSE=true
set -x
PS4='${BASH_SOURCE[0]}:$LINENO: ${FUNCNAME[0]}: '
}
@ -69,7 +70,7 @@ function log_error() {
function log_verbose() {
if $VERBOSE ; then
log "$@"
log_info "$@"
fi
}