Skip to content

Commit

Permalink
Migrate to SqlServer 2019
Browse files Browse the repository at this point in the history
  • Loading branch information
javiertuya committed Sep 20, 2024
1 parent 7935975 commit 48be25e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
-e TEST_SQLSERVER_PWD="$TEST_SQLSERVER_PWD" \
-e "ACCEPT_EULA=Y" -e "MSSQL_PID=Developer" \
-v ${GITHUB_WORKSPACE}/setup/sqlserver:/setup.d \
mcr.microsoft.com/mssql/server:2017-latest
mcr.microsoft.com/mssql/server:2019-latest
chmod u+x setup/wait-container-ready.sh && ./setup/wait-container-ready.sh test-sqlserver "SQL Server is now ready for client connections"
# SQLServer does not have an on startup script, run it now
docker exec test-sqlserver bash -c "chmod u+x setup.d/sqlserver-setup.sh && ./setup.d/sqlserver-setup.sh"
Expand Down Expand Up @@ -158,7 +158,7 @@ jobs:
-e TEST_SQLSERVER_PWD="$TEST_SQLSERVER_PWD" \
-e "ACCEPT_EULA=Y" -e "MSSQL_PID=Developer" \
-v ${GITHUB_WORKSPACE}/setup/sqlserver:/setup.d \
mcr.microsoft.com/mssql/server:2017-latest
mcr.microsoft.com/mssql/server:2019-latest
chmod u+x ../setup/wait-container-ready.sh && ../setup/wait-container-ready.sh test-sqlserver "SQL Server is now ready for client connections"
# SQLServer does not have an on startup script, run it now
docker exec test-sqlserver bash -c "chmod u+x setup.d/sqlserver-setup.sh && ./setup.d/sqlserver-setup.sh"
Expand Down
2 changes: 1 addition & 1 deletion setup/container-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ docker run -d -p 1433:1433 --name test-sqlserver --restart unless-stopped \
-e TEST_SQLSERVER_PWD="$TEST_SQLSERVER_PWD" \
-e "ACCEPT_EULA=Y" -e "MSSQL_PID=Developer" \
-v /${PWD}/sqlserver:/setup.d \
mcr.microsoft.com/mssql/server:2017-latest
mcr.microsoft.com/mssql/server:2019-latest
./wait-container-ready.sh test-sqlserver "SQL Server is now ready for client connections"
# SQLServer does not have an on startup script, run it now
docker exec test-sqlserver bash -c "./setup.d/sqlserver-setup.sh"
Expand Down
4 changes: 2 additions & 2 deletions setup/sqlserver/sqlserver-setup.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Execution of sqlserver commands after startup
# A little bit flaky in GitHub, check first connection and wait if fails
echo "-- Try first connection"
if ! /opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U sa -P $TEST_SQLSERVER_PWD -l 30 -Q "select name from sys.databases"; then
if ! /opt/mssql-tools18/bin/sqlcmd -C -S localhost,1433 -U sa -P $TEST_SQLSERVER_PWD -l 30 -Q "select name from sys.databases"; then
echo "Failure to connect from sa, wait some time"
sleep 4
echo "End sleep, going to setup"
#this seems to solve login failure, but sometimes: Error: Process completed with exit code 137.
fi
echo "-- Begin setup"
/opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U sa -P $TEST_SQLSERVER_PWD -l 30 <<-EOSQL
/opt/mssql-tools18/bin/sqlcmd -C -S localhost,1433 -U sa -P $TEST_SQLSERVER_PWD -l 30 <<-EOSQL
CREATE LOGIN tdclirdb WITH PASSWORD = '$TEST_SQLSERVER_PWD', CHECK_POLICY=OFF, CHECK_EXPIRATION=OFF, DEFAULT_LANGUAGE=spanish;
GO
CREATE DATABASE tdclirdb
Expand Down

0 comments on commit 48be25e

Please sign in to comment.