mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 08:17:37 +00:00
Merge pull request #873 from devimc/topic/snap/fixSnap
snap: fix how latest stable version is obtained
This commit is contained in:
commit
39261ae3e6
@ -19,16 +19,14 @@ parts:
|
|||||||
override-pull: |
|
override-pull: |
|
||||||
branch="master"
|
branch="master"
|
||||||
|
|
||||||
# kata CI or launchpad snap-master
|
# kata CI or launchpad snap-master, then build latest stable
|
||||||
if [ "${CI}" = "true" ] || echo "${SNAPCRAFT_IMAGE_INFO}" | egrep -o "build_url.*" | grep -q "${branch}"; then
|
if [ "${CI}" != "true" ] && ! echo "${SNAPCRAFT_IMAGE_INFO}" | egrep -o "build_url.*" | grep -q "${branch}"; then
|
||||||
snapcraftctl set-grade "devel"
|
|
||||||
else
|
|
||||||
# Get the latest stable version
|
# Get the latest stable version
|
||||||
runtime_url="https://github.com/kata-containers/runtime"
|
runtime_url="https://github.com/kata-containers/runtime"
|
||||||
branch=$(git ls-remote --tags ${runtime_url} | egrep -o "refs.*" | egrep -v "\-alpha|\-rc|{}" | cut -d/ -f3 | sort -r | head -1)
|
branch=$(git ls-remote --tags ${runtime_url} | egrep -o "refs.*" | egrep -v "\-alpha|\-rc|{}" | egrep -o "[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+" | sort -V -r | head -1)
|
||||||
snapcraftctl set-grade "stable"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
snapcraftctl set-grade "stable"
|
||||||
snapcraftctl set-version "${branch}"
|
snapcraftctl set-version "${branch}"
|
||||||
echo "${branch}" | tee ${SNAPCRAFT_STAGE}/kata_version
|
echo "${branch}" | tee ${SNAPCRAFT_STAGE}/kata_version
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user