Skip to content

Commit

Permalink
Merge pull request #1578 from dduportal/chore/publish/fixup-1564-2
Browse files Browse the repository at this point in the history
chore(publish.sh) fixup #1564 (again) to correct weekly publications
  • Loading branch information
dduportal authored Feb 15, 2023
2 parents a034002 + 08eb51f commit 0b555ba
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .ci/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ is-published() {
## Check all the tags of each docker target.
for docker_image_fullname in $(echo "${docker_bake_version_config}" | jq -r '.target.'"${docker_bake_target}"'.tags | .[]')
do
local tag_to_check manifest
local tag_to_check manifest published_platforms

# Extract the tag, e.g. "Remove all the characters on the left of the ':' character" - https://tldp.org/LDP/abs/html/string-manipulation.html#SubstringRemoval
tag_to_check="${docker_image_fullname##*:}"
Expand All @@ -66,11 +66,9 @@ is-published() {
published_platforms="$(echo "${manifest}" | jq -r '[.manifests[].platform | select(.architecture != "unknown")] | length')"
set -e

test -n "${manifest}"
if test -z "${published_platforms}"; then
return 1
fi
test "${published_platforms}" -eq "${platform_amount}"
test -n "${manifest}" || return 1
test -n "${published_platforms}" || return 1
test "${published_platforms}" -eq "${platform_amount}" || return 1
done
done

Expand Down Expand Up @@ -137,8 +135,8 @@ while [[ $# -gt 0 ]]; do
shift
;;
*)
echo "Unknown option: $key"
return 1
echo "ERROR: Unknown option: $key"
exit 1
;;
esac
shift
Expand All @@ -155,9 +153,11 @@ if [ "$dry_run" = true ]; then
fi

versions=$(get-latest-versions)
latest_weekly_version=$(echo "${versions}" | tail -n 1)

# The regexp '[0-9]\.[0-9]+\.[0-9]' captures only the LTS version (e.g. "3 numbers" such as 2.375.3 for instance).
# Weekly versions are all the non-LTS versions
latest_lts_version=$(echo "${versions}" | grep -E '[0-9]\.[0-9]+\.[0-9]' | tail -n 1 || echo "No LTS versions")
latest_weekly_version=$(echo "${versions}" | grep -v -E '[0-9]\.[0-9]+\.[0-9]' | tail -n 1)

for version in ${versions}
do
Expand Down

0 comments on commit 0b555ba

Please sign in to comment.