From 143f24fde8b93c2a49d7fbde7491de0ae7b60c27 Mon Sep 17 00:00:00 2001 From: Michael Sverdlov Date: Thu, 28 Sep 2023 14:38:01 +0300 Subject: [PATCH] fix build script Signed-off-by: Michael Sverdlov --- build/getcli/jf.sh | 18 ++++++++---------- build/getcli/jfrog.sh | 18 ++++++++---------- build/installcli/jf.sh | 18 ++++++++---------- build/installcli/jfrog.sh | 18 ++++++++---------- build/setupcli/jf.sh | 18 ++++++++---------- 5 files changed, 40 insertions(+), 50 deletions(-) diff --git a/build/getcli/jf.sh b/build/getcli/jf.sh index 7b1f5eeff..65fbc77fa 100644 --- a/build/getcli/jf.sh +++ b/build/getcli/jf.sh @@ -3,9 +3,9 @@ CLI_OS="na" CLI_MAJOR_VER="v2-jf" VERSION="[RELEASE]" +FILE_NAME="jf" -if [ $# -eq 1 ] -then +if [ $# -eq 1 ]; then VERSION=$1 echo "Downloading version $VERSION of JFrog CLI..." else @@ -14,16 +14,15 @@ fi if echo "${OSTYPE}" | grep -q msys; then CLI_OS="windows" - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-windows-amd64/jf.exe" - FILE_NAME="jf.exe" + ARCH="amd64" + FILE_NAME="${FILE_NAME}.exe" elif echo "${OSTYPE}" | grep -q darwin; then CLI_OS="mac" if [[ $(uname -m) == 'arm64' ]]; then - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-arm64/jf" + ARCH="arm64" else - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-386/jf" + ARCH="386" fi - FILE_NAME="jf" else CLI_OS="linux" MACHINE_TYPE="$(uname -m)" @@ -54,9 +53,8 @@ else exit 1 ;; esac - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/jf" - FILE_NAME="jf" fi +URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/${FILE_NAME}" curl -XGET "$URL" -L -k -g > $FILE_NAME -chmod u+x $FILE_NAME +chmod +x $FILE_NAME diff --git a/build/getcli/jfrog.sh b/build/getcli/jfrog.sh index 1debb922e..78188ae52 100644 --- a/build/getcli/jfrog.sh +++ b/build/getcli/jfrog.sh @@ -3,9 +3,9 @@ CLI_OS="na" CLI_MAJOR_VER="v2" VERSION="[RELEASE]" +FILE_NAME="jfrog" -if [ $# -eq 1 ] -then +if [ $# -eq 1 ]; then VERSION=$1 echo "Downloading version $VERSION of JFrog CLI..." else @@ -14,16 +14,15 @@ fi if echo "${OSTYPE}" | grep -q msys; then CLI_OS="windows" - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-windows-amd64/jfrog.exe" - FILE_NAME="jfrog.exe" + ARCH="amd64" + FILE_NAME="${FILE_NAME}.exe" elif echo "${OSTYPE}" | grep -q darwin; then CLI_OS="mac" if [[ $(uname -m) == 'arm64' ]]; then - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-arm64/jfrog" + ARCH="arm64" else - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-386/jfrog" + ARCH="386" fi - FILE_NAME="jfrog" else CLI_OS="linux" MACHINE_TYPE="$(uname -m)" @@ -54,9 +53,8 @@ else exit 1 ;; esac - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/jfrog" - FILE_NAME="jfrog" fi +URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/${FILE_NAME}" curl -XGET "$URL" -L -k -g > $FILE_NAME -chmod u+x $FILE_NAME \ No newline at end of file +chmod +x $FILE_NAME \ No newline at end of file diff --git a/build/installcli/jf.sh b/build/installcli/jf.sh index 6e4ca516b..96f9b8824 100755 --- a/build/installcli/jf.sh +++ b/build/installcli/jf.sh @@ -3,9 +3,9 @@ CLI_OS="na" CLI_MAJOR_VER="v2-jf" VERSION="[RELEASE]" +FILE_NAME="jf" -if [ $# -eq 1 ] -then +if [ $# -eq 1 ]; then VERSION=$1 echo "Downloading version $VERSION of JFrog CLI..." else @@ -15,16 +15,15 @@ echo "" if echo "${OSTYPE}" | grep -q msys; then CLI_OS="windows" - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-windows-amd64/jf.exe" - FILE_NAME="jf.exe" + ARCH="amd64" + FILE_NAME="${FILE_NAME}.exe" elif echo "${OSTYPE}" | grep -q darwin; then CLI_OS="mac" if [[ $(uname -m) == 'arm64' ]]; then - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-arm64/jf" + ARCH="arm64" else - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-386/jf" + ARCH="386" fi - FILE_NAME="jf" else CLI_OS="linux" MACHINE_TYPE="$(uname -m)" @@ -55,12 +54,11 @@ else exit 1 ;; esac - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/jf" - FILE_NAME="jf" fi +URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/${FILE_NAME}" curl -XGET "$URL" -L -k -g > $FILE_NAME -chmod u+x $FILE_NAME +chmod +x $FILE_NAME # Move executable to a destination in path. # Order is by destination priority. diff --git a/build/installcli/jfrog.sh b/build/installcli/jfrog.sh index 77c86b7af..2214ca5c9 100755 --- a/build/installcli/jfrog.sh +++ b/build/installcli/jfrog.sh @@ -3,9 +3,9 @@ CLI_OS="na" CLI_MAJOR_VER="v2" VERSION="[RELEASE]" +FILE_NAME="jfrog" -if [ $# -eq 1 ] -then +if [ $# -eq 1 ]; then VERSION=$1 echo "Downloading version $VERSION of JFrog CLI..." else @@ -15,16 +15,15 @@ echo "" if echo "${OSTYPE}" | grep -q msys; then CLI_OS="windows" - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-windows-amd64/jfrog.exe" - FILE_NAME="jfrog.exe" + ARCH="amd64" + FILE_NAME="${FILE_NAME}.exe" elif echo "${OSTYPE}" | grep -q darwin; then CLI_OS="mac" if [[ $(uname -m) == 'arm64' ]]; then - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-arm64/jfrog" + ARCH="arm64" else - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-386/jfrog" + ARCH="386" fi - FILE_NAME="jfrog" else CLI_OS="linux" MACHINE_TYPE="$(uname -m)" @@ -55,12 +54,11 @@ else exit 1 ;; esac - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/jfrog" - FILE_NAME="jfrog" fi +URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/${FILE_NAME}" curl -XGET "$URL" -L -k -g > $FILE_NAME -chmod u+x $FILE_NAME +chmod +x $FILE_NAME # Move executable to a destination in path. # Order is by destination priority. diff --git a/build/setupcli/jf.sh b/build/setupcli/jf.sh index f6fa02fae..d6cadf4f8 100755 --- a/build/setupcli/jf.sh +++ b/build/setupcli/jf.sh @@ -3,6 +3,7 @@ CLI_OS="na" CLI_MAJOR_VER="v2-jf" VERSION="[RELEASE]" +FILE_NAME="jf" SETUP_COMMAND="jf setup" GREEN_COLOR='\033[0;32m' REMOVE_COLOR='\033[0m' @@ -11,24 +12,22 @@ print_installation_greeting () { echo "${GREEN_COLOR}Thank you for installing JFrog CLI! 🐸 ${REMOVE_COLOR}" } -if [ $# -eq 1 ] -then +if [ $# -eq 1 ]; then SETUP_COMMAND="$SETUP_COMMAND $1" fi echo "Downloading the latest version of JFrog CLI..." if echo "${OSTYPE}" | grep -q msys; then CLI_OS="windows" - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-windows-amd64/jf.exe" - FILE_NAME="jf.exe" + ARCH="amd64" + FILE_NAME="${FILE_NAME}.exe" elif echo "${OSTYPE}" | grep -q darwin; then CLI_OS="mac" if [[ $(uname -m) == 'arm64' ]]; then - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-arm64/jf" + ARCH="arm64" else - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-mac-386/jf" + ARCH="386" fi - FILE_NAME="jf" else CLI_OS="linux" MACHINE_TYPE="$(uname -m)" @@ -59,12 +58,11 @@ else exit 1 ;; esac - URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/jf" - FILE_NAME="jf" fi +URL="https://releases.jfrog.io/artifactory/jfrog-cli/${CLI_MAJOR_VER}/${VERSION}/jfrog-cli-${CLI_OS}-${ARCH}/${FILE_NAME}" curl -XGET "$URL" -L -k -g > $FILE_NAME -chmod u+x $FILE_NAME +chmod +x $FILE_NAME # Move executable to a destination in path. # Order is by destination priority.