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:
parent
bb4bea7d49
commit
aadad07c59
2 changed files with 27 additions and 18 deletions
17
docker-compose.yml
Normal file
17
docker-compose.yml
Normal 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"
|
||||||
28
run-tests.sh
28
run-tests.sh
|
|
@ -1,23 +1,15 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
if test "$1" = "run"
|
# start databases with: docker-compose up
|
||||||
then
|
# then: ./run-tests.sh create
|
||||||
docker run -e ACCEPT_EULA=Y -e SA_PASSWORD=Str0ngP4ssw0rd \
|
# - creates a new database in MySQL for running tests
|
||||||
-p 1433:1433 --name sql-server19 \
|
#
|
||||||
-d mcr.microsoft.com/mssql/server:2019-GA-ubuntu-16.04
|
# test against "all" databases with MySQL JDBC driver:
|
||||||
fi
|
# ./run-tests.sh
|
||||||
if test "$1" = "rm"
|
#
|
||||||
then
|
# test against "all" databases with MariaDB JDBC driver:
|
||||||
docker container rm sql-server19
|
# ./run-tests.sh maria
|
||||||
fi
|
|
||||||
if test "$1" = "start"
|
|
||||||
then
|
|
||||||
docker container start sql-server19
|
|
||||||
fi
|
|
||||||
if test "$1" = "stop"
|
|
||||||
then
|
|
||||||
docker container stop sql-server19
|
|
||||||
fi
|
|
||||||
if test "$1" = "create"
|
if test "$1" = "create"
|
||||||
then
|
then
|
||||||
# assumes you already have a MySQL instance running locally
|
# assumes you already have a MySQL instance running locally
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue