mirror of
				https://github.com/MariaDB/server.git
				synced 2025-11-04 04:46:15 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			726 lines
		
	
	
	
		
			28 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			726 lines
		
	
	
	
		
			28 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
---
 | 
						||
# Include 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
 | 
						||
 | 
						||
# Override Salsa-CI with MariaDB specific variations
 | 
						||
variables:
 | 
						||
  DEB_BUILD_OPTIONS: "nocheck noautodbgsym"
 | 
						||
  RELEASE: bullseye
 | 
						||
  SALSA_CI_DISABLE_REPROTEST: 1
 | 
						||
  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
 | 
						||
  SALSA_CI_GBP_BUILDPACKAGE_ARGS: "--git-submodules" # did not apply to extract-sources
 | 
						||
 | 
						||
stages:
 | 
						||
  - provisioning
 | 
						||
  - build
 | 
						||
  - test
 | 
						||
  - upgrade in Bullseye
 | 
						||
  - upgrade from Buster/Stretch
 | 
						||
  - upgrade extras
 | 
						||
  - test extras
 | 
						||
  - publish # Stage referenced by Salsa-CI template aptly stanza, so must exist even though not used
 | 
						||
 | 
						||
build:
 | 
						||
  extends: .build-package
 | 
						||
  script: &autobake-deb-steps
 | 
						||
    # Run Salsa-CI .build-before-script equivalent
 | 
						||
    - mkdir -p ${WORKING_DIR} ${CCACHE_WORK_DIR}
 | 
						||
    - mv ${CCACHE_WORK_DIR} ${CCACHE_TMP_DIR}
 | 
						||
    # Run Salsa-CI .build-script equivalent, with extra devscripts so autobake-deb.sh can run 'dch'
 | 
						||
    - export CCACHE_DIR=${CCACHE_TMP_DIR}
 | 
						||
    - apt-get update && eatmydata apt-get install --no-install-recommends -y ccache fakeroot build-essential devscripts lsb-release
 | 
						||
    - cd ${WORKING_DIR}/${SOURCE_DIR}
 | 
						||
    - eatmydata apt-get build-dep --no-install-recommends -y .
 | 
						||
    - update-ccache-symlinks; ccache -z # Zero out ccache counters
 | 
						||
    - 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
 | 
						||
    - cd ${WORKING_DIR}
 | 
						||
    - rm -rf ${WORKING_DIR}/${SOURCE_DIR}
 | 
						||
    - 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
 | 
						||
    - mv ${CCACHE_TMP_DIR} ${CCACHE_WORK_DIR}
 | 
						||
 | 
						||
# build jobs often needs more than default GitLab timeout (1h)
 | 
						||
.build-package:
 | 
						||
  timeout: 3h
 | 
						||
 | 
						||
build buster-backports:
 | 
						||
  extends: .build-package
 | 
						||
  script:
 | 
						||
    - *autobake-deb-steps
 | 
						||
  variables:
 | 
						||
    RELEASE: buster-backports
 | 
						||
 | 
						||
build stretch-backports:
 | 
						||
  extends: .build-package
 | 
						||
  script:
 | 
						||
    - *autobake-deb-steps
 | 
						||
  variables:
 | 
						||
    RELEASE: stretch-backports
 | 
						||
 | 
						||
# base image missing git
 | 
						||
build i386:
 | 
						||
  extends: .build-package
 | 
						||
  script:
 | 
						||
    - apt-get update && apt-get install -y --no-install-recommends git
 | 
						||
    - *autobake-deb-steps
 | 
						||
  image: $SALSA_CI_IMAGES_BASE_I386
 | 
						||
  variables:
 | 
						||
    ARCH: 'i386'
 | 
						||
 | 
						||
build native deb:
 | 
						||
  extends: .build-package
 | 
						||
 | 
						||
piuparts:
 | 
						||
  extends: .test-piuparts
 | 
						||
  stage: test extras
 | 
						||
 | 
						||
