class GitlabciGenerator

Constants

MYSQL_DOCKER_DB

Configurations for MySQL/Postgres dockers

POSTGRES_DOCKER_DB

Public Instance Methods

create_config_file() click to toggle source
# File lib/generators/gitlabci/gitlabci_generator.rb, line 29
def create_config_file
  # Update the gitlab-ci template
  template '.gitlab-ci.yml'

  # Update the database-ci template
  template '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

Private Instance Methods

create_keep_file() click to toggle source
# File lib/generators/gitlabci/gitlabci_generator.rb, line 44
def create_keep_file
  file = '.modulorails-gitlab-ci'

  # Create file to avoid this generator on next modulorails launch
  copy_file(file, file)

  say "Add #{file} to git"
  %x(git add #{file})
end