diff options
author | Ralf Habacker <ralf.habacker@freenet.de> | 2022-04-04 09:22:54 +0200 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2022-04-04 12:37:50 +0200 |
commit | a3b20acdd472a581b8dd37ec84b2739fe3731df9 (patch) | |
tree | b9e06500e9f0bed77ed27592a60665fd1f6904a0 /tools | |
parent | 82f1aaeea06d40de6da467b07206ba8abadf48a0 (diff) | |
download | dbus-a3b20acdd472a581b8dd37ec84b2739fe3731df9.tar.gz |
Add automatic detection of suite to CI scripts
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>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/ci-build.sh | 11 | ||||
-rwxr-xr-x | tools/ci-install.sh | 11 |
2 files changed, 16 insertions, 6 deletions
diff --git a/tools/ci-build.sh b/tools/ci-build.sh index bfb60726..a7b5969d 100755 --- a/tools/ci-build.sh +++ b/tools/ci-build.sh @@ -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}" \ diff --git a/tools/ci-install.sh b/tools/ci-install.sh index c3dd2a6a..bd46edb2 100755 --- a/tools/ci-install.sh +++ b/tools/ci-install.sh @@ -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}/" \ |