From cdaea7a4062c463e9536b3ca52207c013d8af408 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 15 Oct 2013 16:28:59 +0200 Subject: [ticket/11920] Add MariaDB environment to Travis-CI. PHPBB3-11920 --- travis/setup-mariadb.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 travis/setup-mariadb.sh (limited to 'travis/setup-mariadb.sh') diff --git a/travis/setup-mariadb.sh b/travis/setup-mariadb.sh new file mode 100755 index 0000000000..68359e400a --- /dev/null +++ b/travis/setup-mariadb.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# @copyright (c) 2013 phpBB Group +# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +# +set -e + +# MariaDB Series +VERSION='5.5' + +# Operating system codename, e.g. "precise" +OS_CODENAME=$(lsb_release --codename --short) + +if ! which add-apt-repository > /dev/null +then + sudo apt-get update -qq + sudo apt-get install -qq python-software-properties +fi + +sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db +sudo add-apt-repository "deb http://ftp.osuosl.org/pub/mariadb/repo/$VERSION/ubuntu $OS_CODENAME main" +sudo apt-get update -qq + +sudo debconf-set-selections <<< "mariadb-server-$VERSION mysql-server/root_password password rootpasswd" +sudo debconf-set-selections <<< "mariadb-server-$VERSION mysql-server/root_password_again password rootpasswd" +sudo apt-get install -qq mariadb-server -- cgit v1.2.1 From 55e24eb4f87523c83e74a7174555a48b2a90b7a7 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 15 Oct 2013 16:57:16 +0200 Subject: [ticket/11920] Have to use empty root password otherwise db creation fails. PHPBB3-11920 --- travis/setup-mariadb.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'travis/setup-mariadb.sh') diff --git a/travis/setup-mariadb.sh b/travis/setup-mariadb.sh index 68359e400a..2e974da8eb 100755 --- a/travis/setup-mariadb.sh +++ b/travis/setup-mariadb.sh @@ -24,3 +24,10 @@ sudo apt-get update -qq sudo debconf-set-selections <<< "mariadb-server-$VERSION mysql-server/root_password password rootpasswd" sudo debconf-set-selections <<< "mariadb-server-$VERSION mysql-server/root_password_again password rootpasswd" sudo apt-get install -qq mariadb-server + +# Set root password to empty string. +echo " +USE mysql; +UPDATE user SET Password = PASSWORD('') where User = 'root'; +FLUSH PRIVILEGES; +" | mysql -u root -prootpasswd -- cgit v1.2.1 From 0f64f0edc409ecea94159bb365b7f7efbd311195 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 16 Oct 2013 00:24:44 +0200 Subject: [ticket/11920] Manually purge mysql-common. PHPBB3-11920 --- travis/setup-mariadb.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'travis/setup-mariadb.sh') diff --git a/travis/setup-mariadb.sh b/travis/setup-mariadb.sh index 2e974da8eb..6742d27263 100755 --- a/travis/setup-mariadb.sh +++ b/travis/setup-mariadb.sh @@ -11,6 +11,9 @@ VERSION='5.5' # Operating system codename, e.g. "precise" OS_CODENAME=$(lsb_release --codename --short) +# Manually purge MySQL to remove conflicting files (e.g. /etc/mysql/my.cnf) +sudo apt-get purge -qq mysql-common + if ! which add-apt-repository > /dev/null then sudo apt-get update -qq -- cgit v1.2.1 From 5a481bb1763477edbacf530de7c64a729a796084 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 16 Oct 2013 00:25:07 +0200 Subject: [ticket/11920] Print MariaDB version after successful setup. PHPBB3-11920 --- travis/setup-mariadb.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'travis/setup-mariadb.sh') diff --git a/travis/setup-mariadb.sh b/travis/setup-mariadb.sh index 6742d27263..02520b1c2c 100755 --- a/travis/setup-mariadb.sh +++ b/travis/setup-mariadb.sh @@ -34,3 +34,5 @@ USE mysql; UPDATE user SET Password = PASSWORD('') where User = 'root'; FLUSH PRIVILEGES; " | mysql -u root -prootpasswd + +mysql --version -- cgit v1.2.1 From acc6e440d019787f3f0aaedd775576805e6fc76d Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 25 Oct 2013 13:20:09 +0200 Subject: [ticket/11920] Pin MariaDB repository to avoid conflicts with Ubuntu MySQL. PHPBB3-11920 --- travis/setup-mariadb.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'travis/setup-mariadb.sh') diff --git a/travis/setup-mariadb.sh b/travis/setup-mariadb.sh index 02520b1c2c..d9a88edb24 100755 --- a/travis/setup-mariadb.sh +++ b/travis/setup-mariadb.sh @@ -20,10 +20,20 @@ then sudo apt-get install -qq python-software-properties fi +MIRROR_DOMAIN='ftp.osuosl.org' sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db -sudo add-apt-repository "deb http://ftp.osuosl.org/pub/mariadb/repo/$VERSION/ubuntu $OS_CODENAME main" +sudo add-apt-repository "deb http://$MIRROR_DOMAIN/pub/mariadb/repo/$VERSION/ubuntu $OS_CODENAME main" sudo apt-get update -qq +# Pin repository in order to avoid conflicts with MySQL from distribution +# repository. See https://mariadb.com/kb/en/installing-mariadb-deb-files +# section "Version Mismatch Between MariaDB and Ubuntu/Debian Repositories" +echo " +Package: * +Pin: origin $MIRROR_DOMAIN +Pin-Priority: 1000 +" | sudo tee /etc/apt/preferences.d/mariadb + sudo debconf-set-selections <<< "mariadb-server-$VERSION mysql-server/root_password password rootpasswd" sudo debconf-set-selections <<< "mariadb-server-$VERSION mysql-server/root_password_again password rootpasswd" sudo apt-get install -qq mariadb-server -- cgit v1.2.1 From 3c135ccab2ca20af52e7fd0e7af03fdff828446c Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 25 Oct 2013 00:07:39 +0200 Subject: [ticket/11970] Add set -x to Travis setup scripts. Output is hidden by Travis by default and this will allow easier debugging. PHPBB3-11970 --- travis/setup-mariadb.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'travis/setup-mariadb.sh') diff --git a/travis/setup-mariadb.sh b/travis/setup-mariadb.sh index d9a88edb24..7e5c4e7d42 100755 --- a/travis/setup-mariadb.sh +++ b/travis/setup-mariadb.sh @@ -4,6 +4,7 @@ # @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 # set -e +set -x # MariaDB Series VERSION='5.5' -- cgit v1.2.1 From e65483ac3249c87aa147e99ad612b7fb211ce9c5 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 25 Oct 2013 00:33:19 +0200 Subject: [ticket/11970] Make apt-get less quiet. PHPBB3-11970 --- travis/setup-mariadb.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'travis/setup-mariadb.sh') diff --git a/travis/setup-mariadb.sh b/travis/setup-mariadb.sh index 7e5c4e7d42..aceb6af7ee 100755 --- a/travis/setup-mariadb.sh +++ b/travis/setup-mariadb.sh @@ -13,18 +13,18 @@ VERSION='5.5' OS_CODENAME=$(lsb_release --codename --short) # Manually purge MySQL to remove conflicting files (e.g. /etc/mysql/my.cnf) -sudo apt-get purge -qq mysql-common +sudo apt-get purge -y mysql-common if ! which add-apt-repository > /dev/null then - sudo apt-get update -qq - sudo apt-get install -qq python-software-properties + sudo apt-get update + sudo apt-get install -y python-software-properties fi MIRROR_DOMAIN='ftp.osuosl.org' sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db sudo add-apt-repository "deb http://$MIRROR_DOMAIN/pub/mariadb/repo/$VERSION/ubuntu $OS_CODENAME main" -sudo apt-get update -qq +sudo apt-get update # Pin repository in order to avoid conflicts with MySQL from distribution # repository. See https://mariadb.com/kb/en/installing-mariadb-deb-files @@ -37,7 +37,7 @@ Pin-Priority: 1000 sudo debconf-set-selections <<< "mariadb-server-$VERSION mysql-server/root_password password rootpasswd" sudo debconf-set-selections <<< "mariadb-server-$VERSION mysql-server/root_password_again password rootpasswd" -sudo apt-get install -qq mariadb-server +sudo apt-get install -y mariadb-server # Set root password to empty string. echo " -- cgit v1.2.1