Skip to content

fix the download url in install script #1397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 1, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 49 additions & 8 deletions scripts/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
# supported CPU architectures and operating systems
SUPPORTED_ARCH=("x86_64" "arm64")
SUPPORTED_OS=("linux" "darwin")
DOWNLOAD_BASE_URL="cdn.parseable.com/"
DOWNLOAD_BASE_URL="https://github.com/parseablehq/parseable/releases/download"
ARM_APPLE_PREFIX="Parseable_OSS_aarch64-apple-darwin"
INTEL_APPLE_PREFIX="Parseable_OSS_x86_64-apple-darwin"
ARM_LINUX_PREFIX="Parseable_OSS_aarch64-unknown-linux-gnu"
INTEL_LINUX_PREFIX="Parseable_OSS_x86_64-unknown-linux-gnu"
INTEL_WINDOWS_PREFIX="Parseable_OSS_x86_64-pc-windows-msvc.exe"
PARSEABLE_PREFIX=${ARM_APPLE_PREFIX}

# Get the system's CPU architecture and operating system
CPU_ARCH=$(uname -m)
Expand Down Expand Up @@ -35,9 +41,45 @@ fi
release=$(curl -s "https://api.github.com/repos/parseablehq/parseable/releases/latest")
# find the release tag
release_tag=$(echo "$release" | grep -o "\"tag_name\":\s*\"[^\"]*\"" | cut -d '"' -f 4)
printf "Found latest release version: $release_tag\n"
if [[ -z "$release_tag" ]]; then
echo "Error: Could not determine the latest release version."
exit 1
fi

download_url=${DOWNLOAD_BASE_URL}${CPU_ARCH}-${OS}.${release_tag}
printf "Latest Parseable version: $release_tag\n"

# Determine the appropriate binary prefix based on OS and CPU architecture
if [[ "$OS" == "darwin" ]]; then
if [[ "$CPU_ARCH" == "arm64" ]]; then
PARSEABLE_PREFIX=${ARM_APPLE_PREFIX}
elif [[ "$CPU_ARCH" == "x86_64" ]]; then
PARSEABLE_PREFIX=${INTEL_APPLE_PREFIX}
else
echo "Error: Unsupported CPU architecture for macOS (${CPU_ARCH})."
exit 1
fi
elif [[ "$OS" == "linux" ]]; then
if [[ "$CPU_ARCH" == "arm64" ]]; then
PARSEABLE_PREFIX=${ARM_LINUX_PREFIX}
elif [[ "$CPU_ARCH" == "x86_64" ]]; then
PARSEABLE_PREFIX=${INTEL_LINUX_PREFIX}
else
echo "Error: Unsupported CPU architecture for Linux (${CPU_ARCH})."
exit 1
fi
elif [[ "$OS" == "windows" ]]; then
if [[ "$CPU_ARCH" == "x86_64" ]]; then
PARSEABLE_PREFIX=${INTEL_WINDOWS_PREFIX}
else
echo "Error: Unsupported CPU architecture for Windows (${CPU_ARCH})."
exit 1
fi
else
echo "Error: Unsupported operating system (${OS})."
exit 1
fi

download_url=${DOWNLOAD_BASE_URL}/${release_tag}/${PARSEABLE_PREFIX}

if [[ -d ${INSTALL_DIR} ]]; then
printf "A Previous version of parseable already exists. Run 'parseable --version' to check the version."
Expand All @@ -48,22 +90,21 @@ else
fi

# Download the binary using curl or wget
printf "Downloading Parseable version $release_tag, for OS: $OS, CPU architecture: $CPU_ARCH\n\n"
printf "Downloading Parseable version $release_tag, for OS: $OS, CPU architecture: $CPU_ARCH\n"
printf "Download URL: $download_url\n\n"

if command -v curl &>/dev/null; then
curl -L -o "${BIN_NAME}" "$download_url"
elif command -v wget &>/dev/null; then
wget -O "${BIN_NAME}" "$download_url"
else
echo "Error: Neither curl nor wget found. Please install either curl or wget."
exit 1
fi

printf "Parseable Server was successfully installed at: ${BIN_NAME}\n"

chmod +x "${BIN_NAME}"

printf "Adding parseable to the path\n"
PATH_STR="export PATH=${BIN_DIR}"':$PATH'
echo ${PATH_STR} >> ${RC_FILE_PATH}

echo "parseable was added to the path. Please refresh the environment by sourcing the ${RC_FILE_PATH}"
source ${RC_FILE_PATH}
Loading