-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall_preview.sh
More file actions
52 lines (45 loc) · 1.32 KB
/
install_preview.sh
File metadata and controls
52 lines (45 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# Identify the system's OS and architecture
OS=$(uname -s) # Linux or Darwin
ARCH=$(uname -m) # arm64(on Darwin) or x86_64(on Linux or Darwin) or aarch64(on Linux)
# normalize the OS and ARCH
case $OS in
"Darwin")
OS="darwin"
;;
"Linux")
OS="linux"
;;
*)
esac
case $ARCH in
"x86_64")
ARCH="amd64"
;;
"arm64" | "aarch64")
ARCH="arm64"
;;
*)
esac
# Binary file name
BINARY_FILE="timeplus-enterprise.tar.gz"
# Download URL
DOWNLOAD_URL="https://install.timeplus.com/preview-${OS}-${ARCH}.tar.gz"
# Download the binary
echo "Downloading $DOWNLOAD_URL..."
# Download the file and capture the HTTP status code
HTTP_STATUS=$(curl -L -w "%{http_code}" -o "$BINARY_FILE" "$DOWNLOAD_URL")
# Check if the HTTP status code indicates success (200)
if [ "$HTTP_STATUS" -eq 200 ]; then
echo "\nDownload complete. Extracting package..."
tar xfv $BINARY_FILE
cd timeplus/bin
echo "\nStarting Timeplus Enterprise (Technical Preview)..."
./timeplus start
echo "\nSuccessfully downloaded and started Timeplus Enterprise."
echo "Please check the documentation at https://docs.timeplus.com/timeplus-self-host"
else
rm $BINARY_FILE
echo "Bare metal package for $OS-$ARCH is not available yet. Please check Timeplus docs to install via Docker. (HTTP status code: $HTTP_STATUS)" >&2
exit 1
fi