blhc:
 | 
						||
  extends: .test-blhc
 | 
						||
  stage: test extras
 | 
						||
  needs:
 | 
						||
    - job: build native deb
 | 
						||
 | 
						||
# In addition to Salsa-CI, also run these fully MariaDB specific build jobs
 | 
						||
 | 
						||
# Define snippets used to construct jobs
 | 
						||
 | 
						||
.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
 | 
						||
  # Prime the apt cache so later apt commands can run
 | 
						||
  apt-get update
 | 
						||
 | 
						||
.test-verify-initial: &test-verify-initial |
 | 
						||
  dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
 | 
						||
  service mysql status || service mariadb status # Early MariaDB 10.5 only had 'mariadb'
 | 
						||
  mysql --skip-column-names -e "select @@version, @@version_comment" # Show version
 | 
						||
  mysql --table -e "SHOW DATABASES;" # List databases before upgrade
 | 
						||
  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
 | 
						||
 | 
						||
.test-enable-bullseye-repos: &test-enable-bullseye-repos |
 | 
						||
  # Replace any old repos with just Bullseye
 | 
						||
  echo "deb http://deb.debian.org/debian bullseye main" > /etc/apt/sources.list
 | 
						||
  # Upgrade minimal stack first
 | 
						||
  apt-get update
 | 
						||
  apt-get install -y apt
 | 
						||
 | 
						||
.test-install: &test-install |
 | 
						||
  # Install MariaDB built in this commit
 | 
						||
  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
 | 
						||
 | 
						||
.test-verify-final: &test-verify-final |
 | 
						||
  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
 | 
						||
  cp -ra /var/log/mysql debug/var-log-mysql
 | 
						||
  mariadb --skip-column-names -e "select @@version, @@version_comment" # Show version
 | 
						||
  mariadb --table -e "SHOW DATABASES;" # List databases
 | 
						||
  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;"
 | 
						||
 | 
						||
.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
 | 
						||
  - apt-get install -y --no-install-recommends g++
 | 
						||
 | 
						||
.test-install-all-libs: &test-install-all-libs
 | 
						||
  - apt-get install -y ./libmariadb3_*.deb ./libmariadb-dev_*.deb ./libmariadb-dev-compat_*.deb ./libmariadbd19_*.deb ./libmariadbd-dev_*.deb ./mariadb-common_*.deb
 | 
						||
 | 
						||
fresh install:
 | 
						||
  stage: test
 | 
						||
  needs:
 | 
						||
    - job: build
 | 
						||
  image: debian:${RELEASE}
 | 
						||
  artifacts:
 | 
						||
    when: always
 | 
						||
    name: "$CI_BUILD_NAME"
 | 
						||
    paths:
 | 
						||
      - ${WORKING_DIR}/debug
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    - *test-install
 | 
						||
    - service mariadb status # There is no init.d/mysql in MariaDB 10.5
 | 
						||
    - *test-verify-final
 | 
						||
  variables:
 | 
						||
    GIT_STRATEGY: none
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 | 
						||
 | 
						||
mariadb-10.5 Bullseye upgrade:
 | 
						||
  stage: upgrade in Bullseye
 | 
						||
  needs:
 | 
						||
    - job: build
 | 
						||
  image: debian:${RELEASE}
 | 
						||
  artifacts:
 | 
						||
    when: always
 | 
						||
    name: "$CI_BUILD_NAME"
 | 
						||
    paths:
 | 
						||
      - ${WORKING_DIR}/debug
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    - *test-install
 | 
						||
    - service mariadb status # There is no init.d/mysql in MariaDB 10.5
 | 
						||
    - *test-verify-final
 | 
						||
  variables:
 | 
						||
    GIT_STRATEGY: none
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 | 
						||
 | 
						||
mariadb-10.3 Buster to mariadb-10.5 upgrade:
 | 
						||
  stage: upgrade from Buster/Stretch
 | 
						||
  needs:
 | 
						||
    - job: build
 | 
						||
  image: debian:buster
 | 
						||
  artifacts:
 | 
						||
    when: always
 | 
						||
    name: "$CI_BUILD_NAME"
 | 
						||
    paths:
 | 
						||
      - ${WORKING_DIR}/debug
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    # Install everything MariaDB currently in Debian Buster
 | 
						||
    - apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadb*'
 | 
						||
    # Verify installation of MariaDB from Buster
 | 
						||
    - *test-verify-initial
 | 
						||
    - *test-enable-bullseye-repos
 | 
						||
    - *test-install
 | 
						||
    - service mysql status
 | 
						||
    - *test-verify-final
 | 
						||
  variables:
 | 
						||
    GIT_STRATEGY: none
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 | 
						||
 | 
						||
mariadb-10.1 Stretch to mariadb-10.5 upgrade:
 | 
						||
  stage: upgrade from Buster/Stretch
 | 
						||
  needs:
 | 
						||
    - job: build
 | 
						||
  image: debian:stretch
 | 
						||
  artifacts:
 | 
						||
    when: always
 | 
						||
    name: "$CI_BUILD_NAME"
 | 
						||
    paths:
 | 
						||
      - ${WORKING_DIR}/debug
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    # Install almost everything currently in Debian Stretch,
 | 
						||
    # omitting libmariadbclient-dev-compat as it would conflict
 | 
						||
    - apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadbd*' 'libmariadbclient*'
 | 
						||
    # Verify installation of MariaDB from Stretch
 | 
						||
    - *test-verify-initial
 | 
						||
    - *test-enable-bullseye-repos
 | 
						||
    - *test-install
 | 
						||
    - service mysql status
 | 
						||
    - *test-verify-final
 | 
						||
  variables:
 | 
						||
    GIT_STRATEGY: none
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 | 
						||
 | 
						||
test basic features:
 | 
						||
  stage: test
 | 
						||
  needs:
 | 
						||
    - job: build
 | 
						||
  image: debian:${RELEASE}
 | 
						||
  artifacts:
 | 
						||
    when: always
 | 
						||
    name: "$CI_BUILD_NAME"
 | 
						||
    paths:
 | 
						||
      - ${WORKING_DIR}/debug
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    - *test-install
 | 
						||
    - service mariadb status # There is no init.d/mysql in MariaDB 10.5
 | 
						||
    - *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
 | 
						||
      export CERT_PATH=/usr/share/mysql/mysql-test/std_data
 | 
						||
      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
 | 
						||
  variables:
 | 
						||
    GIT_STRATEGY: none
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 | 
						||
 | 
						||
# 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
 | 
						||
  needs:
 | 
						||
    - job: build
 | 
						||
  image: debian:${RELEASE}
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    # Run each step separately to avoid an 800+ line chunk that lacks the
 | 
						||
    # commands themselves printed and Gitlab-CI cutting off the output
 | 
						||
    - apt-get install -y pkg-config ./libmariadb-dev*.deb ./libmariadb3_*.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
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 | 
						||
 | 
						||
default-libmysqlclient-dev Bullseye upgrade:
 | 
						||
  stage: upgrade in Bullseye
 | 
						||
  needs:
 | 
						||
    - job: build
 | 
						||
  image: debian:${RELEASE}
 | 
						||
  artifacts:
 | 
						||
    when: always
 | 
						||
    name: "$CI_BUILD_NAME"
 | 
						||
    paths:
 | 
						||
      - ${WORKING_DIR}/debug
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    - apt-get install -y pkg-config default-libmysqlclient-dev default-libmysqld-dev
 | 
						||
    - pkg-config --list-all
 | 
						||
    - *test-install-all-libs
 | 
						||
    - *test-verify-libs
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 | 
						||
 | 
						||
default-libmysqlclient-dev Buster upgrade:
 | 
						||
  stage: upgrade from Buster/Stretch
 | 
						||
  needs:
 | 
						||
    - job: build
 | 
						||
  image: debian:buster
 | 
						||
  artifacts:
 | 
						||
    when: always
 | 
						||
    name: "$CI_BUILD_NAME"
 | 
						||
    paths:
 | 
						||
      - ${WORKING_DIR}/debug
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    - apt-get install -y pkg-config default-libmysqlclient-dev
 | 
						||
    - pkg-config --list-all
 | 
						||
    - *test-enable-bullseye-repos
 | 
						||
    - *test-install-all-libs
 | 
						||
    - *test-verify-libs
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 | 
						||
 | 
						||
default-libmysqlclient-dev Stretch upgrade:
 | 
						||
  stage: upgrade from Buster/Stretch
 | 
						||
  needs:
 | 
						||
    - job: build
 | 
						||
  image: debian:stretch
 | 
						||
  artifacts:
 | 
						||
    when: always
 | 
						||
    name: "$CI_BUILD_NAME"
 | 
						||
    paths:
 | 
						||
      - ${WORKING_DIR}/debug
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    - apt-get install -y pkg-config default-libmysqlclient-dev
 | 
						||
    - pkg-config --list-all
 | 
						||
    - *test-enable-bullseye-repos
 | 
						||
    - *test-install-all-libs
 | 
						||
    - *test-verify-libs
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 | 
						||
 | 
						||
mariadb-connector-c Stretch upgrade:
 | 
						||
  stage: upgrade from Buster/Stretch
 | 
						||
  needs:
 | 
						||
    - job: build
 | 
						||
  image: debian:stretch
 | 
						||
  artifacts:
 | 
						||
    when: always
 | 
						||
    name: "$CI_BUILD_NAME"
 | 
						||
    paths:
 | 
						||
      - ${WORKING_DIR}/debug
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    - apt-get install -y pkg-config libmariadb2 libmariadb-dev libmariadb-dev-compat
 | 
						||
    - pkg-config --list-all
 | 
						||
    - *test-enable-bullseye-repos
 | 
						||
    - *test-install-all-libs
 | 
						||
    - *test-verify-libs
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 | 
						||
 | 
						||
# 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-8.0 Focal to mariadb-10.5 upgrade:
 | 
						||
  stage: upgrade extras
 | 
						||
  needs:
 | 
						||
    - job: build buster-backports
 | 
						||
  image: debian:buster
 | 
						||
  artifacts:
 | 
						||
    when: always
 | 
						||
    name: "$CI_BUILD_NAME"
 | 
						||
    paths:
 | 
						||
      - ${WORKING_DIR}/debug
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    # Add Ubuntu Focal archive keys and repository
 | 
						||
    - apt-get install --no-install-recommends --yes 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 871920D1991BC93C 3B4FE6ACC0B21F32
 | 
						||
    - echo "deb http://archive.ubuntu.com/ubuntu/ focal main restricted" > /etc/apt/sources.list.d/ubuntu.list
 | 
						||
    - apt-get update
 | 
						||
    # First install often fail due to bug in mysql-8.0
 | 
						||
    - apt-get install -y mysql-server 'libmysqlc*' || true
 | 
						||
    - sleep 10 && apt-get install -f
 | 
						||
    - *test-verify-initial
 | 
						||
    # Enable backports to make galera-4 available
 | 
						||
    - echo "deb http://deb.debian.org/debian buster-backports main" > /etc/apt/sources.list.d/backports.list && apt-get update
 | 
						||
    - *test-install
 | 
						||
    - service mysql status
 | 
						||
    - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server
 | 
						||
    - *test-verify-final
 | 
						||
  variables:
 | 
						||
    GIT_STRATEGY: none
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 | 
						||
 | 
						||
mysql-5.7 Bionic to mariadb-10.5 upgrade:
 | 
						||
  stage: upgrade extras
 | 
						||
  needs:
 | 
						||
    - job: build stretch-backports
 | 
						||
  image: debian:stretch
 | 
						||
  artifacts:
 | 
						||
    when: always
 | 
						||
    name: "$CI_BUILD_NAME"
 | 
						||
    paths:
 | 
						||
      - ${WORKING_DIR}/debug
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    # Add Ubuntu Bionic archive keys and repository
 | 
						||
    - apt-get install --no-install-recommends --yes 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 871920D1991BC93C 3B4FE6ACC0B21F32
 | 
						||
    - echo "deb http://archive.ubuntu.com/ubuntu/ bionic main restricted" > /etc/apt/sources.list.d/ubuntu.list
 | 
						||
    - apt-get update
 | 
						||
    - apt-get install -y 'mysql*' 'libmysqlc*'
 | 
						||
    - *test-verify-initial
 | 
						||
    # Enable backports to make libzstd1, rocksdb-tools
 | 
						||
    - echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list.d/backports.list
 | 
						||
    # Enable backports to make galera-4 available
 | 
						||
    - echo "deb http://deb.debian.org/debian stretch-backports-sloppy main" >> /etc/apt/sources.list.d/backports.list && apt-get update
 | 
						||
    # Remove plugin that requires libcurl4, not available in Debian Stretch
 | 
						||
    - rm mariadb-plugin-s3*.deb
 | 
						||
    - *test-install
 | 
						||
    - service mysql status
 | 
						||
    - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server
 | 
						||
    - *test-verify-final
 | 
						||
  variables:
 | 
						||
    GIT_STRATEGY: none
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 | 
						||
 | 
						||
# As Bullseye already has MariaDB 10.5, upstream does not provide any <10.5
 | 
						||
# packages for Bullseye and thus no upgrades on lower versions can be tested
 | 
						||
# inside Bullseye
 | 
						||
