From 3e8bd5b8ee4625c48c01d6bd22febe585fb96141 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Mon, 27 Nov 2023 11:28:30 +0100 Subject: [PATCH] ci-automation/image-changes: Factor out curl invocation --- ci-automation/image_changes.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ci-automation/image_changes.sh b/ci-automation/image_changes.sh index 7159f5e89f..d5ffa74752 100644 --- a/ci-automation/image_changes.sh +++ b/ci-automation/image_changes.sh @@ -528,6 +528,15 @@ function channel_version() ( # traps. 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 \ -fsSL \ --retry-delay 1 \ @@ -535,10 +544,8 @@ function channel_version() ( --retry-connrefused \ --retry-max-time 60 \ --connect-timeout 20 \ - "https://${channel}.release.flatcar-linux.net/${board}/current/version.txt" >"${tmp_version_txt}" - source "${tmp_version_txt}" - echo "${FLATCAR_VERSION}" -) + "${url}" +} # -- # Prints some reports using scripts from the passed path to