Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced MySQL 5.7 installed from a PPA with an official Docker image #3465

Merged
merged 1 commit into from
Feb 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
env: DB=mysql COVERAGE=yes
- stage: Test
php: 7.2
env: DB=mysql MYSQL_VERSION=5.7 COVERAGE=yes
env: DB=mysql.docker MYSQL_VERSION=5.7 COVERAGE=yes
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
Expand All @@ -82,7 +82,7 @@ jobs:
env: DB=mysqli COVERAGE=yes
- stage: Test
php: 7.2
env: DB=mysqli MYSQL_VERSION=5.7 COVERAGE=yes
env: DB=mysqli.docker MYSQL_VERSION=5.7 COVERAGE=yes
sudo: required
before_script:
- bash ./tests/travis/install-mysql-5.7.sh
Expand Down
25 changes: 9 additions & 16 deletions tests/travis/install-mysql-5.7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,14 @@

set -ex

echo "Installing MySQL 5.7..."
echo "Starting MySQL 5.7..."

sudo service mysql stop
sudo apt-get remove "^mysql.*"
sudo apt-get autoremove
sudo apt-get autoclean
echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7 | sudo debconf-set-selections
wget http://dev.mysql.com/get/mysql-apt-config_0.8.9-1_all.deb
sudo DEBIAN_FRONTEND=noninteractive dpkg -i mysql-apt-config_0.8.9-1_all.deb
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get clean
sudo apt-get update -q
sudo apt-get install -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" mysql-server libmysqlclient-dev
sudo mysql_upgrade

echo "Restart mysql..."
sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
sudo docker run \
-d \
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
-e MYSQL_DATABASE=doctrine_tests \
-p 33306:3306 \
--name mysql57 \
mysql:5.7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should a fixed 5.7 version/tag be used here or does the build always have to use the newest 5.7 version? I don't expect problems though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the same for all other images except for DB2 (not sure if it was tagged deliberately). Unless stability issues start showing up, I think testing against the latest is fine.


sudo docker exec -i mysql57 bash <<< 'until echo \\q | mysql doctrine_tests > /dev/null 2>&1 ; do sleep 1; done'