mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-09 18:12:55 +01:00
Merge branch 'mk-verify-mandatory-ruby-patches' into 'master'
Verify mandatory Ruby patches exist See merge request https://gitlab.com/gitlab-org/gitlab-build-images/-/merge_requests/617 Merged-by: Stan Hu <stanhu@gmail.com> Approved-by: Stan Hu <stanhu@gmail.com> Co-authored-by: Matthias Kaeppler <mkaeppler@gitlab.com>
This commit is contained in:
commit
632bca6084
4 changed files with 17 additions and 3 deletions
1
patches/ruby/mandatory_patches
Normal file
1
patches/ruby/mandatory_patches
Normal file
|
|
@ -0,0 +1 @@
|
|||
thread-memory-allocations
|
||||
|
|
@ -46,10 +46,23 @@ function build_common() {
|
|||
rm ruby.tar.gz
|
||||
cd /usr/src/ruby
|
||||
|
||||
# Process patch files
|
||||
local ruby_version=$(cut -d '.' -f 1,2 <<< $RUBY_VERSION)
|
||||
local patchdir="/patches/ruby/${ruby_version}"
|
||||
|
||||
# Verify mandatory patches
|
||||
while read -r patchname; do
|
||||
local patchfile="${patchdir}/${patchname}.patch"
|
||||
if [[ ! -f "${patchfile}" ]]; then
|
||||
echo "!! Missing mandatory patch ${patchname}"
|
||||
echo "!! Make sure ${patchfile} exists before proceeding."
|
||||
exit 1
|
||||
fi
|
||||
done < "/patches/ruby/mandatory_patches"
|
||||
|
||||
# Apply patches
|
||||
ruby_version=`cut -d '.' -f 1,2 <<< $RUBY_VERSION`
|
||||
if [[ -d "/patches/ruby/$ruby_version" ]]; then
|
||||
for i in "/patches/ruby/$ruby_version"/*.patch; do
|
||||
if [[ -d "${patchdir}" ]]; then
|
||||
for i in "${patchdir}"/*.patch; do
|
||||
echo "$i..."
|
||||
patch -p1 -i "$i"
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue