Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 592ffd7

Browse files
committed
chore: docker wait for sql
1 parent e2b7a13 commit 592ffd7

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
- name: Setup
3838
run: docker-compose up -d
3939

40+
- name: Startup
41+
run: ./docker/wait.sh
42+
4043
- name: Restore
4144
shell: pwsh
4245
run: .\docker\restore.ps1

docker/wait.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# wait for MSSQL server to start
4+
export STATUS=1
5+
i=0
6+
7+
while [[ $STATUS -ne 0 ]] && [[ $i -lt 30 ]]; do
8+
i=$i+1
9+
/opt/mssql-tools/bin/sqlcmd -t 1 -S localhost -U sa -P "Password12!" -Q "SELECT 1" >> /dev/null
10+
STATUS=$?
11+
done
12+
13+
if [ $STATUS -ne 0 ]; then
14+
echo "Error: MSSQL took more than thirty seconds to start up."
15+
exit 1
16+
fi
17+
18+
echo "MSSQL started!"

0 commit comments

Comments
 (0)