Skip to content

Commit 3e8bd5b

Browse files
committed
ci-automation/image-changes: Factor out curl invocation
1 parent d3e903d commit 3e8bd5b

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

ci-automation/image_changes.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -528,17 +528,24 @@ function channel_version() (
528528
# traps.
529529
trap 'rm "${tmp_version_txt}"' EXIT
530530

531+
curl_to_stdout "https://${channel}.release.flatcar-linux.net/${board}/current/version.txt" >"${tmp_version_txt}"
532+
source "${tmp_version_txt}"
533+
echo "${FLATCAR_VERSION}"
534+
)
535+
# --
536+
537+
function curl_to_stdout() {
538+
local url=${1}; shift
539+
531540
curl \
532541
-fsSL \
533542
--retry-delay 1 \
534543
--retry 60 \
535544
--retry-connrefused \
536545
--retry-max-time 60 \
537546
--connect-timeout 20 \
538-
"https://${channel}.release.flatcar-linux.net/${board}/current/version.txt" >"${tmp_version_txt}"
539-
source "${tmp_version_txt}"
540-
echo "${FLATCAR_VERSION}"
541-
)
547+
"${url}"
548+
}
542549
# --
543550

544551
# Prints some reports using scripts from the passed path to

0 commit comments

Comments
 (0)