File tree 1 file changed +7
-16
lines changed
1 file changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -41,28 +41,19 @@ jobs:
41
41
MSSQL_SA_PASSWORD : ${{ env.SAPW }}
42
42
MSSQL_PID : Developer
43
43
MSSQL_COLLATION : SQL_Latin1_General_CP1_CI_AS
44
- options :
45
- name : mssql
44
+ options : >-
45
+ --name mssql
46
+ --health-cmd "/opt/mssql-tools/bin/sqlcmd -b -o /dev/null -U sa -P ${MSSQL_SA_PASSWORD} -Q 'SELECT 1;'"
47
+ --health-interval 60s
48
+ --health-timeout 30s
49
+ --health-start-period 20s
50
+ --health-retries 11
46
51
ports :
47
52
- 1433:1433
48
53
49
54
steps :
50
55
- name : show Docker processes
51
56
run : docker ps --all
52
- - name : check that database instance is ready
53
- env :
54
- TMOUT : 60
55
- run : |
56
- for i in `seq ${TMOUT}`; do
57
- sleep 1
58
- docker logs mssql \
59
- | fgrep -n 'SQL Server is now ready for client connections.'
60
- if [ 0 -eq $? ]; then
61
- echo "$(date -u '+%F %T.%N %Z') Info: Successfully detected SQL Server readiness after ${i} seconds"
62
- exit 0
63
- fi
64
- done
65
- echo "$(date -u '+%F %T.%N %Z') Warning: Could not detect SQL Server ready status after ${TMOUT} seconds."
66
57
- name : test connect to database as SA
67
58
env :
68
59
SQLCMDDBNAME : master
You can’t perform that action at this time.
0 commit comments