Skip to content

Commit

Permalink
cleanup: install the latest release version
Browse files Browse the repository at this point in the history
Signed-off-by: richardli1598 <opennaslab@gmail.com>
  • Loading branch information
richardli1598 committed Feb 25, 2024
1 parent 1055372 commit 452825d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 1 addition & 4 deletions hack/install_kubespider.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ if [[ $(docker ps | grep aria2-pro) == "" ]]; then
fi

# 7.Deploy kubespider
export KUBESPIDER_DEFAULT_VERSION="latest"
if [[ -z "${KUBESPIDER_VERSION}" ]]; then
export KUBESPIDER_VERSION=${KUBESPIDER_DEFAULT_VERSION}
fi
export KUBESPIDER_VERSION=${KUBESPIDER_VERSION:-$(util::get_latest_release_version)}
docker run -itd --name kubespider \
--log-opt max-size=5m \
-v ${KUBESPIDER_HOME}/kubespider/.config:/app/.config \
Expand Down
1 change: 1 addition & 0 deletions hack/test/deploy_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function handle_trap() {
trap handle_trap ERR EXIT

#1. Test deploy Kubespider
export KUBESPIDER_VERSION=latest
./hack/install_kubespider.sh
sleep 10
docker ps | grep -e kubespider -e aria2-pro
Expand Down
4 changes: 4 additions & 0 deletions hack/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ function util::set_registry_for_image() {
export image_registry=index.docker.io/cesign
fi
}

function util::get_latest_release_version() {
curl --silent https://api.github.com/repos/opennaslab/kubespider/tags | grep -o '"name": "[^"]*' | cut -d'"' -f4 | head -n1
}

0 comments on commit 452825d

Please sign in to comment.