Skip to content

Commit

Permalink
Merge pull request #53 from crazy-max/oraclelinux
Browse files Browse the repository at this point in the history
xx-info: oracle linux support
  • Loading branch information
tonistiigi authored Nov 18, 2021
2 parents adf7fbb + b75e80b commit 5238dd4
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 8 deletions.
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

0 comments on commit 5238dd4

Please sign in to comment.