diff --git a/.bonsai.yml b/.bonsai.yml index 33180fe..3320438 100644 --- a/.bonsai.yml +++ b/.bonsai.yml @@ -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" diff --git a/Dockerfile.el9 b/Dockerfile.el9 new file mode 100644 index 0000000..0633744 --- /dev/null +++ b/Dockerfile.el9 @@ -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 diff --git a/build_scripts/build_centos_platforms.sh b/build_scripts/build_centos_platforms.sh index a44d799..5981f4e 100755 --- a/build_scripts/build_centos_platforms.sh +++ b/build_scripts/build_centos_platforms.sh @@ -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 diff --git a/build_scripts/build_platforms.sh b/build_scripts/build_platforms.sh index 98e1fb3..54ca275 100755 --- a/build_scripts/build_platforms.sh +++ b/build_scripts/build_platforms.sh @@ -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=$?