Skip to content

Commit

Permalink
fix: run install.sh error (#4989)
Browse files Browse the repository at this point in the history
* fix: use '/bin/sh' shebang and remove function key word

* ci: check install.sh in nightly CI
  • Loading branch information
zyy17 authored Nov 13, 2024
1 parent d7c3c8e commit 0089cf1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
14 changes: 14 additions & 0 deletions .github/scripts/check-install-script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

set -e

# Get the latest version of github.com/GreptimeTeam/greptimedb
VERSION=$(curl -s https://api.github.com/repos/GreptimeTeam/greptimedb/releases/latest | jq -r '.tag_name')

echo "Downloading the latest version: $VERSION"

# Download the install script
curl -fsSL https://raw.githubusercontent.com/greptimeteam/greptimedb/main/scripts/install.sh | sh -s $VERSION

# Execute the `greptime` command
./greptime --version
4 changes: 4 additions & 0 deletions .github/workflows/nightly-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check install.sh
run: ./.github/scripts/check-install-script.sh

- name: Run sqlness test
uses: ./.github/actions/sqlness-test
with:
Expand Down
8 changes: 4 additions & 4 deletions scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh

set -ue

Expand All @@ -15,7 +15,7 @@ GITHUB_ORG=GreptimeTeam
GITHUB_REPO=greptimedb
BIN=greptime

function get_os_type() {
get_os_type() {
os_type="$(uname -s)"

case "$os_type" in
Expand All @@ -31,7 +31,7 @@ function get_os_type() {
esac
}

function get_arch_type() {
get_arch_type() {
arch_type="$(uname -m)"

case "$arch_type" in
Expand All @@ -53,7 +53,7 @@ function get_arch_type() {
esac
}

function download_artifact() {
download_artifact() {
if [ -n "${OS_TYPE}" ] && [ -n "${ARCH_TYPE}" ]; then
# Use the latest stable released version.
# GitHub API reference: https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#get-the-latest-release.
Expand Down

0 comments on commit 0089cf1

Please sign in to comment.