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

Red Hat or clone v9 support #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions .bonsai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ builds:
- "entity.system.platform != 'amazon'"
- "entity.system.platform_family == 'rhel'"
- "parseInt(entity.system.platform_version.split('.')[0]) == 8"
- platform: "el9"
arch: "amd64"
asset_filename: "sensu-ruby-runtime_#{version}_ruby-3.2.0_el9_linux_amd64.tar.gz"
sha_filename: "sensu-ruby-runtime_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.arch == 'amd64'"
- "entity.system.platform != 'amazon'"
- "entity.system.platform_family == 'rhel'"
- "parseInt(entity.system.platform_version.split('.')[0]) == 9"
- platform: "amzn1"
arch: "amd64"
asset_filename: "sensu-ruby-runtime_#{version}_ruby-3.2.0_amzn1_linux_amd64.tar.gz"
Expand Down
26 changes: 26 additions & 0 deletions Dockerfile.el9
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM almalinux:9

ARG RUBY_VERSION=3.2.0
ARG ASSET_VERSION=local_build
ARG GREP_EXCLUDE='(ld.so|ld-linux-x86-64.so|libBrokenLocale.so|libSegFault.so|libanl.so|libc.so|libdl.so|libm.so|libmvec.so|libnss_compat.so|libnss_dns.so|libnss_files.so|libpthread.so|libresolv.so|librt.so|libthread_db.so|libutil.so|vdso.so)'

RUN dnf update -y && dnf groupinstall -y "Development Tools" && dnf install -y curl-minimal
RUN dnf install dnf-plugins-core
RUN dnf repolist --all
RUN dnf config-manager --set-enabled crb

RUN curl -L https://github.com/postmodern/ruby-install/archive/v0.8.5.tar.gz -o ruby-install-0.8.5.tar.gz && \
tar -xzvf ruby-install-0.8.5.tar.gz && \
cd ruby-install-0.8.5/ && \
make install && \
ruby-install ruby ${RUBY_VERSION} -- --enable-load-relative --disable-install-doc && \
PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install ffi sys-filesystem

RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /opt/rubies/ruby-${RUBY_VERSION}/lib/; fi; done

RUN mkdir /assets/ && \
export SENSU_ASSET="/assets/sensu-ruby-runtime_${ASSET_VERSION}_ruby-${RUBY_VERSION}_$(source /etc/os-release && echo $PLATFORM_ID | cut -d: -f2)_$(uname -s | tr '[:upper:]' '[:lower:]')_amd64.tar.gz" && \
tar -czf $SENSU_ASSET -C /opt/rubies/ruby-${RUBY_VERSION}/ .

ENV PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin
7 changes: 7 additions & 0 deletions build_scripts/build_centos_platforms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ retval=$?
if [[ retval -ne 0 ]]; then
exit $retval
fi

# EL 9 platform
platform="el9" test_platforms="almalinux:9 quay.io/centos/centos:stream9 rockylinux:9 registry.access.redhat.com/ubi9/ubi:latest" ./build_and_test_platform.sh
retval=$?
if [[ retval -ne 0 ]]; then
exit $retval
fi
7 changes: 7 additions & 0 deletions build_scripts/build_platforms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ if [[ retval -ne 0 ]]; then
exit $retval
fi

# EL 9 platform
platform="el9" test_platforms="almalinux:9 quay.io/centos/centos:stream9 rockylinux:9 registry.access.redhat.com/ubi9/ubi:latest" ./build_and_test_platform.sh
retval=$?
if [[ retval -ne 0 ]]; then
exit $retval
fi

# CentOS 6 platform
platform="centos6" test_platforms="centos:6 centos:7 debian:8 debian:9 debian:10 ubuntu:14.04 ubuntu:16.04 ubuntu:18.04" ./build_and_test_platform.sh
retval=$?
Expand Down