From 1ae1de46dc59b1c277a205fbe16dd7618e6aa57b Mon Sep 17 00:00:00 2001 From: Jan Orel Date: Thu, 25 Jul 2024 11:03:39 +0200 Subject: [PATCH] M #-: Use latest one-apps release for context (#3171) --- share/context/download_context.sh | 38 +++---------------------------- 1 file changed, 3 insertions(+), 35 deletions(-) diff --git a/share/context/download_context.sh b/share/context/download_context.sh index 3a5ee66b9c2..eba35668476 100755 --- a/share/context/download_context.sh +++ b/share/context/download_context.sh @@ -1,36 +1,4 @@ #!/bin/bash - -#------------------------------------------------------------------------------- -# This function returns the associated context packages version to the installed -# OpenNebula version -#------------------------------------------------------------------------------- -function get_tag_version { - local creleases=`curl -sSL $1 | jq -r '.[].tag_name' | cut -d 'v' -f 2` - - for tag in `echo $creleases`; do - if [ "$tag" = "`echo -e "$tag\n$VERSION" | sort -V | head -n1`" ]; then - echo "$tag" - break - fi - done -} - -CONTEXT_API="https://api.github.com/repos/OpenNebula/one-apps/releases" -VERSION=`cat ../../src/im_mad/remotes/VERSION` - -############################################################################### -# Download linux & windows packages -############################################################################### - -TAG_VERSION=`get_tag_version $CONTEXT_API` - -# If the current ONE version is greater than every context version the last one is retrieved -if [ -z "$TAG_VERSION" ]; then - TAG_VERSION=`curl -s $CONTEXT_API | jq -r '.[0].tag_name' | cut -d 'v' -f 2` -fi - -TAG="v$TAG_VERSION" - -curl -s $CONTEXT_API | \ - jq -r --arg TAG "$TAG" '.[] | select(.tag_name == $TAG) | .assets[].browser_download_url' | \ - xargs wget -P . +# Always download latest context from one-apps +CONTEXT_API="https://api.github.com/repos/OpenNebula/one-apps/releases/latest" +curl -s $CONTEXT_API | jq -r '.assets[].browser_download_url' | xargs wget -P .