From 5d5f7366d5c568e2e2103fa7a6bce7aaadf6766f Mon Sep 17 00:00:00 2001 From: nathannaveen <42319948+nathannaveen@users.noreply.github.com> Date: Fri, 27 Aug 2021 17:35:45 -0500 Subject: [PATCH] Removed hack/install_kubebuilder.sh * removed hack/install_kubebuilder.sh https://github.com/kubesphere/kubesphere/issues/4187 --- hack/install_kubebuilder.sh | 82 ------------------------------------- 1 file changed, 82 deletions(-) delete mode 100755 hack/install_kubebuilder.sh diff --git a/hack/install_kubebuilder.sh b/hack/install_kubebuilder.sh deleted file mode 100755 index 5dbc89b50..000000000 --- a/hack/install_kubebuilder.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/sh - -# -# This file will be fetched as: curl -L https://git.io/getLatestKubebuilder | sh - -# so it should be pure bourne shell, not bash (and not reference other scripts) -# -# The script fetches the latest kubebuilder release candidate and untars it. -# It lets users to do curl -L https://git.io//getLatestKubebuilder | KUBEBUILDER_VERSION=1.0.5 sh - -# for instance to change the version fetched. - -# Check if the program is installed, otherwise exit -function command_exists () { - if ! [[ -x "$(command -v $1)" ]]; then - echo "Error: $1 program is not installed." >&2 - exit 1 - fi -} - -# Determine OS -OS="$(uname)" -case $OS in - Darwin) - OSEXT="darwin" - ;; - Linux) - OSEXT="linux" - ;; - *) - echo "Only OSX and Linux OS are supported !" - exit 1 - ;; -esac - -HW=$(uname -m) -case $HW in - x86_64) - ARCH=amd64 ;; - aarch64) - ARCH=arm64 ;; - *) - echo "Only x86_64/arm64 machines are supported !" - exit 1 - ;; -esac - -# Check if curl, tar commands/programs exist -command_exists curl -command_exists tar - -KUBEBUILDER_VERSION=v2.3.1 -KUBEBUILDER_VERSION=${KUBEBUILDER_VERSION#"v"} -KUBEBUILDER_VERSION_NAME="kubebuilder_${KUBEBUILDER_VERSION}" -KUBEBUILDER_DIR=/usr/local/kubebuilder - -# Check if folder containing kubebuilder executable exists and is not empty -if [[ -d "$KUBEBUILDER_DIR" ]]; then - if [[ "$(ls -A ${KUBEBUILDER_DIR})" ]]; then - echo "\n/usr/local/kubebuilder folder is not empty. Please delete or backup it before to install ${KUBEBUILDER_VERSION_NAME}" - exit 1 - fi -fi - -TMP_DIR=$(mktemp -d) -pushd $TMP_DIR - -# Downloading Kubebuilder compressed file using curl program -URL="https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${KUBEBUILDER_VERSION}/${KUBEBUILDER_VERSION_NAME}_${OSEXT}_${ARCH}.tar.gz" -echo "Downloading ${KUBEBUILDER_VERSION_NAME}\nfrom $URL\n" -curl -L "$URL"| tar xz -C ${TMP_DIR} - -echo "Downloaded executable files" -ls "${KUBEBUILDER_VERSION_NAME}_${OSEXT}_${ARCH}/bin" - -echo "Moving files to $KUBEBUILDER_DIR folder\n" -mv ${KUBEBUILDER_VERSION_NAME}_${OSEXT}_${ARCH} kubebuilder && sudo mv -f kubebuilder /usr/local/ - -echo "Add kubebuilder to your path; e.g copy paste in your shell and/or edit your ~/.profile file" -echo "export PATH=\$PATH:/usr/local/kubebuilder/bin" -popd -rm -rf ${TMP_DIR} - -export PATH=$PATH:/usr/local/kubebuilder/bin