Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xx-info: oracle linux support #53

Merged
merged 2 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ jobs:
image: debian:sid
typ: debian
allow-failure: true
-
image: fedora:35
typ: rhel
allow-failure: false
-
image: ubuntu:20.04
typ: debian
Expand All @@ -71,6 +67,26 @@ jobs:
image: ubuntu:21.10
typ: debian
allow-failure: false
-
image: redhat/ubi8
typ: rhel
allow-failure: false
-
image: fedora:35
typ: rhel
allow-failure: false
-
image: centos:8
typ: rhel
allow-failure: false
-
image: rockylinux/rockylinux:8
typ: rhel
allow-failure: false
-
image: oraclelinux:8
typ: rhel
allow-failure: false
steps:
-
name: Checkout
Expand Down
13 changes: 12 additions & 1 deletion base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#syntax=docker/dockerfile:1.2
# syntax=docker/dockerfile:1.3-labs

ARG TEST_BASE_TYPE=alpine
ARG TEST_BASE_IMAGE=${TEST_BASE_TYPE}
ARG TEST_WITH_DARWIN=false
Expand Down Expand Up @@ -33,6 +34,16 @@ RUN --mount=type=cache,target=/pkg-cache \
WORKDIR /work

FROM ${TEST_BASE_IMAGE} AS test-base-rhel
RUN <<EOT
set -ex
if ! yum install -y epel-release; then
if . /etc/os-release 2>/dev/null; then
if [ "$ID" != "fedora" ]; then
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-${VERSION:0:1}.noarch.rpm
fi
fi
fi
EOT
RUN --mount=type=cache,target=/pkg-cache \
rm -rf /var/cache/yum && \
ln -s /pkg-cache /var/cache/yum && \
Expand Down
13 changes: 12 additions & 1 deletion base/test-info-rhel.bats
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@

load "assert"

vendor="rhel"
if grep </etc/redhat-release "Fedora" 2>/dev/null >/dev/null; then
vendor="fedora"
elif grep </etc/redhat-release "CentOS" 2>/dev/null >/dev/null; then
vendor="centos"
elif grep </etc/redhat-release "Rocky Linux" 2>/dev/null >/dev/null; then
vendor="rocky"
elif [ -f /etc/oracle-release ] && grep </etc/oracle-release "Oracle Linux" 2>/dev/null >/dev/null; then
vendor="ol"
fi

@test "vendor" {
assert_equal "fedora" "$(xx-info vendor)"
assert_equal "$vendor" "$(xx-info vendor)"
}

@test "rhel-arch" {
Expand Down
4 changes: 2 additions & 2 deletions base/xx-info
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fi

vendor=""

if [ "$XX_VENDOR" != "unknown" ] && [ "$XX_VENDOR" != "debian" ] && [ "$XX_VENDOR" != "rhel" ] && [ "$XX_VENDOR" != "fedora" ] && [ "$XX_VENDOR" != "centos" ] && [ "$XX_VENDOR" != "rocky" ] && [ "$XX_VENDOR" != "ubuntu" ]; then
if [ "$XX_VENDOR" != "unknown" ] && [ "$XX_VENDOR" != "debian" ] && [ "$XX_VENDOR" != "ubuntu" ] && [ "$XX_VENDOR" != "rhel" ] && [ "$XX_VENDOR" != "fedora" ] && [ "$XX_VENDOR" != "centos" ] && [ "$XX_VENDOR" != "rocky" ] && [ "$XX_VENDOR" != "ol" ]; then
vendor="-${XX_VENDOR}"
fi

Expand Down Expand Up @@ -281,7 +281,7 @@ if [ "$XX_VENDOR" = "debian" ] || [ "$XX_VENDOR" = "ubuntu" ]; then
XX_PKG_ARCH=${XX_DEBIAN_ARCH}
elif [ "$XX_VENDOR" = "alpine" ]; then
XX_PKG_ARCH=${XX_ALPINE_ARCH}
elif [ "$XX_VENDOR" = "rhel" ] || [ "$XX_VENDOR" = "fedora" ] || [ "$XX_VENDOR" = "centos" ] || [ "$XX_VENDOR" = "rocky" ]; then
elif [ "$XX_VENDOR" = "rhel" ] || [ "$XX_VENDOR" = "fedora" ] || [ "$XX_VENDOR" = "centos" ] || [ "$XX_VENDOR" = "rocky" ] || [ "$XX_VENDOR" = "ol" ]; then
XX_PKG_ARCH=${XX_RHEL_ARCH}
fi

Expand Down