ci-automation/image-changes: Factor out curl invocation

This commit is contained in:
Krzesimir Nowak 2023-11-27 11:28:30 +01:00
parent d3e903db33
commit 3e8bd5b8ee

View File

@ -528,6 +528,15 @@ function channel_version() (
# traps. # traps.
trap 'rm "${tmp_version_txt}"' EXIT trap 'rm "${tmp_version_txt}"' EXIT
curl_to_stdout "https://${channel}.release.flatcar-linux.net/${board}/current/version.txt" >"${tmp_version_txt}"
source "${tmp_version_txt}"
echo "${FLATCAR_VERSION}"
)
# --
function curl_to_stdout() {
local url=${1}; shift
curl \ curl \
-fsSL \ -fsSL \
--retry-delay 1 \ --retry-delay 1 \
@ -535,10 +544,8 @@ function channel_version() (
--retry-connrefused \ --retry-connrefused \
--retry-max-time 60 \ --retry-max-time 60 \
--connect-timeout 20 \ --connect-timeout 20 \
"https://${channel}.release.flatcar-linux.net/${board}/current/version.txt" >"${tmp_version_txt}" "${url}"
source "${tmp_version_txt}" }
echo "${FLATCAR_VERSION}"
)
# -- # --
# Prints some reports using scripts from the passed path to # Prints some reports using scripts from the passed path to