Skip to content

Commit

Permalink
ci: fix failed to initialize container mcmoe/mssqldocker:latest
Browse files Browse the repository at this point in the history
  • Loading branch information
iTanken committed Sep 25, 2024
1 parent 00ae8a7 commit 3a958e8
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ jobs:
platform: [ ubuntu-latest ]
runs-on: ubuntu-latest

env:
MSSQL_DB: gorm
MSSQL_USER: gorm
MSSQL_PASSWORD: LoremIpsum86

services:
mssql:
image: mcr.microsoft.com/mssql/server:2022-latest
Expand All @@ -30,7 +25,7 @@ jobs:
ports:
- 9930:1433
options: >-
--health-cmd="/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P LoremIpsum86 -l 30 -Q \"SELECT 1\" || exit 1"
--health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P LoremIpsum86 -N -C -l 30 -Q \"SELECT 1\" || exit 1"
--health-start-period 10s
--health-interval 5s
--health-timeout 10s
Expand All @@ -49,8 +44,8 @@ jobs:
- name: Create gorm database and user in SQL Server
run: |
docker exec $(docker ps --filter "name=sqlserver" --format "{{.Names}}") \
/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P ${MSSQL_PASSWORD} -N -C -l 30 \
-Q "CREATE DATABASE ${MSSQL_DB}; USE ${MSSQL_DB}; CREATE LOGIN ${MSSQL_USER} WITH PASSWORD='${MSSQL_PASSWORD}'; ALTER SERVER ROLE sysadmin ADD MEMBER [${MSSQL_USER}];"
/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P LoremIpsum86 -N -C -l 30 \
-Q "CREATE DATABASE gorm; CREATE LOGIN gorm WITH PASSWORD='LoremIpsum86'; ALTER SERVER ROLE sysadmin ADD MEMBER [gorm];"
# Run build of the application
- name: Run build
Expand Down

0 comments on commit 3a958e8

Please sign in to comment.