Skip to content

Commit 2c8a465

Browse files
committed
Allow specifying current Ruby version via variables
Signed-off-by: Balasankar 'Balu' C <[email protected]>
1 parent 42826fb commit 2c8a465

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

config/software/ruby.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@
2424

2525
# Follow the Ruby upgrade guide when changing the ruby version
2626
# link: https://docs.gitlab.com/ee/development/ruby_upgrade.html
27-
current_ruby_version = '3.1.4'
27+
current_ruby_version = Gitlab::Util.get_env('RUBY_VERSION') || '3.1.4'
2828

2929
# NOTE: When this value is updated, flip `USE_NEXT_RUBY_VERSION_IN_*` variable
3030
# to false to avoid surprises.
3131
next_ruby_version = Gitlab::Util.get_env('NEXT_RUBY_VERSION') || '3.1.4'
3232

3333
# MRs targeting stable branches should use current Ruby version and ignore next
34-
# Ruby version. Also, we provide `USE_OLD_RUBY_VERSION` variable to force usage
35-
# of current Ruby version.
36-
if Gitlab::Util.get_env('RUBY2_BUILD') == "true" || Gitlab::Util.get_env('USE_OLD_RUBY_VERSION') == "true" || Gitlab::Util.get_env('CI_MERGE_REQUEST_TARGET_BRANCH_NAME')&.match?(/^\d+-\d+-stable$/)
34+
# Ruby version. Also, we provide `USE_SPECIFIED_RUBY_VERSION` variable to force
35+
# usage of specified Ruby version.
36+
if Gitlab::Util.get_env('USE_SPECIFIED_RUBY_VERSION') == "true" || Gitlab::Util.get_env('CI_MERGE_REQUEST_TARGET_BRANCH_NAME')&.match?(/^\d+-\d+-stable$/)
3737
default_version current_ruby_version
3838
# Regular branch builds are switched to newer Ruby version first. So once the
3939
# `NEXT_RUBY_VERSION` variable is updated, regular branches (master and feature

0 commit comments

Comments
 (0)