Add Oracle Linux 8 to CI and package builds. (#11776)
* Add OracleLinux 8 to CI and package builds. * Fix OracleLinux dependency handling. * Fix package test code for Oracle Linux.
Austin S. Hemmelgarn committed
Nov 17, 2021 at 08:56 UTC
c44df34acc2d839d1dd06fd4f987142012e18a89
5 files changed
+70
-4
.github/data/build-matrix.json
+5
@@ -81,6 +81,11 @@
81
"artifact_key": "opensuse15.2",
82
"rmjsonc": "zypper rm -y libjson-c-devel"
83
},
84
+ {
85
+ "distro": "oraclelinux:8",
86
+ "artifact_key": "oraclelinux8",
87
+ "rmjsonc": "dnf remove -y json-c-devel"
88
+ },
89
{
90
"distro": "ubuntu:21.10",
91
"artifact_key": "ubuntu21.10",
.github/scripts/pkg-test.sh
+1
-1
@@ -98,7 +98,7 @@ case "${DISTRO}" in
98
debian | ubuntu)
99
install_debian_like
100
;;
101
- fedora)
101
+ fedora | oraclelinux)
102
install_fedora_like
103
;;
104
centos)
.github/workflows/packaging.yml
+2
@@ -70,6 +70,8 @@ jobs:
70
- {distro: opensuse, version: "15.2", pkgclouddistro: opensuse/15.2, format: rpm, base_image: opensuse/leap, platform: linux/arm64/v8, arch: arm64}
71
- {distro: opensuse, version: "15.3", pkgclouddistro: opensuse/15.3, format: rpm, base_image: opensuse/leap, platform: linux/amd64, arch: amd64}
72
- {distro: opensuse, version: "15.3", pkgclouddistro: opensuse/15.3, format: rpm, base_image: opensuse/leap, platform: linux/arm64/v8, arch: arm64}
73
+ - {distro: oraclelinux, version: "8", pkgclouddistro: ol/8, format: rpm, base_image: oraclelinux, platform: linux/amd64, arch: amd64}
74
+ - {distro: oraclelinux, version: "8", pkgclouddistro: ol/8, format: rpm, base_image: oraclelinux, platform: linux/arm64/v8, arch: arm64}
75
# We intentiaonally disable the fail-fast behavior so that a
76
# build failure for one version doesn't prevent us from publishing
77
# successfully built and tested packages for another version.
.github/workflows/repoconfig-packages.yml
+1
@@ -30,6 +30,7 @@ jobs:
30
- {distro: fedora, version: "35", pkgclouddistro: fedora/35, format: rpm, base_image: fedora, platform: linux/amd64, arch: amd64}
31
- {distro: opensuse, version: "15.2", pkgclouddistro: opensuse/15.2, format: rpm, base_image: opensuse/leap, platform: linux/amd64, arch: amd64}
32
- {distro: opensuse, version: "15.3", pkgclouddistro: opensuse/15.3, format: rpm, base_image: opensuse/leap, platform: linux/amd64, arch: amd64}
33
+ - {distro: oraclelinux, version: "8", pkgclouddistro: ol/8, format: rpm, base_image: oraclelinux, platform: linux/amd64, arch: amd64}
34
# We intentiaonally disable the fail-fast behavior so that a
35
# build failure for one version doesn't prevent us from publishing
36
# successfully built and tested packages for another version.
packaging/installer/install-required-packages.sh
+61
-3
@@ -198,7 +198,7 @@ get_os_release() {
198
eval "$(grep -E "^(NAME|ID|ID_LIKE|VERSION|VERSION_ID)=" "${os_release_file}")"
199
for x in "${ID}" ${ID_LIKE}; do
200
case "${x,,}" in
201
- alpine | arch | centos | clear-linux-os | debian | fedora | gentoo | manjaro | opensuse-leap | rhel | sabayon | sles | suse | ubuntu)
201
+ alpine | arch | centos | clear-linux-os | debian | fedora | gentoo | manjaro | opensuse-leap | ol | rhel | sabayon | sles | suse | ubuntu)
202
distribution="${x}"
203
version="${VERSION_ID}"
204
codename="${VERSION}"
@@ -345,7 +345,7 @@ user_picks_distribution() {
345
if [ "${REPLY}" = "yum" ] && [ -z "${distribution}" ]; then
346
REPLY=
347
while [ -z "${REPLY}" ]; do
348
- if ! read -r -p "yum in centos, rhel or fedora? > "; then
348
+ if ! read -r -p "yum in centos, rhel, ol or fedora? > "; then
349
continue
350
fi
351
@@ -353,11 +353,14 @@ user_picks_distribution() {
353
fedora | rhel)
354
distribution="rhel"
355
;;
356
+ ol)
357
+ distribution="ol"
358
+ ;;
359
centos)
360
distribution="centos"
361
;;
362
*)
360
- echo >&2 "Please enter 'centos', 'fedora' or 'rhel'."
363
+ echo >&2 "Please enter 'centos', 'fedora', 'ol' or 'rhel'."
364
REPLY=
365
;;
366
esac
@@ -438,6 +441,17 @@ detect_package_manager_from_distribution() {
441
fi
442
;;
443
444
+ ol*)
445
+ package_installer=
446
+ tree="ol"
447
+ [ -n "${dnf}" ] && package_installer="install_dnf"
448
+ [ -n "${yum}" ] && package_installer="install_yum"
449
+ if [ "${IGNORE_INSTALLED}" -eq 0 ] && [ -z "${package_installer}" ]; then
450
+ echo >&2 "command 'yum' or 'dnf' is required to install packages on a '${distribution} ${version}' system."
451
+ exit 1
452
+ fi
453
+ ;;
454
+
455
suse* | opensuse* | sles*)
456
package_installer="install_zypper"
457
tree="suse"
@@ -501,6 +515,8 @@ check_package_manager() {
515
package_installer="install_dnf"
516
if [ "${distribution}" = "centos" ]; then
517
tree="centos"
518
+ elif [ "${distribution}" = "ol" ]; then
519
+ tree="ol"
520
else
521
tree="rhel"
522
fi
@@ -554,6 +570,8 @@ check_package_manager() {
570
package_installer="install_yum"
571
if [ "${distribution}" = "centos" ]; then
572
tree="centos"
573
+ elif [ "${distribution}" = "ol" ]; then
574
+ tree="ol"
575
else
576
tree="rhel"
577
fi
@@ -791,6 +809,7 @@ declare -A pkg_libz_dev=(
809
['gentoo']="sys-libs/zlib"
810
['sabayon']="sys-libs/zlib"
811
['rhel']="zlib-devel"
812
+ ['ol']="zlib-devel"
813
['suse']="zlib-devel"
814
['clearlinux']="devpkg-zlib"
815
['macos']="NOTREQUIRED"
@@ -807,6 +826,7 @@ declare -A pkg_libuuid_dev=(
826
['gentoo']="sys-apps/util-linux"
827
['sabayon']="sys-apps/util-linux"
828
['rhel']="libuuid-devel"
829
+ ['ol']="libuuid-devel"
830
['suse']="libuuid-devel"
831
['macos']="NOTREQUIRED"
832
['freebsd']="e2fsprogs-libuuid"
@@ -821,6 +841,7 @@ declare -A pkg_libmnl_dev=(
841
['gentoo']="net-libs/libmnl"
842
['sabayon']="net-libs/libmnl"
843
['rhel']="libmnl-devel"
844
+ ['ol']="libmnl-devel"
845
['suse']="libmnl-devel"
846
['clearlinux']="devpkg-libmnl"
847
['macos']="NOTREQUIRED"
@@ -878,6 +899,7 @@ declare -A pkg_netcat=(
899
['gentoo']="net-analyzer/netcat"
900
['sabayon']="net-analyzer/gnu-netcat"
901
['rhel']="nmap-ncat"
902
+ ['ol']="nmap-ncat"
903
['suse']="netcat-openbsd"
904
['clearlinux']="sysadmin-basic"
905
['arch']="gnu-netcat"
@@ -922,6 +944,7 @@ declare -A pkg_pkg_config=(
944
['gentoo']="virtual/pkgconfig"
945
['sabayon']="virtual/pkgconfig"
946
['rhel']="pkgconfig"
947
+ ['ol']="pkgconfig"
948
['suse']="pkg-config"
949
['freebsd']="pkgconf"
950
['clearlinux']="c-basic"
@@ -953,6 +976,7 @@ declare -A pkg_python_mysqldb=(
976
977
# exceptions
978
['fedora-24']="python2-mysql"
979
+ ['ol-8']="WARNING|"
980
)
981
982
declare -A pkg_python3_mysqldb=(
@@ -963,6 +987,7 @@ declare -A pkg_python3_mysqldb=(
987
['gentoo']="dev-python/mysqlclient"
988
['sabayon']="dev-python/mysqlclient"
989
['rhel']="WARNING|"
990
+ ['ol']="WARNING|"
991
['suse']="WARNING|"
992
['clearlinux']="WARNING|"
993
['macos']="WARNING|"
@@ -994,6 +1019,7 @@ declare -A pkg_python_psycopg2=(
1019
['gentoo']="dev-python/psycopg"
1020
['sabayon']="dev-python/psycopg:2"
1021
['rhel']="python-psycopg2"
1022
+ ['ol']="python-psycopg2"
1023
['suse']="python-psycopg2"
1024
['clearlinux']="WARNING|"
1025
['macos']="WARNING|"
@@ -1008,6 +1034,7 @@ declare -A pkg_python3_psycopg2=(
1034
['gentoo']="dev-python/psycopg"
1035
['sabayon']="dev-python/psycopg:2"
1036
['rhel']="WARNING|"
1037
+ ['ol']="WARNING|"
1038
['suse']="WARNING|"
1039
['clearlinux']="WARNING|"
1040
['macos']="WARNING|"
@@ -1017,6 +1044,7 @@ declare -A pkg_python3_psycopg2=(
1044
['centos-8']="python38-psycopg2"
1045
['rhel-7']="python3-psycopg2"
1046
['rhel-8']="python38-psycopg2"
1047
+ ['ol-8']="python3-psycopg2"
1048
)
1049
1050
declare -A pkg_python_pip=(
@@ -1047,6 +1075,7 @@ declare -A pkg_python_pymongo=(
1075
['suse']="python-pymongo"
1076
['clearlinux']="WARNING|"
1077
['rhel']="WARNING|"
1078
+ ['ol']="WARNING|"
1079
['macos']="WARNING|"
1080
['default']="python-pymongo"
1081
)
@@ -1060,6 +1089,7 @@ declare -A pkg_python3_pymongo=(
1089
['suse']="python3-pymongo"
1090
['clearlinux']="WARNING|"
1091
['rhel']="WARNING|"
1092
+ ['ol']="WARNING|"
1093
['freebsd']="py37-pymongo"
1094
['macos']="WARNING|"
1095
['default']="python3-pymongo"
@@ -1068,6 +1098,7 @@ declare -A pkg_python3_pymongo=(
1098
['centos-8']="python3-pymongo"
1099
['rhel-7']="python36-pymongo"
1100
['rhel-8']="python3-pymongo"
1101
+ ['ol-8']="python3-pymongo"
1102
)
1103
1104
declare -A pkg_python_requests=(
@@ -1103,6 +1134,7 @@ declare -A pkg_python3_requests=(
1134
['centos-8']="python3-requests"
1135
['rhel-7']="python36-requests"
1136
['rhel-8']="python3-requests"
1137
+ ['ol-8']="python3-requests"
1138
)
1139
1140
declare -A pkg_lz4=(
@@ -1206,6 +1238,7 @@ declare -A pkg_valgrind=(
1238
declare -A pkg_ulogd=(
1239
['centos']="WARNING|"
1240
['rhel']="WARNING|"
1241
+ ['ol']="WARNING|"
1242
['clearlinux']="WARNING|"
1243
['gentoo']="app-admin/ulogd"
1244
['arch']="ulogd"
@@ -1235,6 +1268,7 @@ declare -A pkg_libelf=(
1268
['fedora']="elfutils-libelf-devel"
1269
['centos']="elfutils-libelf-devel"
1270
['rhel']="elfutils-libelf-devel"
1271
+ ['ol']="elfutils-libelf-devel"
1272
['clearlinux']="devpkg-elfutils"
1273
['suse']="libelf-devel"
1274
['macos']="NOTREQUIRED"
@@ -1544,6 +1578,30 @@ validate_tree_freebsd() {
1578
fi
1579
}
1580
1581
+validate_tree_ol() {
1582
+ local opts=
1583
+ if [ "${NON_INTERACTIVE}" -eq 1 ]; then
1584
+ echo >&2 "Running in non-interactive mode"
1585
+ opts="-y"
1586
+ fi
1587
+
1588
+ if [[ "${version}" =~ ^8(\..*)?$ ]]; then
1589
+ echo " > Checking for CodeReady Builder ..."
1590
+ if ! run ${sudo} dnf repolist | grep -q codeready; then
1591
+ if prompt "CodeReady Builder not found, shall I install it?"; then
1592
+ cat > /etc/yum.repos.d/ol8_codeready.repo <<-EOF
1593
+ [ol8_codeready_builder]
1594
+ name=Oracle Linux \$releasever CodeReady Builder (\$basearch)
1595
+ baseurl=http://yum.oracle.com/repo/OracleLinux/OL8/codeready/builder/\$basearch
1596
+ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
1597
+ gpgcheck=1
1598
+ enabled=1
1599
+ EOF
1600
+ fi
1601
+ fi
1602
+ fi
1603
+}
1604
+
1605
validate_tree_centos() {
1606
local opts=
1607
if [ "${NON_INTERACTIVE}" -eq 1 ]; then