Created
April 13, 2015 14:49
-
-
Save mahemoff/54b31e272421472d4fb6 to your computer and use it in GitHub Desktop.
MySQL 5.6 in CircleCI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies: | |
post: | |
- export DEBIAN_FRONTEND=noninteractive | |
- sudo apt-get -y remove mysql-server | |
- sudo apt-get -y autoremove | |
- sudo apt-get -y install software-properties-common | |
- sudo add-apt-repository -y ppa:ondrej/mysql-5.6 | |
- sudo apt-get update | |
- sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password ""' | |
- sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password ""' | |
- sudo apt-get -y install mysql-server |
CircleCI also has official
instructions here: https://circleci.com/docs/faq#how-do-i-use-mysql-5-6
I replaced
sudo add-apt-repository -y ppa:ondrej/mysql-5.6
by
sudo apt-add-repository -y 'deb http://ppa.launchpad.net/ondrej/mysql-experimental/ubuntu precise main'
and reformatted to:
dependencies:
pre:
# installing mysql 5.6 (5.5 is installed by default)
- >
export DEBIAN_FRONTEND=noninteractive
&& sudo apt-get -y remove mysql-server && sudo apt-get -y autoremove
&& sudo apt-get -y install software-properties-common
&& sudo apt-add-repository -y 'deb http://ppa.launchpad.net/ondrej/mysql-experimental/ubuntu precise main'
&& sudo apt-get update
&& sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password ""'
&& sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password ""'
&& sudo apt-get -y install mysql-server
to avoid having many steps in circleci.
Running this in CircleCI adds atleast 40 seconds to my build times, does anyone know of a way to cache this install?
I've asked their support. They don't have a way.
Hi there,
The code above didn't work because apt would get a bunch of 404 errors.
This worked for me:
machine:
pre:
# Install MySQL 5.6 (5.5 is installed by default)
- >
export DEBIAN_FRONTEND=noninteractive
&& sudo apt-get update -y; true
&& sudo apt-get -y remove mysql-server
&& sudo apt-get -y autoremove
&& sudo apt-get -y install software-properties-common
&& sudo apt-add-repository -y 'deb http://ppa.launchpad.net/ondrej/mysql-experimental/ubuntu precise main'
&& sudo apt-get update -y; true
&& sudo apt-get -y install mysql-server
&& sudo chown -R mysql:mysql /var/lib/mysql
Hi all,
I took the code from @eexit and change a couple of lines because it wasn't working on my builds, here is my successful attempt, hope it helps.
machine:
pre:
- sudo apt-get update -y; true
- sudo apt-get -y remove mysql-server
- sudo apt-get -y install software-properties-common
- sudo apt-add-repository -y 'deb http://ppa.launchpad.net/ondrej/mysql-experimental/ubuntu precise main'
- sudo apt-get update -y; true
- export DEBIAN_FRONTEND=noninteractive && sudo -E apt-get -y install mysql-server
- sudo chown -R mysql:mysql /var/lib/mysql
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Background: I migrated to millisecond-precision timestamps which broke Circle. Upgrading to Maria on Circle proved to be a pain due to this MySQL gem problem so I compromised with MySQL 5.6 upgrade as above. Fortunately the gem works seamlessly.