switch to docker-compose for SQL Server

simplifies run-tests.sh and will make it easier
to spin up other testing databases in the future.
This commit is contained in:
Sean Corfield 2022-08-05 15:15:15 -07:00
parent bb4bea7d49
commit aadad07c59
2 changed files with 27 additions and 18 deletions

17
docker-compose.yml Normal file
View file

@ -0,0 +1,17 @@
version: '2'
services:
mysql:
image: percona:5.7
environment:
- MYSQL_ROOT_PASSWORD
ports:
- "3306:3306"
command:
[--character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci]
sqlserver:
image: mcr.microsoft.com/mssql/server:2019-GA-ubuntu-16.04
environment:
ACCEPT_EULA: Y
SA_PASSWORD: Str0ngP4ssw0rd
ports:
- "1433:1433"

View file

@ -1,23 +1,15 @@
#!/bin/sh
if test "$1" = "run"
then
docker run -e ACCEPT_EULA=Y -e SA_PASSWORD=Str0ngP4ssw0rd \
-p 1433:1433 --name sql-server19 \
-d mcr.microsoft.com/mssql/server:2019-GA-ubuntu-16.04
fi
if test "$1" = "rm"
then
docker container rm sql-server19
fi
if test "$1" = "start"
then
docker container start sql-server19
fi
if test "$1" = "stop"
then
docker container stop sql-server19
fi
# start databases with: docker-compose up
# then: ./run-tests.sh create
# - creates a new database in MySQL for running tests
#
# test against "all" databases with MySQL JDBC driver:
# ./run-tests.sh
#
# test against "all" databases with MariaDB JDBC driver:
# ./run-tests.sh maria
if test "$1" = "create"
then
# assumes you already have a MySQL instance running locally