Skip to content

Commit 45f222b

Browse files
committed
add more logs
1 parent 756c08e commit 45f222b

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

start.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,31 @@ echo "Executing git command with retry logic: $@"
3434
until [[ "$TRY_NUM" -ge "$MAX_TRIES" ]]; do
3535
"${COMMAND[@]}" # Use "${COMMAND[@]}" to preserve arguments with quotes
3636
EXIT_CODE=$?
37+
38+
# Log the command output and error messages
39+
echo "Command output (stdout):"
40+
cat "$OUTPUT_LOG"
41+
echo "Command error (stderr):"
42+
cat "$ERROR_LOG"
43+
3744
if [[ $EXIT_CODE == 0 ]]; then
45+
echo "Command succeeded on attempt $TRY_NUM."
3846
break
3947
elif [[ $EXIT_CODE == "$RETRY_ON_SIGNAL" ]]; then
4048
echo "Failed with Exit Code $EXIT_CODE - try $TRY_NUM "
4149
TRY_NUM=$(( ${TRY_NUM} + 1 ))
4250
sleep $RETRY_WAIT
4351
else
52+
echo "Command failed with exit code $EXIT_CODE. No retry configured for this code."
53+
echo "Failed command: ${COMMAND[*]}"
54+
echo "Exit Code: $EXIT_CODE"
55+
echo "Output Log: $OUTPUT_LOG"
56+
echo "Error Log: $ERROR_LOG"
4457
break
4558
fi
46-
done
47-
return $EXIT_CODE
48-
)
59+
done
60+
return $EXIT_CODE
61+
)
4962
}
5063

5164
upsert_remote_alias () {

0 commit comments

Comments
 (0)