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

[mesheryctl] Fall back to stable release #1886

Closed
Closed
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
7 changes: 4 additions & 3 deletions install
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,14 @@ if [ "x${MESHERY_VERSION}" = "x" ] ; then
exit;
fi

# For patch releases, the meshery tar ball will not be generated, so fall back to last stable release
if [[ "$MESHERY_VERSION" == *"patch"* ]] ; then
LAST_MESHERY_VERSION=`echo $MESHERY_VERSION | awk -F '-patch' '{print $1}'`
# For patch/alpha/beta/rc releases, the meshery tar ball will not be generated, so fall back to last stable release
if [[ "$MESHERY_VERSION" =~ .+-(patch|alpha|beta|rc) ]] ; then
LAST_MESHERY_VERSION=$(git ls-remote --tags https://github.com/meshery/meshery | grep -v -E 'patch|alpha|beta|rc' | tail -1 | sed -E "s/(.+)(v.+)/\2/")
Copy link
Contributor

@hexxdump hexxdump Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces dependency on git command. We need to add a command_exists check for git as well.

We wanted to get away from git API calls also, but looks like its unavoidable, unless we support another direct API to get last stable build similar to "https://docs.meshery.io/project/releases/latest"
Please check whats the issue with the latest beta release, as we had tar balls available for beta and rc builds earlier.
#1704 (comment)

Also, the earlier fix wont work, if the patch release is >1 or the base version's tar is not available.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@da0p will you be incorporating this feedback?

printf "Patch release %s is not supported, falling back to last stable release: %s\n\n" "$MESHERY_VERSION" "$LAST_MESHERY_VERSION"
MESHERY_VERSION=$LAST_MESHERY_VERSION
fi


NAME="mesheryctl-${MESHERY_VERSION}"
URL="https://github.com/meshery/meshery/releases/download/${MESHERY_VERSION}/mesheryctl_${MESHERY_VERSION:1}_${OSEXT}_${OSARCHITECTURE}.tar.gz"

Expand Down
Loading