From 8fc8cb98ab9b1b9a6a3373db7e05264a8b1c7d1f Mon Sep 17 00:00:00 2001 From: Zhou Cheng Date: Wed, 1 Jan 2025 15:23:57 +0800 Subject: [PATCH] CI: fix install tidb as root. (#5490) --- .github/scripts/start_meta_engine.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/scripts/start_meta_engine.sh b/.github/scripts/start_meta_engine.sh index feb5a6aa7d50..d7e7ffa1998f 100755 --- a/.github/scripts/start_meta_engine.sh +++ b/.github/scripts/start_meta_engine.sh @@ -59,16 +59,19 @@ install_tikv(){ } install_tidb(){ - curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh user=$(whoami) - if [ "$user" == "root" ]; then + echo user is $user + if [[ "$user" == "root" ]]; then + curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sudo sh tiup=/root/.tiup/bin/tiup - elif [ "$user" == "runner" ]; then + elif [[ "$user" == "runner" ]]; then + curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh tiup=/home/runner/.tiup/bin/tiup else echo "Unknown user $user" exit 1 fi + echo tiup is $tiup $tiup playground 5.4.0 > tidb.log 2>&1 & pid=$!