mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-05 04:06:33 +02:00
Source version.txt to get version information
This guards against possible quotes.
This commit is contained in:
parent
b54e9a6733
commit
b313a9e42b
2
.github/workflows/figure-out-branch.sh
vendored
2
.github/workflows/figure-out-branch.sh
vendored
@ -49,7 +49,7 @@ case "${channel_name}" in
|
||||
;;
|
||||
alpha|beta|stable|lts)
|
||||
link="https://${channel_name}.release.flatcar-linux.net/amd64-usr/current"
|
||||
major=$(curl -sSL "${link}/version.txt" | awk -F= '/FLATCAR_BUILD=/{ print $2 }')
|
||||
major=$(source <(curl -sSL "${link}/version.txt"); echo "${FLATCAR_BUILD}")
|
||||
branch="flatcar-${major}"
|
||||
;;
|
||||
*)
|
||||
|
||||
2
.github/workflows/mantle-releases-main.yml
vendored
2
.github/workflows/mantle-releases-main.yml
vendored
@ -40,7 +40,7 @@ jobs:
|
||||
fi
|
||||
rm -f lts-info
|
||||
else
|
||||
major=$(curl -fsSL --retry-delay 1 --retry 60 --retry-connrefused --retry-max-time 60 --connect-timeout 20 https://${{ matrix.branch }}.release.flatcar-linux.net/amd64-usr/current/version.txt | awk -F= '/FLATCAR_BUILD=/{ print $2 }')
|
||||
major=$(source <(curl -fsSL --retry-delay 1 --retry 60 --retry-connrefused --retry-max-time 60 --connect-timeout 20 https://${{ matrix.branch }}.release.flatcar-linux.net/amd64-usr/current/version.txt); echo "${FLATCAR_BUILD}")
|
||||
branch="flatcar-${major}"
|
||||
fi
|
||||
echo "BRANCH=${branch}" >>"${GITHUB_OUTPUT}"
|
||||
|
||||
4
.github/workflows/setup-flatcar-sdk.sh
vendored
4
.github/workflows/setup-flatcar-sdk.sh
vendored
@ -42,9 +42,7 @@ if [[ "${CHANNEL}" = 'main' ]]; then
|
||||
fi
|
||||
|
||||
# Pin the docker image version to that of the latest release in the channel.
|
||||
docker_sdk_vernum="$(curl -s -S -f -L "${MIRROR_LINK}/version.txt" \
|
||||
| grep -m 1 FLATCAR_SDK_VERSION= | cut -d = -f 2- \
|
||||
)"
|
||||
docker_sdk_vernum=$(source <(curl -s -S -f -L "${MIRROR_LINK}/version.txt"); echo "${FLATCAR_SDK_VERSION}")
|
||||
|
||||
docker_image_from_registry_or_buildcache "${sdk_name}" "${docker_sdk_vernum}"
|
||||
|
||||
|
||||
@ -235,21 +235,21 @@ function get_channel_a_and_version_a() {
|
||||
# --
|
||||
|
||||
# Gets the latest release for given channel and board. For lts channel
|
||||
# gets a version of the latest LTS.
|
||||
function channel_version() {
|
||||
# gets a version of the latest LTS. Runs in a subshell.
|
||||
function channel_version() (
|
||||
local channel=${1}; shift
|
||||
local board=${1}; shift
|
||||
|
||||
curl \
|
||||
-fsSL \
|
||||
--retry-delay 1 \
|
||||
--retry 60 \
|
||||
--retry-connrefused \
|
||||
--retry-max-time 60 \
|
||||
--connect-timeout 20 \
|
||||
"https://${channel}.release.flatcar-linux.net/${board}/current/version.txt" | \
|
||||
grep -m 1 'FLATCAR_VERSION=' | cut -d = -f 2-
|
||||
}
|
||||
source <(curl \
|
||||
-fsSL \
|
||||
--retry-delay 1 \
|
||||
--retry 60 \
|
||||
--retry-connrefused \
|
||||
--retry-max-time 60 \
|
||||
--connect-timeout 20 \
|
||||
"https://${channel}.release.flatcar-linux.net/${board}/current/version.txt")
|
||||
echo "${FLATCAR_VERSION}"
|
||||
)
|
||||
# --
|
||||
|
||||
# Prints some reports using scripts from the passed path to
|
||||
|
||||
@ -268,8 +268,8 @@ load_environment_var() {
|
||||
local file="$1" name value
|
||||
shift
|
||||
for name in "$@"; do
|
||||
value=$(grep "^${name}=" "${file}" | sed 's|"||g')
|
||||
[[ -n "${value}" ]] && export "${value}"
|
||||
value=$(source "${file}"; echo "${!name}")
|
||||
[[ -n "${value}" ]] && export "${name}=${value}"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user