diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-11 18:10:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-11 18:10:04 +0300 |
commit | a8704bd33cb36b4e7e88bb10d61265b8ad8a058c (patch) | |
tree | 4a9eb565d016d789168657fadbc78214afb61725 /lib/gitlab/setup_helper.rb | |
parent | 54f170b69972d46a5bab2a0231510a41e610da31 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/setup_helper.rb')
-rw-r--r-- | lib/gitlab/setup_helper.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/gitlab/setup_helper.rb b/lib/gitlab/setup_helper.rb index 259d3e300b6..f6e4c3bd584 100644 --- a/lib/gitlab/setup_helper.rb +++ b/lib/gitlab/setup_helper.rb @@ -44,6 +44,24 @@ module Gitlab def get_config_path(dir) File.join(dir, 'config.toml') end + + def compile_into(dir) + command = %W[#{make} -C #{Rails.root.join('workhorse')} install PREFIX=#{File.absolute_path(dir)}] + + make_out, make_status = Gitlab::Popen.popen(command) + unless make_status == 0 + warn make_out + raise 'workhorse make failed' + end + + # 'make install' puts the binaries in #{dir}/bin but the init script expects them in dir + FileUtils.mv(Dir["#{dir}/bin/*"], dir) + end + + def make + _, which_status = Gitlab::Popen.popen(%w[which gmake]) + which_status == 0 ? 'gmake' : 'make' + end end end |