mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-11 02:52:56 +01:00
Support building Ruby in UBI
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
This commit is contained in:
parent
9441b21608
commit
0149acb910
1 changed files with 25 additions and 6 deletions
|
|
@ -16,12 +16,7 @@ JEMALLOC_DOWNLOAD_URL="https://github.com/jemalloc/jemalloc/releases/download/${
|
||||||
BUNDLER_VERSION=${3:-""}
|
BUNDLER_VERSION=${3:-""}
|
||||||
RUBYGEMS_VERSION=${4:-""}
|
RUBYGEMS_VERSION=${4:-""}
|
||||||
|
|
||||||
|
function build_common() {
|
||||||
function build_debian() {
|
|
||||||
# Install needed packages
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y --no-install-recommends bison dpkg-dev libgdbm-dev autoconf
|
|
||||||
|
|
||||||
# Download jemalloc
|
# Download jemalloc
|
||||||
mkdir -p /usr/src/jemalloc
|
mkdir -p /usr/src/jemalloc
|
||||||
cd /usr/src/jemalloc
|
cd /usr/src/jemalloc
|
||||||
|
|
@ -74,6 +69,15 @@ function build_debian() {
|
||||||
# Cleanup
|
# Cleanup
|
||||||
cd /
|
cd /
|
||||||
rm -rf /usr/src/ruby /usr/src/jemalloc
|
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
|
apt-get purge -y --auto-remove ruby
|
||||||
|
|
||||||
# Verify
|
# Verify
|
||||||
|
|
@ -82,6 +86,21 @@ function build_debian() {
|
||||||
[ "$(command -v ruby)" = '/usr/local/bin/ruby' ]
|
[ "$(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}
|
BUILD_OS=${BUILD_OS:-debian}
|
||||||
|
|
||||||
if [[ $BUILD_OS =~ debian ]]; then
|
if [[ $BUILD_OS =~ debian ]]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue