Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/startdeps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ runs:
- name: Build the docker-compose stack
if: inputs.module-name == 'openmaqs-database'
shell: bash
run: docker-compose -f docker/MAQSSQLServer/docker-compose.yml -p OpenMAQS/openmaqs-java up -d
run: docker compose -f docker/MAQSSQLServer/docker-compose.yml -p openmaqs-java up -d
20 changes: 10 additions & 10 deletions docker/MAQSSQLServer/initialize_and_start_sqlserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
while [ $not_ready != 0 ]
do
# Wait for the return code of the following statement to be zero
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P globalMAQS2 -d master -Q "SELECT TOP 1 message_id FROM sys.messages"
/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P globalMAQS2 -d master -C -Q "SELECT TOP 1 message_id FROM sys.messages"
not_ready=$?

if [ $not_ready != 0 ]
Expand All @@ -18,17 +18,17 @@

echo "Started initializing database"
# Set up the schema and stored procedures
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P globalMAQS2 -d master -i `dirname $0`/schema.sql
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P globalMAQS2 -d master -i `dirname $0`/stored_procedures.sql
/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -C -P globalMAQS2 -d master -i `dirname $0`/schema.sql
/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -C -P globalMAQS2 -d master -i `dirname $0`/stored_procedures.sql
# Use BCP to import test data
/opt/mssql-tools/bin/bcp GlobalAutomation.dbo.States in "`dirname $0`/SeedData/GlobalAutomation/States.bcp" \
-n -S localhost -U sa -P globalMAQS2
/opt/mssql-tools/bin/bcp GlobalAutomation.dbo.Cities in "`dirname $0`/SeedData/GlobalAutomation/Cities.bcp" \
-n -S localhost -U sa -P globalMAQS2
/opt/mssql-tools/bin/bcp GlobalAutomation.dbo.Datatype in "`dirname $0`/SeedData/GlobalAutomation/Datatype.bcp" \
-n -S localhost -U sa -P globalMAQS2
/opt/mssql-tools18/bin/bcp GlobalAutomation.dbo.States in "`dirname $0`/SeedData/GlobalAutomation/States.bcp" \
-n -u -S localhost -U sa -P globalMAQS2
/opt/mssql-tools18/bin/bcp GlobalAutomation.dbo.Cities in "`dirname $0`/SeedData/GlobalAutomation/Cities.bcp" \
-n -u -S localhost -U sa -P globalMAQS2
/opt/mssql-tools18/bin/bcp GlobalAutomation.dbo.Datatype in "`dirname $0`/SeedData/GlobalAutomation/Datatype.bcp" \
-n -u -S localhost -U sa -P globalMAQS2
echo "Finished initializing database"
}&

# Start SQL server
exec /opt/mssql/bin/sqlservr
exec /opt/mssql/bin/sqlservr