Commit 936455fe authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Heavily refactor and unify gitlab-ci.yml MariaDB install/upgrade steps

parent 44b57694
......@@ -9,7 +9,8 @@ variables:
stages:
- build
- test quality
- upgrades in Debian stable
- upgrade in Stretch
- upgrade from Jessie
build package:
stage: build
......@@ -62,52 +63,21 @@ fresh install:
- ${WORKING_DIR}/debug
script:
- cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output
- mkdir debug
- dpkg -l | grep -iE '"'"'maria|mysql|galera'"'"' || true
- apt-get update
# Install MariaDB built in this commit
- apt-get install -y ./*.deb
- mariadb --version
- find /var/lib/mysql -ls > debug/var-lib-mysql.list
- cp -ra /etc/mysql debug/etc-mysql
# Verify installation of MariaDB built in this commit
- dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- mariadb --version # Client version
- service mysql restart || true # Always proceed even if init failed
- service mysql status || true
- cp -ra /var/log/mysql debug/var-log-mysql
- mariadb --skip-column-names -e "select @@version, @@version_comment"
- mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;"
variables:
GIT_STRATEGY: none
upgrade on stretch:
stage: upgrades in Debian stable
dependencies:
- build package
image: debian:stable
artifacts:
when: always
name: "$CI_BUILD_NAME"
paths:
- ${WORKING_DIR}/debug
script:
- cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output
- apt-get update
- apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadbd*' 'libmariadbclient*' # Install almost everything curently in Debian Stretch
- dpkg -l | grep -iE '"'"'maria|mysql|galera'"'"' || true
- service mysql status || true # Always proceed even if init failed
- service mysql restart || true
- mariadb --skip-column-names -e "select @@version, @@version_comment"
- echo 'deb http://deb.debian.org/debian sid main' > /etc/apt/sources.list
- apt-get update; apt-get install -y apt # Uprade minimal stack first
- apt-get install -y ./*.deb
- dpkg -l | grep -iE '"'"'maria|mysql|galera'"'"' || true
- mariadb --version
- mkdir -p debug # Ensure dir exists before using it
- find /var/lib/mysql -ls > debug/var-lib-mysql.list
- cp -ra /etc/mysql debug/etc-mysql
- service mysql restart || true # Always proceed even if init failed
- service mysql status || true
- cp -ra /var/log/mysql debug/var-log-mysql
- mariadb --skip-column-names -e "select @@version, @@version_comment"
- mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;"
- mariadb --skip-column-names -e "select @@version, @@version_comment" # Show version
- echo 'SHOW DATABASES;' | mariadb # List databases
- mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" # Test InnoDB works
variables:
GIT_STRATEGY: none
......@@ -123,16 +93,19 @@ test basic features:
- ${WORKING_DIR}/debug
script:
- cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output
- dpkg -l | grep -iE '"'"'maria|mysql|galera'"'"' || true
- apt-get update
# Install MariaDB built in this commit
- apt-get install -y ./*.deb
- mariadb --version
# Verify installation of MariaDB built in this commit
- dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- mariadb --version # Client version
- service mysql restart || true # Always proceed even if init failed
- service mysql status || true
- mkdir -p debug # Ensure dir exists before using it
- find /var/lib/mysql -ls > debug/var-lib-mysql.list
- cp -ra /etc/mysql debug/etc-mysql
- service mysql restart || true # Always proceed even if init failed
- service mysql status || true
- cp -ra /var/log/mysql debug/var-log-mysql
- echo 'SHOW DATABASES;' | mariadb # List databases
# Print info about server
- mariadb --skip-column-names -e "select @@version, @@version_comment"
- mariadb --skip-column-names -e "select engine, support, transactions, savepoints from information_schema.engines order by engine" | sort
......@@ -175,7 +148,6 @@ run autopkgtest:
#variables:
# GIT_STRATEGY: none
# Build a piece of software that was designed for libmysqlclient-dev but using the
# libmariadb-dev-compat layer. Should always end up using libmariadb.so.3 run-time.
build mariadbclient consumer Python-MySQLdb:
......@@ -198,8 +170,46 @@ build mariadbclient consumer Python-MySQLdb:
variables:
GIT_STRATEGY: none
mysql-5.5 to mariadb upgrade:
stage: upgrades in Debian stable
mariadb-10.1.x to mariadb-10.1.y upgrade:
stage: upgrade in Stretch
dependencies:
- build package
image: debian:stretch
artifacts:
when: always
name: "$CI_BUILD_NAME"
paths:
- ${WORKING_DIR}/debug
script:
- cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output
- apt-get update
# Install almost everything currently in Debian Stretch
- apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadbd*' 'libmariadbclient*'
# Verify installation of MariaDB currently in Debian Stretch
- dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- service mysql status || true # Always proceed even if init failed
- service mysql restart || true
- mariadb --skip-column-names -e "select @@version, @@version_comment"
- echo 'SHOW DATABASES;' | mysql
# Install MariaDB built in this commit
- apt-get install -y ./*.deb || true # Allow to proceed so debug artifacts get collected
# Verify installation of MariaDB built in this commit
- dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- mariadb --version # Client version
- service mysql restart || true # Always proceed even if init failed
- service mysql status || true
- mkdir -p debug # Ensure dir exists before using it
- find /var/lib/mysql -ls > debug/var-lib-mysql.list
- cp -ra /etc/mysql debug/etc-mysql
- cp -ra /var/log/mysql debug/var-log-mysql
- mariadb --skip-column-names -e "select @@version, @@version_comment" # Show version
- echo 'SHOW DATABASES;' | mariadb # List databases before upgrade are still there
- mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" # Test InnoDB works
variables:
GIT_STRATEGY: none
mariadb-10.0 to mariadb-10.1 upgrade:
stage: upgrade from Jessie
dependencies:
- build package
image: debian:jessie
......@@ -209,19 +219,70 @@ mysql-5.5 to mariadb upgrade:
paths:
- ${WORKING_DIR}/debug
script:
- cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output
- apt-get update
# Install almost everything currently in Debian Jessie
- apt-get install -y 'mariadb-*' 'libmariadb*'
# Verify installation of MariaDB from Jessie
- dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- service mysql status || true # Always proceed even if init failed
- service mysql restart || true
- mysql --skip-column-names -e "select @@version, @@version_comment"
- echo 'SHOW DATABASES;' | mysql
# Install MariaDB built in this commit
- sed 's/jessie/stretch/g' -i /etc/apt/sources.list # Enable next Debian release
- apt-get update; apt-get install -y apt # Install apt 1.4.9 so the wildcard command below works
- apt-get install -y ./*.deb || true # Allow to proceed so debug artifacts get collected
# Verify installation of MariaDB built in this commit
- dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- mariadb --version # Client version
- service mysql restart || true # Always proceed even if init failed
- service mysql status || true
- mkdir -p debug # Ensure dir exists before using it
- find /var/lib/mysql -ls > debug/var-lib-mysql.list
- cp -ra /etc/mysql debug/etc-mysql
- cp -ra /var/log/mysql debug/var-log-mysql
- mariadb --skip-column-names -e "select @@version, @@version_comment" # Show version
- echo 'SHOW DATABASES;' | mariadb # List databases before upgrade are still there
- mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" # Test InnoDB works
variables:
GIT_STRATEGY: none
mysql-5.5 to mariadb-10.1 upgrade:
stage: upgrade from Jessie
dependencies:
- build package
image: debian:jessie
artifacts:
when: always
name: "$CI_BUILD_NAME"
paths:
- ${WORKING_DIR}/debug
script:
- cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output
- apt-get update
- apt-get install -y mysql-server
- /etc/init.d/mysql restart
- mysql --version
# Verify installation of MySQL from Jessie
- dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- service mysql status || true # Always proceed even if init failed
- service mysql restart || true
- mysql --skip-column-names -e "select @@version, @@version_comment"
- echo 'SHOW DATABASES;' | mysql
- cd ${WORKING_DIR}; apt-get install -y ./*.deb || true # Allow to proceed so debug artifacts get collected
# Install MariaDB built in this commit
- sed 's/jessie/stretch/g' -i /etc/apt/sources.list # Enable next Debian release
- apt-get update; apt-get install -y apt # Install apt 1.4.9 so the wildcard command below works
- apt-get install -y ./*.deb || true # Allow to proceed so debug artifacts get collected
# Verify installation of MariaDB built in this commit
- dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- mariadb --version # Client version
- service mysql restart || true # Always proceed even if init failed
- service mysql status || true
- mkdir -p debug # Ensure dir exists before using it
- find /var/lib/mysql -ls > debug/var-lib-mysql.list
- cp -ra /etc/mysql debug/etc-mysql
- cp -ra /var/log/mysql debug/var-log-mysql
- service mysql status
- mariadb --version
- echo 'SHOW DATABASES;' | mariadb
- mariadb --skip-column-names -e "select @@version, @@version_comment" # Show version
- echo 'SHOW DATABASES;' | mariadb # List databases before upgrade are still there
- mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" # Test InnoDB works
variables:
GIT_STRATEGY: none
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment