Skip to content

Commit 3da73c6

Browse files
Backport to branch(3.12) : Fix CI issue of SQL Server (Check if the command exsits) (#2161)
Co-authored-by: kota2and3kan <[email protected]>
1 parent b389320 commit 3da73c6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ci/no-superuser/create-no-superuser-sqlserver.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
set -ue
2+
set -u
33

44
# Get container name and password from arguments
55
SQL_SERVER_CONTAINER_NAME=$1
@@ -8,9 +8,12 @@ MAX_RETRY_COUNT=$3
88
RETRY_INTERVAL=$4
99
COUNT=0
1010

11-
if [[ "$SQL_SERVER_CONTAINER_NAME" = "sqlserver22" ]]; then
11+
# Check if the `/opt/mssql-tools18/bin/sqlcmd` command exists or not.
12+
docker exec -t ${SQL_SERVER_CONTAINER_NAME} ls /opt/mssql-tools18/bin/sqlcmd
13+
if [[ $? -eq 0 ]]; then
1214
SQLCMD=/opt/mssql-tools18/bin/sqlcmd
1315
else
16+
# If there is no `/opt/mssql-tools18/bin/sqlcmd` command, we use old command.
1417
SQLCMD=/opt/mssql-tools/bin/sqlcmd
1518
fi
1619

0 commit comments

Comments
 (0)