mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 03:38:04 +00:00
Use github api to fetch latest release version (#170)
* Use github api to fetch latest release version * Use grep instead of jq for querying json response Co-authored-by: Harshit Mehta <harshitm@nvidia.com>
This commit is contained in:
@@ -4,14 +4,17 @@
|
|||||||
|
|
||||||
name="helm-dashboard"
|
name="helm-dashboard"
|
||||||
repo="https://github.com/komodorio/${name}"
|
repo="https://github.com/komodorio/${name}"
|
||||||
|
api_repo="https://api.github.com/repos/komodorio/${name}/releases/latest"
|
||||||
|
|
||||||
if [ -n "${HELM_PUSH_PLUGIN_NO_INSTALL_HOOK}" ]; then
|
if [ -n "${HELM_PUSH_PLUGIN_NO_INSTALL_HOOK}" ]; then
|
||||||
echo "Development mode: not downloading versioned release."
|
echo "Development mode: not downloading versioned release."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
version="$(cat plugin.yaml | grep "version" | cut -d '"' -f 2)"
|
version="$(curl -X GET --header \"Accept: application/json\" ${api_repo} | grep '\"name\": "v.*\"' | cut -d 'v' -f 2 | cut -d '"' -f 1)"
|
||||||
# TODO: if no version provided, get it from https://api.github.com/repos/komodorio/helm-dashboard/releases/latest
|
[ -z "$version" ] && {
|
||||||
|
version="$(cat plugin.yaml | grep "version" | cut -d '"' -f 2)"
|
||||||
|
}
|
||||||
echo "Downloading and installing ${name} v${version} ..."
|
echo "Downloading and installing ${name} v${version} ..."
|
||||||
|
|
||||||
url=""
|
url=""
|
||||||
|
|||||||
Reference in New Issue
Block a user