Skip to content

Commit 7c084cc

Browse files
committed
Clean up Travis config
1 parent c7725e6 commit 7c084cc

File tree

5 files changed

+35
-39
lines changed

5 files changed

+35
-39
lines changed

.travis.yml

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,7 @@ language: ruby
22
bundler_args: --without benchmarks development
33
before_install:
44
- gem --version
5-
- |
6-
bash -c " # Install MySQL 5.7 if DB=mysql57
7-
if [[ x$DB =~ mysql57 ]]; then
8-
sudo bash .travis_mysql57.sh
9-
fi
10-
"
11-
- |
12-
bash -c " # Install MariaDB if DB=mariadb
13-
if [[ x$DB =~ xmariadb ]]; then
14-
sudo bash .travis_mariadb.sh '$DB'
15-
fi
16-
"
17-
- |
18-
bash -c " # Install MySQL if OS=darwin
19-
if [[ x$OSTYPE =~ ^xdarwin ]]; then
20-
brew install mysql
21-
mysql.server start
22-
fi
23-
"
24-
- |
25-
bash -c " # Configure SSL support
26-
if [[ ! x$OSTYPE =~ ^xdarwin ]]; then
27-
sudo bash .travis_ssl.sh
28-
sudo service mysql restart
29-
fi
30-
"
5+
- bash .travis_setup.sh
316
- mysqld --version
327
- mysql -u root -e "CREATE DATABASE IF NOT EXISTS test"
338
- mysql -u root -e "CREATE USER '$USER'@'localhost'" || true

.travis_mariadb.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
2+
3+
set -eu
24

35
service mysql stop
46
apt-get purge '^mysql*' 'libmysql*'
5-
apt-get install python-software-properties
67
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
78

89
if [[ x$1 = xmariadb55 ]]; then

.travis_mysql57.sh

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

3-
service mysql stop
3+
set -eu
44

5+
service mysql stop
56
apt-get purge '^mysql*' 'libmysql*'
6-
apt-get autoclean
7-
8-
rm -rf /var/lib/mysql
9-
rm -rf /var/log/mysql
10-
11-
apt-get install python-software-properties
127
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x8C718D3B5072E1F5
8+
139
add-apt-repository 'deb http://repo.mysql.com/apt/ubuntu/ precise mysql-5.7-dmr'
1410

1511
apt-get update

.travis_setup.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
5+
# Install MySQL 5.7 if DB=mysql57
6+
if [[ -n ${DB-} && x$DB =~ mysql57 ]]; then
7+
sudo bash .travis_mysql57.sh
8+
fi
9+
10+
# Install MariaDB if DB=mariadb
11+
if [[ -n ${DB-} && x$DB =~ xmariadb ]]; then
12+
sudo bash .travis_mariadb.sh "$DB"
13+
fi
14+
15+
# Install MySQL if OS=darwin
16+
if [[ x$OSTYPE =~ ^xdarwin ]]; then
17+
brew install mysql
18+
mysql.server start
19+
fi
20+
21+
# TODO: get SSL working on OS X in Travis
22+
if ! [[ x$OSTYPE =~ ^xdarwin ]]; then
23+
sudo bash .travis_ssl.sh
24+
sudo service mysql restart
25+
fi

.travis_ssl.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22

3-
# Halt the tests on error
4-
set -e
3+
set -eu
54

65
# Wherever MySQL configs live, go there (this is for cross-platform)
76
cd $(my_print_defaults --help | grep my.cnf | xargs find 2>/dev/null | xargs dirname)

0 commit comments

Comments
 (0)