Support building Ruby in UBI

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
This commit is contained in:
Balasankar "Balu" C 2022-07-04 19:18:35 +05:30
parent 9441b21608
commit 0149acb910
No known key found for this signature in database
GPG key ID: B77D2E2E23735427

View file

@ -16,12 +16,7 @@ JEMALLOC_DOWNLOAD_URL="https://github.com/jemalloc/jemalloc/releases/download/${
BUNDLER_VERSION=${3:-""}
RUBYGEMS_VERSION=${4:-""}
function build_debian() {
# Install needed packages
apt-get update
apt-get install -y --no-install-recommends bison dpkg-dev libgdbm-dev autoconf
function build_common() {
# Download jemalloc
mkdir -p /usr/src/jemalloc
cd /usr/src/jemalloc
@ -74,6 +69,15 @@ function build_debian() {
# Cleanup
cd /
rm -rf /usr/src/ruby /usr/src/jemalloc
}
function build_debian() {
# Install needed packages
apt-get update
apt-get install -y --no-install-recommends bison dpkg-dev libgdbm-dev autoconf
build_common
apt-get purge -y --auto-remove ruby
# Verify
@ -82,6 +86,21 @@ function build_debian() {
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]
}
function build_ubi() {
yum update -y
build_common
yum remove -y ruby
yum autoremove -y
yum clean -y all
# Verify
# verify we have no "ruby" packages installed
! yum list installed | grep -i ruby
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]
}
BUILD_OS=${BUILD_OS:-debian}
if [[ $BUILD_OS =~ debian ]]; then