Skip to content

Commit 6c426f6

Browse files
committed
Refactored travis builds to test multiple MySQL versions with Docker
1 parent a1bcb7a commit 6c426f6

File tree

5 files changed

+15
-31
lines changed

5 files changed

+15
-31
lines changed

.travis.install-mysql-5.7.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

.travis.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@ php:
66
- '7.0'
77
- '7.1'
88

9-
services:
10-
- mysql
9+
env:
10+
- MYSQL_VERSION=5.6
11+
- MYSQL_VERSION=5.7
12+
- MYSQL_VERSION=8.0
13+
14+
sudo: required
1115

12-
sudo: true
16+
services:
17+
- docker
1318

1419
before_install:
15-
- bash .travis.install-mysql-5.7.sh
16-
- mysql -e 'CREATE DATABASE test;'
20+
- bash ./start_db.sh
21+
- docker ps -a
1722

1823
install: composer install
1924

@@ -27,4 +32,3 @@ after_script:
2732
- php vendor/bin/coveralls -v
2833
- vendor/bin/test-reporter
2934

30-

start_db-5.7.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

start_db-8.0.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

start_db.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/usr/bin/env bash
22

3-
docker run -d --name spatial-mysql \
4-
-p 3306:3306 \
3+
echo "MySQL version: " $MYSQL_VERSION
4+
5+
docker run -d --name spatial-mysql-$MYSQL_VERSION \
6+
-p 127.0.0.1:3306:3306 \
57
-v $(pwd)/db:/var/lib/mysql \
68
-e MYSQL_DATABASE=test \
79
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
8-
mysql:latest
10+
mysql:$MYSQL_VERSION --character-set-server=utf8 --collation-server=utf8_general_ci

0 commit comments

Comments
 (0)