2020-08-23 22:49:43 +02:00
---
# Include Salsa-CI as a base
2020-04-07 19:20:11 +02:00
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
2020-08-23 22:49:43 +02:00
# Override Salsa-CI with MariaDB specific variations
2020-04-07 19:20:11 +02:00
variables :
2024-05-27 12:25:26 +02:00
BUILT_PACKAGES : "libmariadb-dev libmariadb-dev-compat libmariadb3
libmariadbd19t64 libmariadbd-dev mariadb-common mariadb-client-core
mariadb-client mariadb-server-core mariadb-server mariadb-backup
mariadb-plugin-connect mariadb-plugin-s3 mariadb-plugin-rocksdb
mariadb-plugin-oqgraph mariadb-plugin-mroonga mariadb-plugin-spider
mariadb-plugin-gssapi-server mariadb-plugin-gssapi-client
mariadb-plugin-cracklib-password-check mariadb-plugin-hashicorp-key-management
mariadb-plugin-provider-bzip2 mariadb-plugin-provider-lz4
mariadb-plugin-provider-lzma mariadb-plugin-provider-lzo
mariadb-plugin-provider-snappy mariadb-test mariadb-test-data"
2020-04-07 19:20:11 +02:00
DEB_BUILD_OPTIONS : "nocheck noautodbgsym"
2024-05-27 12:25:26 +02:00
RELEASE : sid
# Reprotest works, but takes very long time and often fails due to timeouts.
# Thus is best kept disabled and only occasionally manually enabled to
# test that reproducibility works, along with atomic reprotest to directly
# pinpoint what aspect of the build is broken if not reproducible.
2020-04-07 19:20:11 +02:00
SALSA_CI_DISABLE_REPROTEST : 1
2024-05-27 12:25:26 +02:00
SALSA_CI_ENABLE_ATOMIC_REPROTEST : 0
2020-04-07 19:20:11 +02:00
SALSA_CI_DISABLE_MISSING_BREAKS : 0
SALSA_CI_DISABLE_RC_BUGS : 1
SALSA_CI_DISABLE_BUILD_PACKAGE_ALL : 1
SALSA_CI_DISABLE_BUILD_PACKAGE_ANY : 1
GIT_SUBMODULE_STRATEGY : recursive
2020-08-23 22:49:43 +02:00
SALSA_CI_GBP_BUILDPACKAGE_ARGS : "--git-submodules" # did not apply to extract-sources
2020-04-07 19:20:11 +02:00
Misc Debian/Salsa-CI fixes (#2299)
* Deb: Handle codename 'n/a' from Debian Sid properly and autobake-deb cleanup
This fixes autobake-deb.sh builds on Sid which was visible as 4 failing
build steps on Salsa-CI.
- In Sid the LSBNAME might evaluate to 'n/a', so accept it as 'Sid' to
fix builds that failed with error:
Error - unknown release codename n/a
- Refactor list to have Ubuntu versions first, then Debian, and as last
the special case of Debian Sid
- Fix minor syntax issues detected by Shellcheck
Also remove useless DEB_HOST_ARCH_CPU check from debian/rules:
* It was never in effect as the 'sed' in autobake-deb.sh cleared it anyway
* The variable name was wrong and always empty
* If variable would have been correct, logic was still reversed
- Define 3h timeout as the default 1h timeout on Gitlab.com (and others)
is usually not enough for initial (uncached) MariaDB builds.
- Replace Buster to Bookworm/Sid upgrade testing with upgrade inside Buster
testing as direct upgrades from Stretch to Bullseye and Buster to Bookworm
are no longer possible due to:
Bug#993755: libcrypt.so.1: cannot open shared object file when
upgrading from Stretch to Sid (https://bugs.debian.org/993755)
- Stop ignoring MariaDB.org 10.6 to this version upgrade testing failures
to reveal bug MDEV-28640. Originally this step was failing as the uring
dependencies in upstream builders lagged behind and there was nothing
that needed work, only time time to resolve. Now there is an actual bug
in packaging that should be visible as a CI failure.
- Stop testing for 'service mysql status' on systems that upgraded from
MySQL 8.0 to MariaDB.org vended 10.6. Due to some unidentified debian/control
changes in 10.6 on upstream the upgrade is no longer compatible in
a way that would maintain the init.d script with name 'mysql'.
- Fix typos where mergers had changed occurrences of 10.5 to 10.6 while
they intentionally need to be exactly 10.5, otherwise the meaning
changes.
- Align autopkgtest code with downstream official Debian packaging one.
This is change is safe on a stable branch because is only affects builds
and testing, not any actual usage of MariaDB 10.6.
- Standardize on using capitalized 'YES' in CMake build options
(instead of 'yes' or mixed case)
- Add some comments to better document debian/rules
- Fix typo in Lintian overrides
Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/mariadb-10.6/+bug/1970634
MariaDB ticket: https://jira.mariadb.org/browse/MDEV-25633
When built with LTO on Ubuntu, MariaDB does not catch an exception when
the uring initialization fails due to a low RLIMIT_MEMLOCK value.
This commit amends the commit 0609b345554f9a148e165c497aadbe368e0900aa
to be identical to the one done downstream in Debian:
https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/8d20ca979cf422d3a507283b86c2547d78559179
This way both the inline comments and 'git blame' for this section will
show properly why this is needed, and the fix is one that is fully tested
on Debian and Ubuntu.
Also having this section fully identical in upstream MariaDB and downstream
Debian will make the packaging maintenance easier as 'diff` runs on this
file will not flag this as a difference anymore.
In MDEV-28640 the init script failed to stop/start the MariaDB server
due to missing mysqladmin on the system. This was however very hard to
spot from the console output.
Add an explicit check for the binary the script depends on, and fail
verbosely if the dependency is missing.
2022-11-11 08:51:34 +01:00
# Extend Salsa-CI build jobs to have longer timeout as the default GitLab
# timeout (1h) is often not enough
.build-package :
timeout : 3h
2020-04-07 19:20:11 +02:00
stages :
2020-08-23 22:49:43 +02:00
- provisioning
2020-04-07 19:20:11 +02:00
- build
- test
2024-05-27 12:25:26 +02:00
- upgrade MariaDB
- upgrade MariaDB and distro
- upgrade MariaDB variant
2020-08-23 22:49:43 +02:00
- test extras
2020-04-07 19:20:11 +02:00
- publish # Stage referenced by Salsa-CI template aptly stanza, so must exist even though not used
2024-05-27 12:25:26 +02:00
build autobake :
2020-04-07 19:20:11 +02:00
extends : .build-package
2024-05-27 12:25:26 +02:00
stage : build
2020-04-07 19:20:11 +02:00
script : &autobake-deb-steps
2020-12-26 20:17:11 +01:00
# Run Salsa-CI .build-before-script equivalent
2020-04-07 19:20:11 +02:00
- mkdir -p ${WORKING_DIR} ${CCACHE_WORK_DIR}
- mv ${CCACHE_WORK_DIR} ${CCACHE_TMP_DIR}
2021-12-31 22:12:54 +01:00
# Run Salsa-CI .build-script equivalent, with extra devscripts so autobake-deb.sh can run 'dch'
- export CCACHE_DIR=${CCACHE_TMP_DIR}
2022-03-25 07:25:11 +01:00
- apt-get update && eatmydata apt-get install --no-install-recommends -y ccache fakeroot build-essential devscripts lsb-release
2020-12-26 20:17:11 +01:00
- cd ${WORKING_DIR}/${SOURCE_DIR}
2021-12-31 22:12:54 +01:00
- eatmydata apt-get build-dep --no-install-recommends -y .
2020-04-07 19:20:11 +02:00
- update-ccache-symlinks; ccache -z # Zero out ccache counters
2020-07-03 15:24:58 +02:00
- while true; do sleep 600; echo "10 minutes passed" >&2; done & # Progress keeper since build is long and silent
- debian/autobake-deb.sh |& tail -n 10000 # Keep Gitlab-CI output under 4 MB
2020-12-26 20:17:11 +01:00
- cd ${WORKING_DIR}
- rm -rf ${WORKING_DIR}/${SOURCE_DIR}
2020-04-07 19:20:11 +02:00
- du -shc ${WORKING_DIR}/* # Show total file size of artifacts. Must stay are under 100 MB.
- ccache -s # Show ccache stats to validate it worked
2021-12-31 22:12:54 +01:00
- mv ${CCACHE_TMP_DIR} ${CCACHE_WORK_DIR}
2020-04-07 19:20:11 +02:00
2023-05-08 10:06:52 +02:00
# Buster only has libfmt 6.1 but 7.0 is required, so backport build for Buster
# is not possible unless somebody packages libfmt7-dev for Buster.
2022-03-26 22:55:44 +01:00
autopkgtest :
extends : .test-autopkgtest
artifacts :
reports :
junit : ${WORKING_DIR}/debci/artifacts/mysql-test-run-junit.xml
2020-04-07 19:20:11 +02:00
piuparts :
stage : test extras
blhc :
stage : test extras
2020-08-23 22:49:43 +02:00
# In addition to Salsa-CI, also run these fully MariaDB specific build jobs
2020-04-07 19:20:11 +02:00
2020-08-23 22:49:43 +02:00
# Define snippets used to construct jobs
2020-04-07 19:20:11 +02:00
2020-08-23 22:49:43 +02:00
.test-prepare-container : &test-prepare-container |
cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output
# Enable automatic restarts from maint scripts
sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d
# Fake /sbin/runlevel to avoid warnings of "invoke-rc.d: could not determine current runlevel"
echo -e '#!/bin/sh\necho "N 5"' > /sbin/runlevel; chmod +x /sbin/runlevel
# Avoid the warnings of "debconf: unable to initialize frontend: Dialog"
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
2024-05-27 12:25:26 +02:00
# Emit non-zero exit code also on warnings
echo 'APT::Update::Error-Mode "any";' > /etc/apt/apt.conf.d/non-zero-exit-on-warnings
2020-08-23 22:49:43 +02:00
# Prime the apt cache so later apt commands can run
2023-01-06 06:56:14 +01:00
apt-get update -qq
2022-03-26 22:55:44 +01:00
2024-05-27 12:25:26 +02:00
# Readline was removed from Debian Sid (and Bullseye) in Feb 2021. To be able to install older
# versions of MariaDB that depend on it, fetch and install it from Buster.
.test-install-readline-in-sid-for-backwards-compat : &test-install-readline-in-sid-for-backwards-compat |
curl -sS -O https://snapshot.debian.org/archive/debian/20190316T031117Z/pool/main/r/readline5/libreadline5_5.2%2Bdfsg-3%2Bb13_amd64.deb
apt-get -qq install --no-install-recommends --yes ./libreadline5_5.2%2Bdfsg-3%2Bb13_amd64.deb
# OpenSSL 1.1 was Debian Sid in Dec 2022 (as Bookworm will ship with OpenSSL 3.0
# only). To be able to install versions of MariaDB that depend on OpenSSL 1.1,
# fetch and install it manually.
.test-install-openssl1-in-sid-for-backwards-compat : &test-install-openssl1-in-sid-for-backwards-compat |
curl -sS -O https://snapshot.debian.org/archive/debian/20220507T034236Z/pool/main/o/openssl/libssl1.1_1.1.1o-1_amd64.deb
apt-get -qq install --no-install-recommends --yes ./libssl1.1_1.1.1o-1_amd64.deb
# Package libaio1 was replaced by libaio1t64 in Debian Sid in April 2024. To
# continue installing old MariaDB versions that depend on libaio1, use libaio1
# from snapshots.
.test-install-libaio-in-sid-for-backwards-compat : &test-install-libaio-in-sid-for-backwards-compat |
curl -sS -O https://snapshot.debian.org/archive/debian/20240331T210805Z/pool/main/liba/libaio/libaio1_0.3.113-5_amd64.deb
apt-get -qq install --no-install-recommends --yes ./libaio1_0.3.113-5_amd64.deb
2020-08-23 22:49:43 +02:00
.test-verify-initial : &test-verify-initial |
dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
2024-05-27 12:25:26 +02:00
# MariaDB until 10.5 only had 'mysql', and since only 'mariadb', so try both
service mysql status || service mariadb status
2020-08-23 22:49:43 +02:00
mysql --skip-column-names -e "select @@version, @@version_comment" # Show version
2022-03-26 22:55:44 +01:00
mysql --table -e "SHOW DATABASES;" # List databases before upgrade
2020-12-30 09:08:23 +01:00
mysql --table -e "SELECT host,user,plugin,authentication_string FROM user;" mysql
mysql --table -e "SELECT * FROM plugin;" mysql
mysql --table -e "SHOW PLUGINS;" mysql
2020-08-23 22:49:43 +02:00
2023-05-08 10:06:52 +02:00
.test-enable-sid-repos : &test-enable-sid-repos
# Replace any old repos with just Sid
- echo 'deb http://deb.debian.org/debian sid main' > /etc/apt/sources.list
# Upgrade minimal stack first
- apt-get update -qq
2024-05-27 12:25:26 +02:00
# Complete upgrade of minimal stack
- apt-get install -qq --yes apt || export APT_STATUS="failed"
# Due to https://bugs.debian.org/993755 and #975077 upgrades from Buster or
# older to Bookworm or newer fails on:
2023-05-08 10:06:52 +02:00
# /usr/bin/perl: error while loading shared libraries: libcrypt.so.1: cannot
# open shared object file: No such file or directory
# dpkg: error processing package libc6:amd64 (--configure):
2024-05-27 12:25:26 +02:00
# Therefore, run this extra workaround if first run of apt-get install failed:
- |
if [ "$APT_STATUS" = "failed" ]
then
cd $(mktemp -d) # Use temp dir where apt can download and unpack files
apt-get -y download libcrypt1
dpkg-deb -x libcrypt1_*.deb .
cp -ra usr/lib/* /lib/ || true # libcrypt 1:4.4.36-3+
cd - # Back to /builds/$USER/mariadb-server/debian/output
find /lib/*/libcrypt.* -ls # Show that new libcrypt is there
apt-get -qq --yes --fix-broken install
apt-get install -qq --yes apt
fi
.test-enable-artifacts-repo : &test-enable-artifacts-repo |
apt-get install -qq --yes apt-utils
apt-ftparchive packages . > Packages
echo "deb [trusted=yes] file:$(pwd) ./" > /etc/apt/sources.list.d/mariadb-local.list
apt-get update -qq
2023-05-08 10:06:52 +02:00
2024-05-27 12:25:26 +02:00
.test-install-all : &test-install-all
- *test-enable-artifacts-repo
- apt-get install -qq --simulate ${BUILT_PACKAGES}
- apt-get install -qq --yes ${BUILT_PACKAGES}
2020-08-23 22:49:43 +02:00
# Verify installation of MariaDB built in this commit
2024-05-27 12:25:26 +02:00
- mariadb --version
- dpkg -l | grep -iE 'maria|mysql|galera'
- find /etc -name '*mariadb*' -ls -or -name '*mysql*' -ls | sort -k 11
# Purge old versions if they exist
- apt-get purge --yes mariadb*10.?
- find /etc -name '*mariadb*' -ls -or -name '*mysql*' -ls | sort -k 11
.test-full-upgrade : &test-full-upgrade
- *test-enable-artifacts-repo
- apt-get full-upgrade -qq --simulate
- apt-get full-upgrade -qq --yes
2020-08-23 22:49:43 +02:00
# Verify installation of MariaDB built in this commit
2024-05-27 12:25:26 +02:00
- mariadb --version
- dpkg -l | grep -iE 'maria|mysql|galera'
- find /etc -name '*mariadb*' -ls -or -name '*mysql*' -ls | sort -k 11
# Purge old versions if they exist
- apt-get purge --yes mariadb*10.?
- find /etc -name '*mariadb*' -ls -or -name '*mysql*' -ls | sort -k 11
# Purging the old server might stop the running server, so restart it just in case
- service mariadb restart
.test-install-all-libs : &test-install-all-libs
- *test-enable-artifacts-repo
- apt-get install -yq --no-install-recommends libmariadb-dev-compat libmariadbd-dev
# Installs 31 packages, including:
# libmariadb3 libmariadb-dev libmariadb-dev-compat libmariadbd19t64 libmariadbd-dev
.test-full-upgrade-libs : &test-full-upgrade-libs
- *test-enable-artifacts-repo
- apt-get full-upgrade -y
- dpkg -l | grep -iE 'maria|mysql|galera'
# library tests don't have the mariadb client nor server, so don't check them
2020-08-23 22:49:43 +02:00
.test-verify-final : &test-verify-final |
2024-05-27 12:25:26 +02:00
dpkg -l | grep -e "mariadb-server.*10\.11"
2020-08-23 22:49:43 +02:00
mkdir -p debug # Ensure dir exists before using it
find /var/lib/mysql -ls > debug/var-lib-mysql.list || true # Ignore errors about "no such file or directory"
cp -ra /etc/mysql debug/etc-mysql
mariadb --skip-column-names -e "select @@version, @@version_comment" # Show version
2022-03-26 22:55:44 +01:00
mariadb --table -e "SHOW DATABASES;" # List databases
2020-12-30 09:08:23 +01:00
mariadb --table -e "SELECT host,user,plugin,authentication_string FROM user;" mysql
mariadb --table -e "SELECT * FROM plugin;" mysql
mariadb --table -e "SHOW PLUGINS;" mysql
# Test that InnoDB works and that command 'mysql' is also still usable
mysql -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;"
2020-08-23 22:49:43 +02:00
.test-verify-libs : &test-verify-libs
# Don't use a collapsed command as Gitlab-CI would hide each command from the output
- ldconfig -p | grep -e mariadb -e mysql
- pkg-config --list-all
- pkg-config --cflags --libs mysqlclient
- pkg-config --cflags --libs libmariadb
- pkg-config --cflags --libs mariadb
2024-05-27 12:25:26 +02:00
- apt-get install -qq --yes --no-install-recommends g++
2021-04-16 10:23:46 +02:00
- |
# Build a test binary that depends on libmysqlclient
cat > b933063.cpp <<EOF
#include <iostream>
#include <mysql/mysql.h>
#include <stdexcept>
int main()
{
MYSQL h;
if (!mysql_init(&h)
|| mysql_options(&h, MYSQL_READ_DEFAULT_GROUP, "")
// || mysql_options(&h, MYSQL_SET_CHARSET_NAME, "utf8mb4")
|| !mysql_real_connect(&h, "", "", NULL, "", 0, NULL, 0))
throw std::runtime_error(mysql_error(&h));
std::string q = "show variables like '%char%'";
if (mysql_real_query(&h, q.data(), q.size()))
throw std::runtime_error(mysql_error(&h));
MYSQL_RES* result = mysql_store_result(&h);
if (!result && mysql_errno(&h))
throw std::runtime_error(mysql_error(&h));
while (MYSQL_ROW row = mysql_fetch_row(result))
{
std::cout << row[0] << ": " << row[1] << "\n";
}
return 0;
}
EOF
2024-05-27 12:25:26 +02:00
apt-get install -qq --yes --allow-downgrades ./*.deb # Server must be installed for client to connect
2021-04-16 10:23:46 +02:00
echo "Testing -l mysqlclient"
g++ b933063.cpp -l mysqlclient && ./a.out | tee result
if grep --quiet latin result; then echo "ERROR: Charset latin found!"; exit 1; fi
echo "Testing -l mariadbclient"
g++ b933063.cpp -l mariadbclient && ./a.out | tee result
if grep --quiet latin result; then echo "ERROR: Charset latin found!"; exit 1; fi
2024-05-27 12:25:26 +02:00
- |
# Build a test binary to verify API version strings
cat > b1031863.cpp <<EOF
#include <cstring>
#include <iostream>
#include <mysql/mysql.h>
using namespace std;
void test_if_starts_with(const string expected, const string tested, const string name) {
int r = strncmp(tested.c_str(), expected.c_str(), expected.size());
if (r == 0) {
cout << name << ": " << tested << "\n";
} else {
cout << "ERROR: " << name << " started with " << tested << " instead of the expected " << expected << "!\n";
exit(1);
}
}
2020-08-23 22:49:43 +02:00
2024-05-27 12:25:26 +02:00
int main()
{
MYSQL h;
// Constants refer to server version
test_if_starts_with("1011", to_string(MARIADB_VERSION_ID), "MARIADB_VERSION_ID");
test_if_starts_with("1011", to_string(MYSQL_VERSION_ID), "MYSQL_VERSION_ID");
// Client ABI returns connector version
test_if_starts_with("303", to_string(mysql_get_client_version()), "mysql_get_client_version()");
test_if_starts_with("3.3", mysql_get_client_info(), "mysql_get_client_info()");
return 0;
}
EOF
g++ b1031863.cpp -l mysqlclient && ./a.out
2020-04-07 19:20:11 +02:00
2024-05-27 12:25:26 +02:00
.salsa-ci-template-for-mariadb :
2020-04-07 19:20:11 +02:00
stage : test
2020-08-23 22:49:43 +02:00
needs :
- job : build
2020-04-07 19:20:11 +02:00
image : debian:${RELEASE}
artifacts :
when : always
name : "$CI_BUILD_NAME"
paths :
- ${WORKING_DIR}/debug
script :
2024-05-27 12:25:26 +02:00
- echo "This script section must be overridden in each test" && exit 1
2020-04-07 19:20:11 +02:00
variables :
2020-08-23 22:49:43 +02:00
GIT_STRATEGY : none
2020-04-07 19:20:11 +02:00
except :
variables :
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
2024-05-27 12:25:26 +02:00
.salsa-ci-template-for-mariadb-upgrade :
stage : test
2020-08-23 22:49:43 +02:00
needs :
- job : build
image : debian:${RELEASE}
2020-04-07 19:20:11 +02:00
artifacts :
when : always
name : "$CI_BUILD_NAME"
paths :
- ${WORKING_DIR}/debug
2024-05-27 12:25:26 +02:00
before_script :
2020-08-23 22:49:43 +02:00
- *test-prepare-container
2024-05-27 12:25:26 +02:00
- apt-get install -qq --yes --no-install-recommends ca-certificates curl
- |
[ [ -d /etc/apt/keyrings ]] || mkdir /etc/apt/keyrings
curl -sS https://mariadb.org/mariadb_release_signing_key.pgp -o /etc/apt/keyrings/mariadb-keyring.pgp
cat >/etc/apt/sources.list.d/mariadb.sources <<EOF
X-Repolib-Name : MariaDB
Types : deb
URIs : https://archive.mariadb.org/mariadb-${MARIADB_VERSION}/repo/debian
Suites : ${RELEASE}
Components : main
Signed-By : /etc/apt/keyrings/mariadb-keyring.pgp
EOF
- apt-get update -qq
script :
- echo "This script section must be overridden in each test" && exit 1
2020-04-07 19:20:11 +02:00
variables :
2020-08-23 22:49:43 +02:00
GIT_STRATEGY : none
2024-05-27 12:25:26 +02:00
MARIADB_VERSION : "10.0"
2020-04-07 19:20:11 +02:00
except :
variables :
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
2024-05-27 12:25:26 +02:00
fresh install :
extends : .salsa-ci-template-for-mariadb
script :
- *test-prepare-container
- *test-install-all
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- *test-verify-final
simple upgrade :
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB
script :
- *test-prepare-container
- apt-get install -qq --yes 'default-mysql*' ${BUILT_PACKAGES}
- *test-full-upgrade
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- *test-verify-final
mariadb and Bookworm upgrade :
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB and distro
image : debian:bookworm
script :
- *test-prepare-container
# Install everything MariaDB currently in Debian Bookworm
- apt-get install -qq --yes 'default-mysql*' 'mariadb-*' 'libmariadb*'
# Verify installation of MariaDB from Bookworm
- dpkg -l | grep -e "mariadb-server.*10\.11"
- *test-verify-initial
- *test-enable-sid-repos
# Ensure mariadbd will not crash on next shutdown for any reason
- service mariadb restart
- *test-full-upgrade
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- *test-verify-final
mariadb-10.6 and Bookworm-20230208 upgrade :
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB and distro
image : debian:bookworm-20230208
script :
- *test-prepare-container
- |
echo 'deb [check-valid-until=no] http://snapshot.debian.org/archive/debian/20230208T130000Z bookworm main' > /etc/apt/sources.list.d/bookworm.list
rm /etc/apt/sources.list.d/debian.sources
apt-get update -qq
# In February 2023 Bookworm snapshot this will install MariaDB 10.6
- apt-get install -qq --yes mariadb-server
# Verify installation of MariaDB from (February 2023) Bookworm
- dpkg -l | grep -e "mariadb-server.*10\.6"
- *test-verify-initial
- *test-enable-sid-repos
# Ensure mariadbd will not crash on next shutdown for any reason
- service mariadb restart
- *test-full-upgrade
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- apt-get purge --yes mariadb*10.?
- *test-verify-final
mariadb-10.6 and Jammy upgrade :
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB and distro
image : ubuntu:jammy
script :
- *test-prepare-container
# Install everything MariaDB currently in Ubuntu Jammy
- apt-get install -qq --yes 'mariadb-*' 'libmariadb*'
# Verify installation of MariaDB from Jammy
- dpkg -l | grep -e "mariadb-server.*10\.6"
- *test-verify-initial
# Install Debian Sid signing keys as Ubuntu does not have them by default
- apt-get install -qq --yes --no-install-recommends curl
- curl -sSLO http://deb.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2023.4_all.deb
- apt-get install -qq --yes ./debian-archive-keyring_*
- *test-enable-sid-repos
# Ensure mariadbd will not crash on next shutdown for any reason
- service mariadb restart
- *test-enable-artifacts-repo
- apt-get install -qq --simulate mariadb-server
- apt-get install -qq --yes mariadb-server
# Due to usrmerge, full-upgrade from Jammy to Trixie or newer cannot work
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- apt-get purge --yes mariadb*10.?
- *test-verify-final
mariadb-10.5 and Bullseye upgrade :
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB and distro
image : debian:bullseye
script :
- *test-prepare-container
# Install everything MariaDB currently in Debian Bullseye
- apt-get install -qq --yes 'default-mysql*' 'mariadb-*' 'libmariadb*'
# Verify installation of MariaDB from Bullseye
- dpkg -l | grep -e "mariadb-server.*10\.5"
- *test-verify-initial
- *test-enable-sid-repos
# Ensure mariadbd will not crash on next shutdown for any reason
- service mariadb restart
- *test-enable-artifacts-repo
- apt-get install -qq --simulate mariadb-server
- apt-get install -qq --yes mariadb-server
# Due to usrmerge, full-upgrade from Bullseye to Trixie or newer cannot work
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- apt-get purge --yes mariadb*10.?
- *test-verify-final
mariadb-10.3 and Buster upgrade :
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB and distro
2020-04-07 19:20:11 +02:00
image : debian:buster
2020-12-30 09:08:23 +01:00
script :
- *test-prepare-container
2024-05-27 12:25:26 +02:00
# Install everything MariaDB currently in Debian Buster
- apt-get install -qq --yes 'default-mysql*' 'mariadb-*' 'libmariadb*'
2020-04-07 19:20:11 +02:00
# Verify installation of MariaDB from Buster
2024-05-27 12:25:26 +02:00
- dpkg -l | grep -e "mariadb-server.*10\.3"
2020-12-30 09:08:23 +01:00
- *test-verify-initial
2024-05-27 12:25:26 +02:00
- *test-enable-sid-repos
# Ensure mariadbd will not crash on next shutdown for any reason
- service mysql restart # in 10.3 service name is still 'mysql'
- *test-enable-artifacts-repo
- apt-get install -qq --simulate mariadb-server
- apt-get install -qq --yes mariadb-server
# Due to usrmerge, full-upgrade from Bullseye to Trixie or newer cannot work
2020-04-07 19:20:11 +02:00
- service mysql status
2024-05-27 12:25:26 +02:00
# mariadb-10.3 in Buster ships a /etc/init.d/mysql and it continues to exist
# after upgrade, and is removed only on purge
- apt-get purge --yes mariadb*10.?
2020-12-30 09:08:23 +01:00
- service mariadb status
2024-05-27 12:25:26 +02:00
# Give the mariadb-upgrade plenty of time to complete, otherwise next commands
# fail on non-existing mariadb.sys user
- sleep 15
- *test-verify-final
mariadb-10.3 and Focal upgrade :
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB and distro
image : ubuntu:focal
script :
- *test-prepare-container
# Install everything MariaDB currently in Ubuntu Focal
- apt-get install -qq --yes 'mariadb-*' 'libmariadb*'
# Verify installation of MariaDB from Focal
- dpkg -l | grep -e "mariadb-server.*10\.3"
- *test-verify-initial
# Install Debian Sid signing keys as Ubuntu does not have them by default
- apt-get install -qq --yes --no-install-recommends curl
- curl -sSLO http://deb.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2023.4_all.deb
- apt-get install -qq --yes ./debian-archive-keyring_*
- *test-enable-sid-repos
# Ensure mariadbd will not crash on next shutdown for any reason
- service mysql restart # in 10.3 service name is still 'mysql'
- *test-enable-artifacts-repo
- apt-get install -qq --simulate mariadb-server
- apt-get install -qq --yes mariadb-server
# Due to usrmerge, full-upgrade from Focal to Trixie or newer cannot work
- service mysql status
# mariadb-10.3 in Focal ships a /etc/init.d/mysql and it continues to exist
# after upgrade, and is removed only on purge
- apt-get purge --yes mariadb*10.?
# Give the mariadb-upgrade plenty of time to complete, otherwise next commands
# fail on non-existing mariadb.sys user
- sleep 15
- *test-verify-final
# Similar to the Cacti install test, check that MariaDB consumer Zoph upgrades
default-mysql-server and Bookworm upgrade :
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB and distro
image : debian:bookworm
script :
- *test-prepare-container
# Install everything MariaDB currently in Debian Bookworm
- apt-get install -qq --yes default-mysql-server zoph
# Verify installation of MariaDB from Bookworm
- dpkg -l | grep -e "mariadb-server.*10\.11"
- *test-verify-initial
- *test-enable-sid-repos
- *test-enable-artifacts-repo
- apt-get install -qq --simulate default-mysql-server
- apt-get install -qq --yes default-mysql-server
- *test-full-upgrade
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- *test-verify-final
# Similar to the Cacti install test, check that MariaDB consumer Zoph upgrades
default-mysql-server and Bullseye upgrade :
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB and distro
image : debian:bullseye
script :
- *test-prepare-container
# Install everything MariaDB currently in Debian Bullseye
- apt-get install -qq --yes default-mysql-server zoph
# Verify installation of MariaDB from Bullseye
- dpkg -l | grep -e "mariadb-server.*10\.5"
- *test-verify-initial
- *test-enable-sid-repos
- *test-enable-artifacts-repo
- apt-get install -qq --simulate default-mysql-server
- apt-get install -qq --yes default-mysql-server
# Due to usrmerge, full-upgrade from Bullseye to Trixie or newer cannot work
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
2020-12-30 09:08:23 +01:00
- *test-verify-final
2020-04-07 19:20:11 +02:00
test basic features :
2024-05-27 12:25:26 +02:00
extends : .salsa-ci-template-for-mariadb
2020-04-07 19:20:11 +02:00
script :
2020-08-23 22:49:43 +02:00
- *test-prepare-container
2024-05-27 12:25:26 +02:00
- *test-install-all
2022-05-03 05:31:15 +02:00
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
2020-08-23 22:49:43 +02:00
- *test-verify-final
- |
# 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()"
- |
# Test TLS connections
dpkg -l | grep -i -e tls -e ssl
# Create user for TCP connection, must have password
mariadb -e "SET PASSWORD FOR 'mysql'@'localhost' = PASSWORD('asdf234');"
cat <<EOF > /root/.my.cnf
[ client]
user=mysql
password=asdf234
protocol=tcp
EOF
2022-12-12 04:20:08 +01:00
export CERT_PATH=/usr/share/mariadb/mariadb-test/std_data
2020-08-23 22:49:43 +02:00
openssl verify -CAfile $CERT_PATH/cacert.pem $CERT_PATH/server-cert.pem
openssl x509 -subject -issuer -noout -in $CERT_PATH/cacert.pem
openssl x509 -subject -issuer -noout -in $CERT_PATH/server-cert.pem
cat <<EOF > /etc/mysql/mariadb.conf.d/tls.cnf
[ client-server]
ssl = on
ssl-ca = $CERT_PATH/cacert.pem
ssl-cert = $CERT_PATH/server-cert.pem
ssl-key = $CERT_PATH/server-key.pem
[ server]
require-secure-transport = on
[ client]
ssl-verify-server-cert = on
EOF
service mariadb restart
mariadb -Bse 'STATUS' | tee result
# Ensure important values present, otherwise fail job
grep --quiet "localhost via TCP/IP" result
mariadb -Bse 'SHOW VARIABLES' | grep -e tls -e ssl | tee result
grep --quiet "have_ssl YES" result
grep --quiet TLSv1.3 result
mariadb -Bse 'SHOW SESSION STATUS' | grep -i -e tls -e ssl | tee result
grep --quiet TLSv1.3 result
2024-05-27 12:25:26 +02:00
# Install Cacti, which in uses dbconfig-common to configure the MariaDB user and
# connection automatically in order to validate that at least one downstream
# server consumer continues to work.
test consumer cacti :
extends : .salsa-ci-template-for-mariadb
script :
- *test-prepare-container
- *test-enable-artifacts-repo
- apt-get install -qq --yes cacti
- mariadb -E -e "SHOW CREATE TABLE version;" cacti
2020-04-07 19:20:11 +02:00
# 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 :
2024-05-27 12:25:26 +02:00
extends : .salsa-ci-template-for-mariadb
2020-04-07 19:20:11 +02:00
script :
2020-08-23 22:49:43 +02:00
- *test-prepare-container
2024-05-27 12:25:26 +02:00
- *test-install-all-libs
- apt-get install -qq --yes pkg-config python3-pip
# See what MySQLdb will build with
- pkg-config --cflags --libs mysqlclient
# MySQLdb is also available in Debian as package python3-mysqldb, but
# install it from pip to force that the client is compiled with
# libmariadb-dev-compat on-the-fly.
# Python 3.11 needs `--break-system-packages` to proceed with this.
- pip3 install --break-system-packages mysqlclient # Compiles module against libmysqlclient
- apt-get purge --yes libmariadb-dev # Not needed for run-time
2020-04-07 19:20:11 +02:00
- python3 -c "import MySQLdb; print(MySQLdb.get_client_info())"
2024-05-27 12:25:26 +02:00
libmysql* to libmariadb* upgrade :
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB
2020-04-07 19:20:11 +02:00
script :
2020-08-23 22:49:43 +02:00
- *test-prepare-container
2024-05-27 12:25:26 +02:00
# Install all libmysql* available in Debian unstable
- apt-get install -qq --yes pkg-config libmysqlclient-dev
2020-04-07 19:20:11 +02:00
- pkg-config --list-all
2024-05-27 12:25:26 +02:00
- pkg-config --cflags mysqlclient # mysqlclient.pc from original package
- *test-enable-artifacts-repo
- apt-get install -qq --yes libmariadb3
- pkg-config --list-all
- apt-get install -qq --yes libmariadb-dev
- pkg-config --list-all
- apt-get install -qq --yes libmariadb-dev-compat
- pkg-config --cflags mysqlclient # mysqlclient.pc from compat package
- pkg-config --list-all
- apt-get install -qq --yes libmariadbd19t64
- pkg-config --list-all
- apt-get install -qq --yes libmariadbd-dev
- pkg-config --list-all
- apt-get install -qq --yes default-libmysqlclient-dev default-libmysqld-dev
2020-08-23 22:49:43 +02:00
- *test-verify-libs
2020-04-07 19:20:11 +02:00
2024-05-27 12:25:26 +02:00
default-libmysqlclient-dev upgrade :
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB
script :
- *test-prepare-container
- apt-get install -qq --yes pkg-config default-libmysqlclient-dev default-libmysqld-dev
- pkg-config --list-all
- *test-full-upgrade-libs
- *test-verify-libs
default-libmysqlclient-dev and Bookworm upgrade :
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB and distro
image : debian:bookworm
2020-04-07 19:20:11 +02:00
script :
2020-08-23 22:49:43 +02:00
- *test-prepare-container
2024-05-27 12:25:26 +02:00
- apt-get install -qq --yes pkg-config default-libmysqlclient-dev
2020-04-07 19:20:11 +02:00
- pkg-config --list-all
2024-05-27 12:25:26 +02:00
- *test-enable-sid-repos
- *test-full-upgrade-libs
- *test-verify-libs
default-libmysqlclient-dev and Bullseye upgrade :
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB and distro
image : debian:bullseye
script :
- *test-prepare-container
- apt-get install -qq --yes pkg-config default-libmysqlclient-dev
- pkg-config --list-all
- *test-enable-sid-repos
# Due to usrmerge, full-upgrade from Bullseye to Trixie or newer cannot work
2020-08-23 22:49:43 +02:00
- *test-install-all-libs
- *test-verify-libs
2024-05-27 12:25:26 +02:00
# No longer possible since as it pulls as dependencies packages that trigger
# usrmerge, which cannot run in a container
#default-libmysqlclient-dev and Buster upgrade:
2020-04-07 19:20:11 +02:00
2020-08-23 22:49:43 +02:00
# Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump.
# The Debian maintainer scripts detect this situation and simply moves old datadir aside and start fresh.
2024-05-27 12:25:26 +02:00
mysql-8.0 in Sid upgrade :
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB variant
image : debian:sid
2020-04-07 19:20:11 +02:00
script :
2020-08-23 22:49:43 +02:00
- *test-prepare-container
2024-05-27 12:25:26 +02:00
# The postinst fails often if 'ps' is missing from system, so install procps
- apt-get install -qq --yes 'mysql*' libmysqlcppconn7t64
# Ensure MySQL 8.0 package actually got installed
- dpkg -l | grep -e "mysql-server.*8\.0"
2020-08-23 22:49:43 +02:00
- *test-verify-initial
2024-05-27 12:25:26 +02:00
- *test-install-all
# Due to some (currently unknown) changes in MySQL 8.0 packaging or apt
# behaviour changes, a system with a previous installation of MySQL 8.0 will
# on upgrades to MariaDB first fully remove MySQL, including the
# /etc/init.d/mysql file, so previous techniques in
# mariadb-server-10.6.postinst to maintain backwards compatibility with
# 'service mysql status' after installing MariaDB on top MySQL no longer
# works. Thus the step to test it now intentionally has a fallback to use
# the service name 'mariadb' instead, and the fallback is always used.
2020-08-23 22:49:43 +02:00
- sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server
2024-05-27 12:25:26 +02:00
- service mysql status || service mariadb status
2020-08-23 22:49:43 +02:00
- *test-verify-final
2023-05-08 10:06:52 +02:00
# Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump.
# The Debian maintainer scripts detect this situation and simply moves old datadir aside and start fresh.
2024-05-27 12:25:26 +02:00
mysql-8.0 in Ubuntu 23.10 upgrade :
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB variant
image : ubuntu:mantic
2022-09-07 13:23:11 +02:00
script :
- *test-prepare-container
2024-05-27 12:25:26 +02:00
- apt-get install -qq --yes procps mysql-server 'libmysqlc*'
# Ensure MySQL 8.0 package actually got installed
- dpkg -l | grep mysql
- service mysql status
- *test-verify-initial
# Install Debian Sid signing keys as Ubuntu does not have them by default
- apt-get install -qq --yes --no-install-recommends curl
- curl -sSLO http://deb.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2023.4_all.deb
- apt-get install -qq --yes ./debian-archive-keyring_*
- *test-enable-sid-repos
# Ensure mysqld will not crash on next shutdown for any reason
- service mysql restart
- *test-enable-artifacts-repo
- apt-get install -qq --simulate mariadb-server
- apt-get install -qq --yes mariadb-server
# Due to usrmerge, full-upgrade from Mantic to Trixie or newer may not work
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
# Remove everything MySQL except mysql-common which also MariaDB depends on
- apt-get purge --yes mysql-s* mysql-cl* libmysql*
- *test-verify-final
# Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump.
# The Debian maintainer scripts detect this situation and simply moves old datadir aside and start fresh.
mysql-community-cluster-8.0 from MySQL.com with Bookworm upgrade :
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB variant
image : debian:bookworm
script :
- *test-prepare-container
- |
apt-get install -qq --yes --no-install-recommends ca-certificates curl systemctl
curl -sS "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xbca43417c3b485dd128ec6d4b7b3b788a8d3785c" -o /etc/apt/trusted.gpg.d/mysql.asc
echo "deb https://repo.mysql.com/apt/debian/ bookworm mysql-cluster-8.0" > /etc/apt/sources.list.d/mysql.list
apt-get update -qq
- apt-get install -qq --yes mysql-cluster-community-server
2023-05-08 10:06:52 +02:00
- sed 's/ExecStartPre=+/ExecStartPre=/' -i /lib/systemd/system/mysql.service # Hack to make file compatible with systemctl shim
- systemctl start mysql
- dpkg -l | grep -iE 'maria|mysql|galera'
- systemctl status mysql; mysql -e 'SELECT VERSION()'
- systemctl stop mysql # Stop manually as maintainer scripts don't handle this with systemctl shim
2024-05-27 12:25:26 +02:00
- *test-enable-sid-repos
- *test-enable-artifacts-repo
- apt-get install -qq --simulate mariadb-server
- apt-get install -qq --yes mariadb-server
2023-05-08 10:06:52 +02:00
# Ignore systemctl shim result as MariaDB systemd file is incompatible with it and yields:
# ERROR:systemctl:the ExecStartPre control process exited with error code
- systemctl status mysql || true
- mysql -e 'SELECT VERSION()' || true
- sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server
2022-09-07 13:23:11 +02:00
- *test-verify-final
2024-05-27 12:25:26 +02:00
mariadb.org-10.11 upgrade :
extends : .salsa-ci-template-for-mariadb-upgrade
stage : upgrade MariaDB variant
variables :
MARIADB_VERSION : "10.11"
2022-11-27 03:19:35 +01:00
script :
2024-05-27 12:25:26 +02:00
- apt-get install -qq --yes mariadb-server
2022-11-27 03:19:35 +01:00
- *test-verify-initial
# Install MariaDB built in this commit
2024-05-27 12:25:26 +02:00
# Force downgrades so our version installs on top of upstream revision, e.g. 1:11.10.1-1 vs 1:11.10.1+mariadb~sid
- apt-get install -qq --yes --allow-downgrades ./*.deb
2022-11-27 03:19:35 +01:00
# Verify installation of MariaDB built in this commit
- dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- mariadb --version # Client version
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- *test-verify-final
2024-05-27 12:25:26 +02:00
mariadb.org-10.10 upgrade :
extends : .salsa-ci-template-for-mariadb-upgrade
stage : upgrade MariaDB variant
variables :
MARIADB_VERSION : "10.10"
2022-11-27 03:19:35 +01:00
script :
2024-05-27 12:25:26 +02:00
# this should not use Sid to begin with
- apt-get install -qq --yes mariadb-server=1:10.10.2+maria~debunstable mariadb-client=1:10.10.2+maria~debunstable
2022-11-27 03:19:35 +01:00
- *test-verify-initial
2024-05-27 12:25:26 +02:00
- *test-full-upgrade
2022-11-27 03:19:35 +01:00
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- *test-verify-final
2024-05-27 12:25:26 +02:00
mariadb.org-10.9 upgrade :
extends : .salsa-ci-template-for-mariadb-upgrade
stage : upgrade MariaDB variant
variables :
MARIADB_VERSION : "10.9"
2022-09-07 13:23:11 +02:00
script :
2024-05-27 12:25:26 +02:00
# this should not use Sid to begin with
- apt-get install -qq --yes mariadb-server=1:10.9.4+maria~debunstable mariadb-client=1:10.9.4+maria~debunstable
2022-09-07 13:23:11 +02:00
- *test-verify-initial
2024-05-27 12:25:26 +02:00
- *test-full-upgrade
2022-09-07 13:23:11 +02:00
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- *test-verify-final
2024-05-27 12:25:26 +02:00
mariadb.org-10.8 upgrade :
extends : .salsa-ci-template-for-mariadb-upgrade
stage : upgrade MariaDB variant
variables :
MARIADB_VERSION : "10.8"
2022-09-07 13:23:11 +02:00
script :
2024-05-27 12:25:26 +02:00
- apt-get install -qq --yes mariadb-server-10.8
2022-09-07 13:23:11 +02:00
- *test-verify-initial
2024-05-27 12:25:26 +02:00
- *test-install-all
2022-09-07 13:23:11 +02:00
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- *test-verify-final
2024-05-27 12:25:26 +02:00
mariadb.org-10.7 upgrade :
extends : .salsa-ci-template-for-mariadb-upgrade
stage : upgrade MariaDB variant
variables :
MARIADB_VERSION : "10.7"
2022-04-12 11:57:19 +02:00
script :
2024-05-27 12:25:26 +02:00
- apt-get install -qq --yes mariadb-server-10.7
2022-04-12 11:57:19 +02:00
- *test-verify-initial
2024-05-27 12:25:26 +02:00
- *test-install-all
2022-05-03 05:31:15 +02:00
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
2022-04-12 11:57:19 +02:00
- *test-verify-final
2024-05-27 12:25:26 +02:00
mariadb.org-10.6 upgrade :
extends : .salsa-ci-template-for-mariadb-upgrade
stage : upgrade MariaDB variant
variables :
MARIADB_VERSION : "10.6"
2020-04-07 19:20:11 +02:00
script :
2024-05-27 12:25:26 +02:00
# Package libmariadbclient-dev from mariadb.org conflicts with libmariadb-dev in Sid, so cannot use wildcard that would include it
# Enable this line when there is a way to install them only from the mariadb.org repo
# - apt-get install -qq --yes 'mariadb*' libmariadb3 'libmariadb-*' 'libmariadbd*'
- apt-get install -qq --yes mariadb-server-10.6
2020-08-23 22:49:43 +02:00
- *test-verify-initial
2024-05-27 12:25:26 +02:00
- *test-install-all
2022-05-03 05:31:15 +02:00
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
2022-03-26 22:55:44 +01:00
- *test-verify-final
2024-05-27 12:25:26 +02:00
# archive.mariadb.org for Debian Sid latest is 10.5.13
mariadb.org-10.5 upgrade :
extends : .salsa-ci-template-for-mariadb-upgrade
stage : upgrade MariaDB variant
variables :
MARIADB_VERSION : "10.5"
2022-03-26 22:55:44 +01:00
script :
2024-05-27 12:25:26 +02:00
- *test-install-openssl1-in-sid-for-backwards-compat
- apt-get install -qq --yes mariadb-server-10.5
2022-03-26 22:55:44 +01:00
- *test-verify-initial
2024-05-27 12:25:26 +02:00
- *test-install-all
2022-05-03 05:31:15 +02:00
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
2020-08-23 22:49:43 +02:00
- *test-verify-final
2020-04-07 19:20:11 +02:00
2024-05-27 12:25:26 +02:00
# archive.mariadb.org for Debian Sid latest is 10.4.17
mariadb.org-10.4 upgrade :
extends : .salsa-ci-template-for-mariadb-upgrade
stage : upgrade MariaDB variant
variables :
MARIADB_VERSION : "10.4"
2020-04-07 19:20:11 +02:00
script :
2023-05-08 10:06:52 +02:00
- *test-install-readline-in-sid-for-backwards-compat
2024-05-27 12:25:26 +02:00
- *test-install-openssl1-in-sid-for-backwards-compat
- *test-install-libaio-in-sid-for-backwards-compat
- apt-get install -qq --yes mariadb-server-10.4
2020-05-14 17:00:13 +02:00
# MariaDB.org version of 10.4 and early 10.5 do not install an init file, so
# it must be installed here manually
- cp /usr/share/mysql/mysql.init /etc/init.d/mysql; chmod +x /etc/init.d/mysql; service mysql start; sleep 5
2020-08-23 22:49:43 +02:00
- *test-verify-initial
2024-05-27 12:25:26 +02:00
- *test-install-all
2020-08-23 22:49:43 +02:00
- sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server
2020-05-14 17:00:13 +02:00
- service mysql status
2020-04-07 19:20:11 +02:00
- service mariadb status
2020-08-23 22:49:43 +02:00
- *test-verify-final
2020-04-07 19:20:11 +02:00
2024-05-27 12:25:26 +02:00
# archive.mariadb.org for Debian Sid latest is 10.3.27
mariadb.org-10.3 upgrade :
extends : .salsa-ci-template-for-mariadb-upgrade
stage : upgrade MariaDB variant
variables :
MARIADB_VERSION : "10.3"
2020-04-07 19:20:11 +02:00
script :
2023-05-08 10:06:52 +02:00
- *test-install-readline-in-sid-for-backwards-compat
2024-05-27 12:25:26 +02:00
- *test-install-openssl1-in-sid-for-backwards-compat
- *test-install-libaio-in-sid-for-backwards-compat
- apt-get install -qq --yes mariadb-server-10.3
2022-03-26 22:55:44 +01:00
- *test-verify-initial
2024-05-27 12:25:26 +02:00
- *test-install-all
# mariadb-10.3 in Buster ships a /etc/init.d/mysql and it continues to exist
# after upgrade, and is removed only on purge
- service mysql status || service mariadb status
2022-03-26 22:55:44 +01:00
# Give the mariadb-upgrade plenty of time to complete, otherwise next commands
# fail on non-existing mariadb.sys user
- sleep 15
2020-08-23 22:49:43 +02:00
- *test-verify-final
2020-04-07 19:20:11 +02:00
2024-05-27 12:25:26 +02:00
# archive.mariadb.org for Debian Sid latest is 10.2.21
mariadb.org-10.2 upgrade :
extends : .salsa-ci-template-for-mariadb-upgrade
stage : upgrade MariaDB variant
variables :
MARIADB_VERSION : "10.2"
script :
- *test-install-readline-in-sid-for-backwards-compat
- *test-install-openssl1-in-sid-for-backwards-compat
- *test-install-libaio-in-sid-for-backwards-compat
- apt-get install -qq --yes mariadb-server-10.2
# Verify initial state before upgrade
- dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- service mysql status
# prepending with --defaults-file=/etc/mysql/debian.cnf is needed in upstream 5.5– 10.3
- |
mysql --defaults-file=/etc/mysql/debian.cnf --skip-column-names -e "SELECT @@version, @@version_comment"
mysql --defaults-file=/etc/mysql/debian.cnf --table -e "SHOW DATABASES;"
mysql --defaults-file=/etc/mysql/debian.cnf --table -e "SELECT * FROM mysql.user; SHOW CREATE USER root@localhost;"
mysql --defaults-file=/etc/mysql/debian.cnf --table -e "SELECT * FROM mysql.plugin; SHOW PLUGINS;"
- *test-install-all
# mariadb-10.2 in ships a /etc/init.d/mysql and it continues to exist
# after upgrade, and is removed only on purge
- service mysql status || service mariadb status
# Give the mariadb-upgrade plenty of time to complete, otherwise next commands
# fail on non-existing mariadb.sys user
- sleep 15
- *test-verify-final
Deb: Update Salsa-CI to use Bullseye instead of Sid
Tests that try to upgrade MariaDB 10.6 in Debian Sid can no longer work
properly on versions < 10.11 as MariaDB 10.11 in now Debian Sid.
Change RELEASE to use Bullseye and refactor builds and upgrade tests to
use primarily Bullseye, as it has MariaDB 10.5 and thus testing upgrades
to MariaDB 10.6 and higher can work. Add on new 'build sid' job to continue
at least on build on Sid as well, even though it is not tested in other
jobs.
Due to this many Sid specific workarounds are can also be dropped, and
since Bullseye is now used for everything, the old bullseye-backports jobs
are obsolete and removed.
Tests that upgrade MySQL in Sid to MariaDB are also removed, as no test
in Debian Sid with MariaDB < 10.11 can reliably work anymore.
Also disable reprotest as unnecessary on old branches, refactor the naming
of autobake-deb.sh and native Debian build jobs to be more clear.
NOTE TO MERGERS: This commit is made on 10.6 branch and can be merged to
all later branches (10.7, 10.8, ..., 11.0). If/when some jobs break, they
will be fixed per branch on follow-up commits.
2023-03-19 04:12:13 +01:00
2024-05-27 12:25:26 +02:00
# Buster is the last Debian release Oracle MySQL 5.7 offers binaries for
2024-05-10 09:23:27 +02:00
mysql.com-5.7 with Buster upgrade :
2024-05-27 12:25:26 +02:00
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB variant
2020-08-23 22:49:43 +02:00
needs :
- job : build
2024-05-10 09:23:27 +02:00
image : debian:buster
2020-04-07 19:20:11 +02:00
script :
2020-08-23 22:49:43 +02:00
- *test-prepare-container
2022-03-26 22:55:44 +01:00
- |
2024-05-10 09:23:27 +02:00
apt-get install -qq --yes --no-install-recommends gpg gpg-agent dirmngr ca-certificates # Bare minimal (<4MB) for apt-key to work
apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 B7B3B788A8D3785C
echo "deb https://repo.mysql.com/apt/debian/ buster mysql-5.7" > /etc/apt/sources.list.d/mysql.list
2023-01-06 06:56:14 +01:00
apt-get update -qq
2024-05-10 09:23:27 +02:00
- apt-get install -qq --yes mysql-server 'libmysqlc*'
# Ensure MySQL 5.7 package actually got installed
- dpkg -l | grep -e "mysql-server.*5.7"
2020-08-23 22:49:43 +02:00
- *test-verify-initial
2024-05-27 12:25:26 +02:00
- *test-enable-sid-repos
- *test-install-all
2023-01-06 06:56:14 +01:00
# Due to some (currently unknown) changes in MySQL 5.7 packaging or apt
# behaviour changes, a system with a previous installation of MySQL will
# on upgrades to MariaDB first fully remove MySQL, including the
# /etc/init.d/mysql file, so previous techniques in
# mariadb-server-10.6.postinst to maintain backwards compatibility with
# 'service mysql status' after installing MariaDB on top MySQL no longer
# works. Thus the step to test it now intentionally has a fallback to use
# the service name 'mariadb' instead, and the fallback is always used.
- sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server
2024-05-27 12:25:26 +02:00
- service mysql status || service mariadb status
2022-03-26 22:55:44 +01:00
- sleep 15 # Give the mysql_upgrade a bit of extra time to complete with MySQL 5.7 before querying the server
2020-08-23 22:49:43 +02:00
- *test-verify-final
2024-05-10 09:23:27 +02:00
# Note: pmm2-client does not exist in the Bookworm repository anymore
percona-xtradb-5.7 with Bookworm upgrade :
2024-05-27 12:25:26 +02:00
extends : .salsa-ci-template-for-mariadb
stage : upgrade MariaDB variant
2024-05-10 09:23:27 +02:00
image : debian:bookworm
2020-08-23 22:49:43 +02:00
script :
- *test-prepare-container
- |
2024-05-10 09:23:27 +02:00
apt-get install -qq --yes --no-install-recommends ca-certificates curl systemctl
curl -sS "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x9334A25F8507EFA5" -o /etc/apt/trusted.gpg.d/percona.asc
echo "deb https://repo.percona.com/apt/ bookworm main" > /etc/apt/sources.list.d/percona.list
2023-01-06 06:56:14 +01:00
apt-get update -qq
2024-05-10 09:23:27 +02:00
- apt-get install -qq --yes percona-xtradb-cluster-full-57 percona-xtrabackup-24 percona-toolkit
# Ensure Percona 5.7 package actually got installed
- dpkg -l | grep -e "percona.*5\.7"
2020-08-23 22:49:43 +02:00
- service mysql status
- *test-verify-initial
2024-05-27 12:25:26 +02:00
- *test-enable-sid-repos
- *test-install-all
# Percona package owned /etc/init.d/mysql, so on removal and upgrade to MariaDB old service name can't be referenced anymore
- service mariadb status
2022-03-26 22:55:44 +01:00
- sleep 15 # Give the mysql_upgrade a bit of extra time to complete with MySQL 5.7 before querying the server
2020-08-23 22:49:43 +02:00
- *test-verify-final