Skip to content

Commit

Permalink
docs: get the latest formal version, and delete deprecated install&un…
Browse files Browse the repository at this point in the history
…install sh
  • Loading branch information
healthjyk committed Dec 27, 2023
1 parent 4e27fe9 commit 1926779
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 357 deletions.
314 changes: 0 additions & 314 deletions static/scripts/deprecated-install-kusion.sh

This file was deleted.

33 changes: 0 additions & 33 deletions static/scripts/deprecated-install.sh

This file was deleted.

12 changes: 5 additions & 7 deletions static/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh

# ------------------------------------------------------------
# Copyright 2022 The KusionStack Authors
Expand All @@ -17,7 +17,6 @@

set -o errexit
set -o nounset
set -o pipefail

# Sudo is required to copy binary to KUSION_HOME_DIR
USE_SUDO=${USE_SUDO:-"false"}
Expand Down Expand Up @@ -129,22 +128,21 @@ toInstallVersion() {
fi
}

# todo: only va.b.c is formal release tag, now support all version
getLatestReleaseVersion() {
local KusionReleaseURL="${RELEASE_URL}"
local latest_release=""

if [ "$KUSION_HTTP_REQUEST_CLI" == "curl" ]; then
latest_release=$(runAsRoot curl -s $KusionReleaseURL | grep \"tag_name\" | awk 'NR==1{print $2}' | sed -n 's/\"\(.*\)\",/\1/p')
latest_release=$(runAsRoot curl -s $KusionReleaseURL | grep \"tag_name\" | awk '{print $2}' | sed -n 's/\"\(.*\)\",/\1/p' | grep -o '^v[0-9]\+\.[0-9]\+\.[0-9]\+$' | head -n 1)
else
latest_release=$(runAsRoot wget -q --header="Accept: application/json" -O - $KusionReleaseURL | grep \"tag_name\" | awk 'NR==1{print $2}' | sed -n 's/\"\(.*\)\",/\1/p')
latest_release=$(runAsRoot wget -q --header="Accept: application/json" -O - $KusionReleaseURL | grep \"tag_name\" | awk '{print $2}' | sed -n 's/\"\(.*\)\",/\1/p' | grep -o '^v[0-9]\+\.[0-9]\+\.[0-9]\+$' | head -n 1)
fi

echo "${latest_release:1}"
}

download() {
local kusion_version="$1"
local kusion_version="$1"
local kusion_tag="v${kusion_version}"
KUSION_CLI_ARTIFACT="${KUSION_CLI}_${kusion_version}_${OS}_${ARCH}.tar.gz"
DOWNLOAD_URL="${DOWNLOAD_BASE}/${kusion_tag}/${KUSION_CLI_ARTIFACT}"
Expand Down Expand Up @@ -210,7 +208,7 @@ install() {
# move from tmp dir to kusion home
runAsRoot mv "$KUSION_TMP_ROOT" "$KUSION_HOME_DIR"
if [ ! -f "$KUSION_CLI_FILE_PATH" ]; then
error "Failed to move binary from tmp folder, $KUSION_CLI_FILE_PATH does not exists."
error "Failed to move binary from tmp folder, $KUSION_CLI_FILE_PATH does not exist."
return 1
fi

Expand Down
Loading

0 comments on commit 1926779

Please sign in to comment.