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:
parent
a98dc1dffc
commit
d9ab167f95
3 changed files with 95 additions and 41 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue