]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Add automatic detection of suite to CI scripts
authorRalf Habacker <ralf.habacker@freenet.de>
Mon, 4 Apr 2022 07:22:54 +0000 (09:22 +0200)
committerRalf Habacker <ralf.habacker@freenet.de>
Mon, 4 Apr 2022 10:37:50 +0000 (12:37 +0200)
The detection is based on the variable VERSION_CODENAME from
/etc/os-release, which is supported by systemd. For further details see
https://www.freedesktop.org/software/systemd/man/os-release.html.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
.gitlab-ci.yml
tools/ci-build.sh
tools/ci-install.sh

index 70f8dd5823cc3776c22a1da928b7abc8795852dc..b5be79ddb2db282c55e2a6b157c59f824429ad56 100644 (file)
@@ -31,7 +31,6 @@ variables:
   ci_local_packages: "yes"
   ci_parallel: "2"
   ci_sudo: "yes"
-  ci_suite: "bullseye"
   ###
   # IMPORTANT
   # These are the version tags for the docker images the CI runs against.
@@ -151,8 +150,6 @@ debian buster autotools:
   extends: .debian-build
   when: manual
   image: "debian:buster-slim"
-  variables:
-    ci_suite: "buster"
 
 .suse-build:
   extends: .unix-host-build
index bfb6072677036b9ee81e4ee8165f6fb32fc0c021..a7b5969d85ab1b6591bfefa40e9e648b4211fcf5 100755 (executable)
@@ -110,9 +110,8 @@ init_wine() {
 
 # ci_suite:
 # OS suite (release, branch) in which we are testing.
-# Typical values for ci_distro=debian: sid, jessie
-# Typical values for ci_distro=fedora might be 25, rawhide
-: "${ci_suite:=xenial}"
+# Typical values: auto (detect at runtime), ci_distro=debian: bullseye, buster, ci_distro=fedora: 35, rawhide
+: "${ci_suite:=auto}"
 
 # ci_test:
 # If yes, run tests; if no, just build
@@ -138,6 +137,12 @@ if [ "$ci_distro" = "auto" ]; then
     echo "detected ci_distro as '${ci_distro}'"
 fi
 
+# choose suite
+if [ "$ci_suite" = "auto" ]; then
+    ci_suite=$(. /etc/os-release; if test -v VERSION_CODENAME; then echo ${VERSION_CODENAME}; else echo ${VERSION_ID}; fi)
+    echo "detected ci_suite as '${ci_suite}'"
+fi
+
 if [ -n "$ci_docker" ]; then
     exec docker run \
         --env=ci_buildsys="${ci_buildsys}" \
index c3dd2a6a885768a2cbc6becd06069ce8373d91dd..bd46edb28e2fba24b36ba7ff589d2d856e9bcecd 100755 (executable)
@@ -54,9 +54,8 @@ NULL=
 
 # ci_suite:
 # OS suite (release, branch) in which we are testing.
-# Typical values for ci_distro=debian: sid, bullseye
-# Typical values for ci_distro=fedora might be 25, rawhide
-: "${ci_suite:=bullseye}"
+# Typical values: auto (detect at runtime), ci_distro=debian: bullseye, buster, ci_distro=fedora: 35, rawhide
+: "${ci_suite:=auto}"
 
 # ci_variant:
 # One of debug, reduced, legacy, production
@@ -77,6 +76,12 @@ if [ "$ci_distro" = "auto" ]; then
     echo "detected ci_distro as '${ci_distro}'"
 fi
 
+# choose suite
+if [ "$ci_suite" = "auto" ]; then
+    ci_suite=$(. /etc/os-release; if test -v VERSION_CODENAME; then echo ${VERSION_CODENAME}; else echo ${VERSION_ID}; fi)
+    echo "detected ci_suite as '${ci_suite}'"
+fi
+
 if [ -n "$ci_docker" ]; then
     sed \
         -e "s/@ci_distro@/${ci_distro}/" \