logging: include Repeat Build Args in markdown/ANSI logs

This commit is contained in:
Ricardo Pardini 2023-04-20 18:04:28 +02:00
parent 27d9fdf4bf
commit 3d2575639d
2 changed files with 9 additions and 0 deletions

View File

@ -38,6 +38,7 @@ function export_markdown_logs() {
### Armbian logs for ${ARMBIAN_BUILD_UUID}
#### Armbian build at $(LC_ALL=C LANG=C date) on $(hostname || true)
#### Repeat build: ${repeat_args_string:-""}
#### ARGs: \`${ARMBIAN_ORIGINAL_ARGV[@]@Q}\`
MARKDOWN_HEADER
@ -119,6 +120,7 @@ function export_ansi_logs() {
# Armbian ANSI build logs for ${ARMBIAN_BUILD_UUID} - use "less -SR" to view
$(echo -e -n "${bright_blue_color:-}")# Armbian build at $(LC_ALL=C LANG=C date) on $(hostname || true)$(echo -e -n "${ansi_reset_color}")
${dim_line_separator}
$(echo -e -n "${bright_blue_color}")# Repeat build: ${repeat_args_string:-""}$(echo -e -n "${ansi_reset_color}")
$(echo -e -n "${bright_blue_color}")# ARGs: ${ARMBIAN_ORIGINAL_ARGV[@]@Q}$(echo -e -n "${ansi_reset_color}")
${dim_line_separator}
ANSI_HEADER

View File

@ -68,6 +68,11 @@ function trap_handler_cleanup_logging() {
display_alert "Not archiving old logs." "CI=${CI:-false}, SKIP_LOG_ARCHIVE=${SKIP_LOG_ARCHIVE:-no}" "debug"
fi
# Gather repeat build args, included in the logs.
declare -g repeat_args=()
produce_repeat_args_array # produces repeat_args
declare repeat_args_string="${repeat_args[*]}"
## Here -- we need to definitely stop logging, cos we're gonna consolidate and delete the logs.
display_alert "End of logging" "STOP LOGGING: CURRENT_LOGFILE: ${CURRENT_LOGFILE}" "debug"
@ -110,5 +115,7 @@ function trap_handler_cleanup_logging() {
cat "${markdown_log_file}" >> "${GITHUB_STEP_SUMMARY}" || true
fi
unset repeat_args_string
discard_logs_tmp_dir
}