From 537f5b06203c1d4a13625d35430e7fce5ae29290 Mon Sep 17 00:00:00 2001 From: pvinh-spike <81987648+pvinh-spike@users.noreply.github.com> Date: Tue, 24 Sep 2024 08:56:07 -0700 Subject: [PATCH] A quick fix to support alpha, beta, and dev builds. (#65) --- lib/version.sh | 6 +++--- scripts/10-download.part | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/version.sh b/lib/version.sh index 5eaeab97..f657c5e7 100644 --- a/lib/version.sh +++ b/lib/version.sh @@ -5,7 +5,7 @@ set -Eeuo pipefail source lib/fetch.sh ARTIFACTS_DOMAIN=${ARTIFACTS_DOMAIN:="https://artifacts.aerospike.com"} -RE_VERSION='[0-9]+[.][0-9]+[.][0-9]+([.][0-9]+)+(-rc[0-9]+)?([-][0-9]*[-]g[0-9a-z]*)?' +RE_VERSION='[0-9]+[.][0-9]+[.][0-9]+([.][0-9]+)+(-[a-z0-9]+)?([-][0-9]*[-]g[0-9a-z]*)?' function version_compare_gt() { v1=$1 @@ -65,7 +65,7 @@ function find_latest_tools_version_for_server() { local tools_version tools_version="$( fetch "${FUNCNAME[0]}" "${ARTIFACTS_DOMAIN}/aerospike-server-${edition}/${server_version}/" | - grep -oE "_tools-[0-9.-]+(-rc[0-9]+)?(-g[a-f0-9]{7})?_${distro}_x86_64.tgz" | + grep -oE "_tools-[0-9.-]+(-[a-z0-9]+)?(-g[a-f0-9]{7})?_${distro}_x86_64.tgz" | cut -d _ -f 2 | sort -V | tail -1 @@ -130,5 +130,5 @@ function get_version_from_dockerfile() { local distro=$1 local edition=$2 - grep "ARG AEROSPIKE_X86_64_LINK=" "${edition}/${distro}/Dockerfile" | grep -oE "/[0-9]+[.][0-9]+[.][0-9]+([.][0-9]+)+(-rc[0-9]+)?([-][0-9]*[-]g[0-9a-z]*)?/" | tr -d '/' | tail -1 + grep "ARG AEROSPIKE_X86_64_LINK=" "${edition}/${distro}/Dockerfile" | grep -oE "/[0-9]+[.][0-9]+[.][0-9]+([.][0-9]+)+(-[a-z0-9]+)?([-][0-9]*[-]g[0-9a-z]*)?/" | tr -d '/' | tail -1 } diff --git a/scripts/10-download.part b/scripts/10-download.part index b76f5b87..760cb496 100644 --- a/scripts/10-download.part +++ b/scripts/10-download.part @@ -1,6 +1,6 @@ { \ # 10-download.part - Vars used for tini and tools. - VERSION="$(grep -oE "/[0-9]+[.][0-9]+[.][0-9]+([.][0-9]+)+(-rc[0-9]+)?([-][0-9]+[-]g[0-9a-z]*)?/" <<<"${AEROSPIKE_X86_64_LINK}" | tr -d '/' | tail -1)"; \ + VERSION="$(grep -oE "/[0-9]+[.][0-9]+[.][0-9]+([.][0-9]+)+(-[a-z0-9]+)?([-][0-9]+[-]g[0-9a-z]*)?/" <<<"${AEROSPIKE_X86_64_LINK}" | tr -d '/' | tail -1)"; \ }; \ { \ # 10-common.part - Install tini.