mariadb.org-10.5 to mariadb-10.5 upgrade:
 | 
						||
  stage: upgrade extras
 | 
						||
  needs:
 | 
						||
    - job: build
 | 
						||
  image: debian:${RELEASE}
 | 
						||
  artifacts:
 | 
						||
    when: always
 | 
						||
    name: "$CI_BUILD_NAME"
 | 
						||
    paths:
 | 
						||
      - ${WORKING_DIR}/debug
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    - apt install -y curl
 | 
						||
    - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc
 | 
						||
    - echo "deb https://archive.mariadb.org/mariadb-10.5/repo/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list
 | 
						||
    - apt-get update
 | 
						||
    # The 10.5.9 release is missing mariadb-plugin-columnstore, define all other packages but it to avoid hitting the error:
 | 
						||
    #   The following packages have unmet dependencies:
 | 
						||
    #   mariadb-plugin-columnstore : Depends: mariadb-server-10.5 (= 1:10.5.8+maria~sid) but 1:10.5.9+maria~sid is to be installed
 | 
						||
    - apt-get install -y libmariadb3 'libmariadb-*' 'libmariadbd*' 'mariadb-c*' 'mariadb-b*' 'mariadb-s*' 'mariadb-t*' 'mariadb-plugin-con*' 'mariadb-plugin-cr*' 'mariadb-plugin-g*' 'mariadb-plugin-m*' 'mariadb-plugin-o*' 'mariadb-plugin-s*'
 | 
						||
    # Once 10.5.10 is out, revert back to:
 | 
						||
    # Package libmariadbclient-dev from mariadb.org conflicts with libmariadb-dev in Bullseye, so cannot use wildcard that would include it
 | 
						||
    #- apt-get install -y 'mariadb*' libmariadb3 'libmariadb-*' 'libmariadbd*'
 | 
						||
    - *test-verify-initial
 | 
						||
    # Install MariaDB built in this commit
 | 
						||
    # Force downgrades so our version installs on top of upstream revision, e.g. 1:10.5.5-1 vs 1:10.5.5+mariadb~sid
 | 
						||
    - apt-get install -y --allow-downgrades ./*.deb
 | 
						||
    # 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
 | 
						||
  variables:
 | 
						||
    GIT_STRATEGY: none
 | 
						||
    RELEASE: bullseye # Last Debian release that MariaDB.org published 10.5 binaries for
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 | 
						||
 | 
						||
mariadb.org-10.4 to mariadb-10.5 upgrade:
 | 
						||
  stage: upgrade extras
 | 
						||
  needs:
 | 
						||
    - job: build buster-backports
 | 
						||
  image: debian:${RELEASE}
 | 
						||
  artifacts:
 | 
						||
    when: always
 | 
						||
    name: "$CI_BUILD_NAME"
 | 
						||
    paths:
 | 
						||
      - ${WORKING_DIR}/debug
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    - apt install -y curl
 | 
						||
    - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc
 | 
						||
    - echo "deb https://archive.mariadb.org/mariadb-10.4/repo/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list
 | 
						||
    - apt-get update
 | 
						||
    - apt-get install -y mariadb-server-10.4
 | 
						||
    # 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
 | 
						||
    - *test-verify-initial
 | 
						||
    - *test-install
 | 
						||
    - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server
 | 
						||
    - service mysql status
 | 
						||
    - service mariadb status
 | 
						||
    - *test-verify-final
 | 
						||
  variables:
 | 
						||
    GIT_STRATEGY: none
 | 
						||
    RELEASE: buster # Last Debian release that MariaDB.org published 10.4 binaries for
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 | 
						||
 | 
						||
mariadb.org-10.3 to mariadb-10.5 upgrade:
 | 
						||
  stage: upgrade extras
 | 
						||
  needs:
 | 
						||
    - job: build buster-backports
 | 
						||
  image: debian:${RELEASE}
 | 
						||
  artifacts:
 | 
						||
    when: always
 | 
						||
    name: "$CI_BUILD_NAME"
 | 
						||
    paths:
 | 
						||
      - ${WORKING_DIR}/debug
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    - apt install -y curl
 | 
						||
    - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc
 | 
						||
    - echo "deb https://archive.mariadb.org/mariadb-10.3/repo/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list
 | 
						||
    - apt-get update
 | 
						||
    - apt-get install -y mariadb-server-10.3
 | 
						||
    - *test-verify-initial
 | 
						||
    # Enable backports to make galera-4 available
 | 
						||
    - echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list.d/backports.list && apt-get update
 | 
						||
    - *test-install
 | 
						||
    - service mysql 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
 | 
						||
  variables:
 | 
						||
    GIT_STRATEGY: none
 | 
						||
    RELEASE: buster # Last Debian release that MariaDB.org published 10.3 binaries for
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 | 
						||
 | 
						||
mariadb.org-10.2 to mariadb-10.5 upgrade:
 | 
						||
  stage: upgrade extras
 | 
						||
  needs:
 | 
						||
    - job: build stretch-backports
 | 
						||
  image: debian:${RELEASE}
 | 
						||
  artifacts:
 | 
						||
    when: always
 | 
						||
    name: "$CI_BUILD_NAME"
 | 
						||
    paths:
 | 
						||
      - ${WORKING_DIR}/debug
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    - apt install -y curl apt-transport-https
 | 
						||
    - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc
 | 
						||
    - echo "deb https://archive.mariadb.org/mariadb-10.2/repo/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list
 | 
						||
    - apt-get update
 | 
						||
    - apt-get install -y 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;"
 | 
						||
    # Enable backports to make libzstd1, rocksdb-tools
 | 
						||
    - echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list.d/backports.list
 | 
						||
    # Enable backports to make galera-4 available
 | 
						||
    - echo "deb http://deb.debian.org/debian stretch-backports-sloppy main" >> /etc/apt/sources.list.d/backports.list && apt-get update
 | 
						||
    # Increase default backports priority policy from '100' to '500' so it can actually be used
 | 
						||
    - |
 | 
						||
      cat << EOF > /etc/apt/preferences.d/enable-backports-to-satisfy-dependencies
 | 
						||
      Package: *
 | 
						||
      Pin: release n=stretch-*
 | 
						||
      Pin-Priority: 500
 | 
						||
      EOF
 | 
						||
    # Remove plugin that requires libcurl4, not available in Debian Stretch
 | 
						||
    - rm mariadb-plugin-s3*.deb
 | 
						||
    - *test-install
 | 
						||
    - service mysql 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
 | 
						||
  variables:
 | 
						||
    GIT_STRATEGY: none
 | 
						||
    RELEASE: stretch # Last Debian release that MariaDB.org published 10.2 binaries for
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 | 
						||
 | 
						||
mysql.com-5.7 to mariadb-10.5 upgrade:
 | 
						||
  stage: upgrade extras
 | 
						||
  needs:
 | 
						||
    - job: build buster-backports
 | 
						||
  image: debian:buster
 | 
						||
  artifacts:
 | 
						||
    when: always
 | 
						||
    name: "$CI_BUILD_NAME"
 | 
						||
    paths:
 | 
						||
      - ${WORKING_DIR}/debug
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    - |
 | 
						||
      apt-get install --no-install-recommends --yes 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 467B942D3A79BD29
 | 
						||
      echo "deb https://repo.mysql.com/apt/debian/ buster mysql-5.7" > /etc/apt/sources.list.d/mysql.list
 | 
						||
      apt-get update
 | 
						||
      apt-get install -y 'mysql*' 'libmysqlc*'
 | 
						||
    - *test-verify-initial
 | 
						||
    # Enable backports to make galera-4 available
 | 
						||
    - echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list.d/backports.list && apt-get update
 | 
						||
    - *test-install
 | 
						||
    - service mysql status
 | 
						||
    - sleep 15 # Give the mysql_upgrade a bit of extra time to complete with MySQL 5.7 before querying the server
 | 
						||
    - *test-verify-final
 | 
						||
  variables:
 | 
						||
    GIT_STRATEGY: none
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 | 
						||
 | 
						||
percona-xtradb-5.7 to mariadb-10.5 upgrade (MDEV-22679):
 | 
						||
  stage: upgrade extras
 | 
						||
  needs:
 | 
						||
    - job: build buster-backports
 | 
						||
  image: debian:buster
 | 
						||
  artifacts:
 | 
						||
    when: always
 | 
						||
    name: "$CI_BUILD_NAME"
 | 
						||
    paths:
 | 
						||
      - ${WORKING_DIR}/debug
 | 
						||
  script:
 | 
						||
    - *test-prepare-container
 | 
						||
    - |
 | 
						||
      apt-get install --no-install-recommends --yes 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 9334A25F8507EFA5
 | 
						||
      echo "deb https://repo.percona.com/apt/ buster main" > /etc/apt/sources.list.d/mysql.list
 | 
						||
      apt-get update
 | 
						||
      apt-get install -y percona-xtradb-cluster-full-57 percona-xtrabackup-24 percona-toolkit pmm2-client
 | 
						||
    - service mysql status
 | 
						||
    - *test-verify-initial
 | 
						||
    # Enable backports to make galera-4 available
 | 
						||
    - echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list.d/backports.list && apt-get update
 | 
						||
    - *test-install
 | 
						||
    - service mysql status
 | 
						||
    - sleep 15 # Give the mysql_upgrade a bit of extra time to complete with MySQL 5.7 before querying the server
 | 
						||
    - *test-verify-final
 | 
						||
  variables:
 | 
						||
    GIT_STRATEGY: none
 | 
						||
  except:
 | 
						||
    variables:
 | 
						||
      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
 |