Module: Gitlab::SetupHelper
Defined Under Namespace
Modules: Gitaly, Praefect, Workhorse
Instance Method Summary collapse
- #create_configuration(dir, storage_paths, force: false, options: {}) ⇒ Object
-
#generate_configuration(toml_data, config_path, force: false) ⇒ Object
rubocop:disable Rails/Output.
Instance Method Details
#create_configuration(dir, storage_paths, force: false, options: {}) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/gitlab/setup_helper.rb', line 7 def create_configuration(dir, storage_paths, force: false, options: {}) generate_configuration( configuration_toml(dir, storage_paths, ), get_config_path(dir, ), force: force ) end |
#generate_configuration(toml_data, config_path, force: false) ⇒ Object
rubocop:disable Rails/Output
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/gitlab/setup_helper.rb', line 16 def generate_configuration(toml_data, config_path, force: false) FileUtils.rm_f(config_path) if force File.open(config_path, File::WRONLY | File::CREAT | File::EXCL) do |f| f.puts toml_data end rescue Errno::EEXIST puts 'Skipping config.toml generation:' puts "A configuration file for #{config_path} already exists." rescue ArgumentError => e puts 'Skipping config.toml generation:' puts e. end |