Module: Gitlab::SetupHelper::Workhorse
Overview
rubocop:enable Rails/Output
Class Method Summary
collapse
create_configuration, generate_configuration
Class Method Details
.compile_into(dir) ⇒ Object
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/gitlab/setup_helper.rb', line 52
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
FileUtils.mv(Dir["#{dir}/bin/*"], dir)
end
|
.configuration_toml(dir, _, _) ⇒ Object
34
35
36
37
38
|
# File 'lib/gitlab/setup_helper.rb', line 34
def configuration_toml(dir, _, _)
config = { redis: { URL: redis_url, DB: redis_db } }
TomlRB.dump(config)
end
|
.get_config_path(dir, _) ⇒ Object
48
49
50
|
# File 'lib/gitlab/setup_helper.rb', line 48
def get_config_path(dir, _)
File.join(dir, 'config_path')
end
|
.make ⇒ Object
65
66
67
68
|
# File 'lib/gitlab/setup_helper.rb', line 65
def make
_, which_status = Gitlab::Popen.popen(%w[which gmake])
which_status == 0 ? 'gmake' : 'make'
end
|