Update check-version.sh script
This commit is contained in:
+4
-7
@@ -1,13 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Gitlab repository
|
# Git repository
|
||||||
REPO="libvirt/libvirt"
|
REPO="https://gitlab.com/libvirt/libvirt.git"
|
||||||
|
|
||||||
# Replace slash with URL encoded representation
|
# Get tag name using 'git ls-remote'
|
||||||
REPO=$(echo "$REPO" | sed 's|/|%2F|g')
|
TAG_NAME=$(git ls-remote --exit-code --refs --tags --sort='v:refname' "$REPO" | cut -d'/' -f3 | grep -E '^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$' | tail -n1)
|
||||||
|
|
||||||
# Get tag name using Gitlab Rest API
|
|
||||||
TAG_NAME=$(curl -s -L https://gitlab.com/api/v4/projects/"$REPO"/repository/tags | jq -r '.[].name' | grep '^v' | grep -v 'rc' | head -n1)
|
|
||||||
|
|
||||||
# Trim 'v' character in TAG_NAME variable
|
# Trim 'v' character in TAG_NAME variable
|
||||||
VERSION=$(echo "$TAG_NAME" | tr -d 'v')
|
VERSION=$(echo "$TAG_NAME" | tr -d 'v')
|
||||||
|
|||||||
Reference in New Issue
Block a user