Feat: support m1 install vela script (#457)

Signed-off-by: Yin Da <yd219913@alibaba-inc.com>
This commit is contained in:
Somefive 2022-01-20 11:36:56 +08:00 committed by GitHub
parent 875f7857fa
commit 4e352e60d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 9 deletions

View File

@ -30,14 +30,15 @@ getSystemInfo() {
OS=$(echo `uname`|tr '[:upper:]' '[:lower:]')
# Most linux distro needs root permission to copy the file to /usr/local/bin
if [ "$OS" == "linux" ] && [ "$VELA_INSTALL_DIR" == "/usr/local/bin" ]; then
if [ "$OS" == "linux" ] || [ "$OS" == "darwin" ]; then
if [ "$KUBECTL_VELA_INSTALL_DIR" == "/usr/local/bin" ]; then
USE_SUDO="true"
fi
fi
}
verifySupported() {
local supported=(darwin-amd64 linux-amd64 linux-arm linux-arm64)
local supported=(darwin-amd64 darwin-arm64 linux-amd64 linux-arm linux-arm64)
local current_osarch="${OS}-${ARCH}"
for osarch in "${supported[@]}"; do
@ -75,7 +76,7 @@ checkHttpRequestCLI() {
checkExistingKubectlVela() {
if [ -f "$KUBECTL_VELA_CLI_FILE" ]; then
echo -e "\nKubectl-Vela CLI is detected:"
$KUBECTL_VELA_CLI_FILE --version
$KUBECTL_VELA_CLI_FILE version
echo -e "Reinstalling Kubectl-Vela CLI - ${KUBECTL_VELA_CLI_FILE}...\n"
else
echo -e "Installing Kubectl-Vela CLI...\n"

View File

@ -31,13 +31,15 @@ getSystemInfo() {
OS=$(echo `uname`|tr '[:upper:]' '[:lower:]')
# Most linux distro needs root permission to copy the file to /usr/local/bin
if [ "$OS" == "linux" ] && [ "$VELA_INSTALL_DIR" == "/usr/local/bin" ]; then
if [ "$OS" == "linux" ] || [ "$OS" == "darwin" ]; then
if [ "$VELA_INSTALL_DIR" == "/usr/local/bin" ]; then
USE_SUDO="true"
fi
fi
}
verifySupported() {
local supported=(darwin-amd64 linux-amd64 linux-arm linux-arm64)
local supported=(darwin-amd64 darwin-arm64 linux-amd64 linux-arm linux-arm64)
local current_osarch="${OS}-${ARCH}"
for osarch in "${supported[@]}"; do
@ -75,7 +77,7 @@ checkHttpRequestCLI() {
checkExistingVela() {
if [ -f "$VELA_CLI_FILE" ]; then
echo -e "\nVela CLI is detected:"
$VELA_CLI_FILE --version
$VELA_CLI_FILE version
echo -e "Reinstalling Vela CLI - ${VELA_CLI_FILE}...\n"
else
echo -e "Installing Vela CLI...\n"