Class: Gitlab::QA::Runtime::OmnibusConfigurations::DecompositionMultipleDb

Inherits:
Default show all
Defined in:
lib/gitlab/qa/runtime/omnibus_configurations/decomposition_multiple_db.rb

Instance Method Summary collapse

Methods inherited from Default

configuration

Methods inherited from Gitlab::QA::Runtime::OmnibusConfiguration

#<<, #initialize, #prepare, #sanitize!, #to_s

Constructor Details

This class inherits a constructor from Gitlab::QA::Runtime::OmnibusConfiguration

Instance Method Details

#configurationObject



8
9
10
11
12
13
14
15
16
# File 'lib/gitlab/qa/runtime/omnibus_configurations/decomposition_multiple_db.rb', line 8

def configuration
  # HACK: commenting commands out as these commands should be run *after* the first
  # reconfiguration (see first command in #exec_commands)
  <<~OMNIBUS
    #gitlab_rails['databases']['main']['enable'] = true
    #gitlab_rails['databases']['ci']['enable'] = true
    #gitlab_rails['databases']['ci']['db_database'] = 'gitlabhq_production_ci'
  OMNIBUS
end

#exec_commandsObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/gitlab/qa/runtime/omnibus_configurations/decomposition_multiple_db.rb', line 18

def exec_commands
  [
    "sed -i 's/#gitlab_rails/gitlab_rails/g' /etc/gitlab/gitlab.rb",
    "gitlab-ctl reconfigure",
    "gitlab-psql -c 'create database gitlabhq_production_ci owner gitlab'",
    "gitlab-psql -d gitlabhq_production_ci -c 'create extension btree_gist'",
    "gitlab-psql -d gitlabhq_production_ci -c 'create extension pg_trgm'",
    "gitlab-rake db:structure:load:ci",
    "gitlab-ctl restart"
  ].freeze
end