forked from julien-duponchelle/python-mysql-replication
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
60 lines (51 loc) · 2.26 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "pypy"
install:
- "pip install ."
- "pip install nose"
cache: apt
before_script:
# Remove old mysql version
- "sudo /etc/init.d/mysql stop || true"
- "sudo apt-get remove mysql-common mysql-server-5.5 mysql-server-core-5.5 mysql-client-5.5 mysql-client-core-5.5"
- "sudo apt-get autoremove"
# Config
- "sudo sed -i'' 's/table_cache/table_open_cache/' /etc/mysql/my.cnf"
- "sudo sed -i'' 's/log_slow_queries/slow_query_log/' /etc/mysql/my.cnf"
# Install new mysql version
- "echo deb http://repo.mysql.com/apt/ubuntu/ precise mysql-5.6 | sudo tee /etc/apt/sources.list.d/mysql.list"
- "sudo apt-key add .mysql/dev.mysql.com.gpg.key"
- "sudo apt-get update"
- "sudo env DEBIAN_FRONTEND=noninteractive apt-get install -o Dpkg::Options::='--force-confold' -q -y mysql-server"
# Cleanup old mysql datas
- "sudo rm -rf /var/ramfs/mysql/"
- "sudo mkdir /var/ramfs/mysql/"
- "sudo chown mysql: /var/ramfs/mysql/"
# Config
- "echo '[mysqld]' | sudo tee /etc/mysql/conf.d/replication.cnf"
- "echo 'log-bin=mysql-bin' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
- "echo 'server-id=1' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
- "echo 'binlog-format = row' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
- "sudo /etc/init.d/mysql stop || true"
# Install new datas
- "sudo mysql_install_db --defaults-file=/etc/mysql/my.cnf --basedir=/usr --datadir=/var/ramfs/mysql --verbose"
# Enable GTID
- "echo '[mysqld]' | sudo tee /etc/mysql/conf.d/gtid.cnf"
- "echo 'gtid_mode=ON' | sudo tee -a /etc/mysql/conf.d/gtid.cnf"
- "echo 'enforce_gtid_consistency' | sudo tee -a /etc/mysql/conf.d/gtid.cnf"
- "echo 'binlog_format=ROW' | sudo tee -a /etc/mysql/conf.d/gtid.cnf"
- "echo 'log_slave_updates' | sudo tee -a /etc/mysql/conf.d/gtid.cnf"
# Start mysql (avoid errors to have logs)
- "sudo /etc/init.d/mysql start || true"
- "sudo tail -1000 /var/log/syslog"
- "mysql --version"
- "mysql -e 'SELECT VERSION();'"
- "mysql -u root -e \"GRANT ALL PRIVILEGES ON *.* TO ''@'localhost';\""
- "mysql -e 'CREATE DATABASE pymysqlreplication_test;'"
script:
- "nosetests"