Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source version.txt to get version information #1266

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/figure-out-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
;;
*)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mantle-releases-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/setup-flatcar-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
24 changes: 12 additions & 12 deletions ci-automation/image_changes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Loading