Files
openobserve/downloadO2.sh
T
mmosarafO2 68d7899a79 chore: updated the deployO2 script (#7771)
### **User description**
updated the deployO2 script


___

### **PR Type**
Bug fix


___

### **Description**
- Fix downloads URL path for opensource release


___



<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Bug
fix</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>downloadO2.sh</strong><dd><code>Correct opensource
download URL path</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

downloadO2.sh

<ul><li>Changed URL path from "${BASE_URL}/opensource" to
<br>"${BASE_URL}/openobserve"<br> <li> Ensures correct binary download
URL for opensource release</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7771/files#diff-444c10d9092d83300658d31120b477cfe468c85d2cf28c82de23c254d67c2f64">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___
2025-07-30 19:21:43 +05:30

56 lines
1.4 KiB
Bash

#!/bin/bash
# 1. Set release type based on first argument (default: o2-enterprise)
RELEASE_TYPE=$1
BASE_URL="https://downloads.openobserve.ai/releases"
# 2. Set base URL based on release type
if [ "$RELEASE_TYPE" == "opensource" ]; then
URL="${BASE_URL}/openobserve"
BINARY_NAME="openobserve"
else
URL="${BASE_URL}/o2-enterprise"
BINARY_NAME="openobserve-ee"
fi
# 3. Optional version argument (default: latest)
VERSION=$2
# 4. Detect platform
echo "Detecting platform..."
case "$(uname -s)" in
Linux*) PLATFORM="linux" ;;
Darwin*) PLATFORM="darwin" ;;
CYGWIN*|MINGW32*|MSYS*|MINGW*) PLATFORM="windows" ;;
*) echo "Unsupported platform"; exit 1 ;;
esac
echo "Platform: $PLATFORM"
# 5. Detect architecture
echo "Detecting architecture..."
ARCH=$(uname -m)
case "$ARCH" in
x86_64) ARCH="amd64" ;;
arm64|aarch64) ARCH="arm64" ;;
*) echo "Unsupported architecture"; exit 1 ;;
esac
echo "Architecture: $ARCH"
# 6. Construct file name and URL
FILE_NAME="${BINARY_NAME}-${VERSION}-${PLATFORM}-${ARCH}.tar.gz"
DOWNLOAD_URL="${URL}/${VERSION}/${FILE_NAME}"
echo "Downloading: $DOWNLOAD_URL"
curl -fLo latest_release.tar.gz "$DOWNLOAD_URL"
if [ $? -ne 0 ]; then
echo "Error: Download failed. Make sure the file exists."
exit 1
fi
# 7. Extract and clean up
echo "Extracting..."
tar -xzf latest_release.tar.gz
rm latest_release.tar.gz
echo "✅ Download and extraction complete!"