Class: Modulorails::GitlabciGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/modulorails/gitlabci/gitlabci_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_config_fileObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/generators/modulorails/gitlabci/gitlabci_generator.rb', line 9

def create_config_file
  # Update the gitlab-ci template
  template '.gitlab-ci.yml'

  # Remove the database-ci template if it exists.
  # It used to be referenced by the gitlab-ci template.
  remove_file 'config/database-ci.yml'

  # Create file to avoid this generator on next modulorails launch
  create_keep_file
rescue StandardError => e
  $stderr.puts("[Modulorails] Error: cannot generate CI configuration: #{e.message}")
end