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

Gitlab-CI: Sync latest version from Debian Sid but with Stretch adaptions

parent d23a001e
# Inlude Salsa-CI as a base
include:
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
# Overridfe Salsa-CI with MariaDB specific variations
variables:
DEBFULLNAME: "Salsa Pipeline"
DEBEMAIL: "<salsa-pipeline@debian.org>"
DEBIAN_FRONTEND: noninteractive
WORKING_DIR: $CI_PROJECT_DIR/debian/output
DEB_BUILD_OPTIONS: "nocheck noautodbgsym"
RELEASE: stretch
CCACHE_TMP_DIR: ${CI_PROJECT_DIR}/../.ccache
CCACHE_WORK_DIR: ${WORKING_DIR}/.ccache
SALSA_CI_DISABLE_REPROTEST: 1
stages:
- build
- test quality
- upgrade in Stretch
- upgrade from Jessie
- test extras
- test # Stage referenced by reprotest stanza, so must exist
build package:
stage: build
image: registry.salsa.debian.org/salsa-ci-team/images/gbp
cache:
paths:
- ${CCACHE_WORK_DIR}
variables:
CCACHE_TMP_DIR: ${CI_PROJECT_DIR}/../.ccache
CCACHE_WORK_DIR: ${WORKING_DIR}/.ccache
services:
- docker:dind
artifacts:
expire_in: 90 day
name: "$CI_JOB_NAME:$CI_COMMIT_REF_NAME"
paths:
- ${WORKING_DIR}/
build:
extends: .build-package
script:
- apt-get update
- mkdir -p ${CCACHE_WORK_DIR}
- mv ${CCACHE_WORK_DIR} ${CCACHE_TMP_DIR}
- gbp pull --ignore-branch --pristine-tar --track-missing
- while true; do sleep 600; echo "10 minutes passed" >&2; done & # Progress keeper since build is long and silent
- gbp buildpackage --git-ignore-branch --git-export-dir=${WORKING_DIR} --git-builder="docker-build.sh registry.salsa.debian.org/salsa-ci-team/images/dockerbuilder:${RELEASE}" | tail -n 10000 # Keep log under 4 MB
- du -shc ${WORKING_DIR}/* # Show total file size of artifacts. Must stay are under 100 MB.
- |
mkdir -p ${WORKING_DIR}
# Check if we can obtain the orig from the git branches
if ! gbp export-orig --pristine-tar --tarball-dir=${WORKING_DIR}; then
# Fallback using origtargz
origtargz -dt
mv ../*.orig.* ${WORKING_DIR}
fi
- gbp buildpackage --git-ignore-branch --git-ignore-new --git-no-create-orig --git-overlay --git-export-dir=${WORKING_DIR} --git-builder="docker-build.sh ${SALSA_CI_IMAGES_DOCKERBUILDER}" | (head -n 5000 ; echo "==== Output supressed to avoid hitting Gitlab-CI 4 MB log limit ===="; tail -n 5000)
- mv ${CCACHE_TMP_DIR} ${CCACHE_WORK_DIR}
run lintian:
# Backports build not here as we cannot build MariaDB 10.3 backport for Stretch
# due to unmet build dependencies.
lintian:
extends: .test-lintian
stage: test quality
autopkgtest:
extends: .test-autopkgtest
stage: test quality
dependencies:
- build package
image: registry.salsa.debian.org/salsa-ci-team/images/lintian:${RELEASE}
script:
- lintian ${WORKING_DIR}/*.changes | tee lintian.output
- lintian2junit.py --lintian-file lintian.output > ${WORKING_DIR}/lintian.xml
variables:
GIT_STRATEGY: none
artifacts:
reports:
junit: ${WORKING_DIR}/lintian.xml
- build
piuparts:
extends: .test-piuparts
stage: test extras
blhc:
extends: .test-blhc
stage: test extras
dependencies:
- build
# In addition to Salsa-CI, also run these fully MariaDB specific build jobs
fresh install:
stage: test quality
dependencies:
- build
image: debian:${RELEASE}
artifacts:
when: always
......@@ -79,10 +92,10 @@ fresh install:
variables:
GIT_STRATEGY: none
test basic features:
stage: test quality
mariadb-10.1.x to mariadb-10.1.y upgrade:
stage: upgrade in Stretch
dependencies:
- build package
- build
image: debian:${RELEASE}
artifacts:
when: always
......@@ -93,8 +106,15 @@ test basic features:
- sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d # Enable automatic restarts from maint scripts
- 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
- mariadb --skip-column-names -e "select @@version, @@version_comment"
- echo 'SHOW DATABASES;' | mysql
# Install MariaDB built in this commit
- apt-get install -y ./*.deb
- 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
......@@ -103,76 +123,17 @@ test basic features:
- 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
- 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
- mariadb --skip-column-names -e "select plugin_name, plugin_status, plugin_type, plugin_library, plugin_license from information_schema.all_plugins order by plugin_name, plugin_library"
# Test various features
- mariadb -e "CREATE DATABASE db"
- mariadb -e "CREATE TABLE db.t_innodb(a1 SERIAL, c1 CHAR(8)) ENGINE=InnoDB; INSERT INTO db.t_innodb VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')"
- mariadb -e "CREATE TABLE db.t_myisam(a2 SERIAL, c2 CHAR(8)) ENGINE=MyISAM; INSERT INTO db.t_myisam VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')"
- mariadb -e "CREATE TABLE db.t_aria(a3 SERIAL, c3 CHAR(8)) ENGINE=Aria; INSERT INTO db.t_aria VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')"
- mariadb -e "CREATE TABLE db.t_memory(a4 SERIAL, c4 CHAR(8)) ENGINE=MEMORY; INSERT INTO db.t_memory VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')"
- mariadb -e "CREATE ALGORITHM=MERGE VIEW db.v_merge AS SELECT * FROM db.t_innodb, db.t_myisam, db.t_aria"
- mariadb -e "CREATE ALGORITHM=TEMPTABLE VIEW db.v_temptable AS SELECT * FROM db.t_innodb, db.t_myisam, db.t_aria"
- mariadb -e "CREATE PROCEDURE db.p() SELECT * FROM db.v_merge"
- mariadb -e "CREATE FUNCTION db.f() RETURNS INT DETERMINISTIC RETURN 1"
# Test that the features still work (this step can be done e.g. after an upgrade)
- mariadb -e "SHOW TABLES IN db"
- mariadb -e "SELECT * FROM db.t_innodb; INSERT INTO db.t_innodb VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')"
- mariadb -e "SELECT * FROM db.t_myisam; INSERT INTO db.t_myisam VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')"
- mariadb -e "SELECT * FROM db.t_aria; INSERT INTO db.t_aria VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')"
- mariadb -e "SELECT * FROM db.t_memory; INSERT INTO db.t_memory VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')"
- mariadb -e "SELECT COUNT(*) FROM db.v_merge"
- mariadb -e "SELECT COUNT(*) FROM db.v_temptable"
- mariadb -e "CALL db.p()"
- mariadb -e "SELECT db.f()"
variables:
GIT_STRATEGY: none
# Stanza 'breaks-testbed' must be removed because the test 'upstream' will otherwise be skipped and
# thus the command would return exit code 2, and be considered failed by Gitlab CI.
run autopkgtest:
stage: test quality
dependencies:
- build package
image: registry.salsa.debian.org/salsa-ci-team/images/autopkgtest:${RELEASE}
script:
- sed s/breaks-testbed//g -i debian/tests/control
- cat debian/tests/control
- eatmydata autopkgtest -U --override-control=debian/tests/control ${WORKING_DIR}/*.changes -- null || [ $? -eq 8 ]
# Repo needs to be checked out so the debian/tests/control fiel can be modified on-the-fly.
#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:
stage: test quality
dependencies:
- build package
image: debian:${RELEASE}
script:
- cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output
- mkdir -p debug # Ensure dir exists before using it
- apt-get update
- apt-get install -y pkg-config ./libmariadbclient-dev*.deb ./libmariadbclient18_*.deb ./mariadb-common*.deb
- pkg-config --list-all # See what MySQLdb builds with
- ldconfig -p | grep -e mariadb -e mysql
- mysql_config # Must be present for mysqlclient Python module to build
- apt-get install -y python3-pip
- pip3 install mysqlclient # Compiles module against libmysqlclient
- apt-get purge -y libmariadb-dev # Not needed for run-time
- python3 -c "import MySQLdb; print(MySQLdb.get_client_info())"
- 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.1.x to mariadb-10.1.y upgrade:
stage: upgrade in Stretch
mariadb-10.0 to mariadb-10.1 upgrade:
stage: upgrade from Jessie
dependencies:
- build package
image: debian:stretch
- build
image: debian:jessie
artifacts:
when: always
name: "$CI_BUILD_NAME"
......@@ -182,14 +143,15 @@ mariadb-10.1.x to mariadb-10.1.y upgrade:
- sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d # Enable automatic restarts from maint scripts
- 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
# 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
- mariadb --skip-column-names -e "select @@version, @@version_comment"
- 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 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
......@@ -205,11 +167,11 @@ mariadb-10.1.x to mariadb-10.1.y upgrade:
variables:
GIT_STRATEGY: none
mariadb-10.0 to mariadb-10.1 upgrade:
stage: upgrade from Jessie
test basic features:
stage: test quality
dependencies:
- build package
image: debian:jessie
- build
image: debian:${RELEASE}
artifacts:
when: always
name: "$CI_BUILD_NAME"
......@@ -219,17 +181,8 @@ mariadb-10.0 to mariadb-10.1 upgrade:
- sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d # Enable automatic restarts from maint scripts
- 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
- 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
- apt-get install -y ./*.deb
# Verify installation of MariaDB built in this commit
- dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- mariadb --version # Client version
......@@ -238,16 +191,58 @@ mariadb-10.0 to mariadb-10.1 upgrade:
- 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
- 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
- mariadb --skip-column-names -e "select plugin_name, plugin_status, plugin_type, plugin_library, plugin_license from information_schema.all_plugins order by plugin_name, plugin_library"
# Test various features
- mariadb -e "CREATE DATABASE db"
- mariadb -e "CREATE TABLE db.t_innodb(a1 SERIAL, c1 CHAR(8)) ENGINE=InnoDB; INSERT INTO db.t_innodb VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')"
- mariadb -e "CREATE TABLE db.t_myisam(a2 SERIAL, c2 CHAR(8)) ENGINE=MyISAM; INSERT INTO db.t_myisam VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')"
- mariadb -e "CREATE TABLE db.t_aria(a3 SERIAL, c3 CHAR(8)) ENGINE=Aria; INSERT INTO db.t_aria VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')"
- mariadb -e "CREATE TABLE db.t_memory(a4 SERIAL, c4 CHAR(8)) ENGINE=MEMORY; INSERT INTO db.t_memory VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')"
- mariadb -e "CREATE ALGORITHM=MERGE VIEW db.v_merge AS SELECT * FROM db.t_innodb, db.t_myisam, db.t_aria"
- mariadb -e "CREATE ALGORITHM=TEMPTABLE VIEW db.v_temptable AS SELECT * FROM db.t_innodb, db.t_myisam, db.t_aria"
- mariadb -e "CREATE PROCEDURE db.p() SELECT * FROM db.v_merge"
- mariadb -e "CREATE FUNCTION db.f() RETURNS INT DETERMINISTIC RETURN 1"
# Test that the features still work (this step can be done e.g. after an upgrade)
- mariadb -e "SHOW TABLES IN db"
- mariadb -e "SELECT * FROM db.t_innodb; INSERT INTO db.t_innodb VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')"
- mariadb -e "SELECT * FROM db.t_myisam; INSERT INTO db.t_myisam VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')"
- mariadb -e "SELECT * FROM db.t_aria; INSERT INTO db.t_aria VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')"
- mariadb -e "SELECT * FROM db.t_memory; INSERT INTO db.t_memory VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')"
- mariadb -e "SELECT COUNT(*) FROM db.v_merge"
- mariadb -e "SELECT COUNT(*) FROM db.v_temptable"
- mariadb -e "CALL db.p()"
- mariadb -e "SELECT db.f()"
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:
stage: test quality
dependencies:
- build
image: debian:${RELEASE}
script:
- cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output
- mkdir -p debug # Ensure dir exists before using it
- apt-get update
- apt-get install -y pkg-config ./libmariadbclient-dev*.deb ./libmariadbclient18_*.deb ./mariadb-common*.deb
- pkg-config --cflags --libs mysqlclient # See what MySQLdb builds with
- apt-get install -y python3-pip
- pip3 install mysqlclient # Compiles module against libmysqlclient
- apt-get purge -y libmariadb-dev # Not needed for run-time
- python3 -c "import MySQLdb; print(MySQLdb.get_client_info())"
variables:
GIT_STRATEGY: none
mysql-5.5 to mariadb-10.1 upgrade:
stage: upgrade from Jessie
dependencies:
- build package
- build
image: debian:jessie
artifacts:
when: always
......@@ -266,7 +261,8 @@ mysql-5.5 to mariadb-10.1 upgrade:
- 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 update; apt-get install -y apt || true # Install apt 1.4.9 so the wildcard command below works
- apt-get dist-upgrade -y || true # Upgrade all to avoid udev/systemd failures
- 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
......
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