Skip to content
代码片段 群组 项目
提交 b581ed0f 编辑于 作者: Nao Hashizume's avatar Nao Hashizume
浏览文件

Merge branch 'brodock-fix-preflight' into 'main'

Ensure Bunder.with_unbundled_env is used for preflight-checks

Closes #2039

See merge request https://gitlab.com/gitlab-org/gitlab-development-kit/-/merge_requests/3558



Merged-by: default avatarNao Hashizume <nhashizume@gitlab.com>
Approved-by: default avatarNao Hashizume <nhashizume@gitlab.com>
Reviewed-by: default avatarNao Hashizume <nhashizume@gitlab.com>
Co-authored-by: default avatarGabriel Mazetto <gabriel@gitlab.com>
No related branches found
No related tags found
无相关合并请求
...@@ -50,7 +50,15 @@ def gem_installed?(name) ...@@ -50,7 +50,15 @@ def gem_installed?(name)
end end
def gem_loads_ok?(name) def gem_loads_ok?(name)
exec_cmd("#{bundle_exec_cmd} ruby -r #{name} -e 'nil'") command = -> { exec_cmd("#{bundle_exec_cmd} ruby -r #{name} -e 'nil'") }
if bundler_available?
::Bundler.with_unbundled_env do
command.call
end
else
command.call
end
end end
def exec_cmd(cmd) def exec_cmd(cmd)
...@@ -59,6 +67,10 @@ def exec_cmd(cmd) ...@@ -59,6 +67,10 @@ def exec_cmd(cmd)
Shellout.new(cmd, chdir: config.gitlab.dir.to_s).execute(display_output: false, display_error: false).success? Shellout.new(cmd, chdir: config.gitlab.dir.to_s).execute(display_output: false, display_error: false).success?
end end
def bundler_available?
defined? ::Bundler
end
def gitlab_error_message def gitlab_error_message
<<~MESSAGE <<~MESSAGE
The following Ruby Gems appear to have issues: The following Ruby Gems appear to have issues:
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册