Class: Gitlab::QA::Scenario::Test::Integration::RegistryWithCDN

Inherits:
Gitlab::QA::Scenario::Template show all
Defined in:
lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb

Instance Method Summary collapse

Methods inherited from Gitlab::QA::Scenario::Template

perform

Instance Method Details

#perform(release, *rspec_args) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb', line 9

def perform(release, *rspec_args)
  Runtime::Env.require_gcs_with_cdn_environment!

  Component::Gitlab.perform do |gitlab|
    gitlab.release = release
    gitlab.network = Runtime::Env.docker_network
    gitlab.name = 'gitlab'
    gitlab.seed_admin_token = true
    sign_url_key_path = gitlab.create_key_file('GOOGLE_CDN_SIGNURL_KEY')
    cdn_gcloud_path = gitlab.create_key_file('GOOGLE_CDN_JSON_KEY')

    gitlab.omnibus_configuration << "      external_url 'http://\#{gitlab.name}.\#{gitlab.network}';\n      registry_external_url 'http://\#{gitlab.name}.\#{gitlab.network}:5050';\n\n      registry['middleware'] = { 'storage' => [{ 'name' => 'googlecdn', 'options' => { 'baseurl' => '\#{Runtime::Env.google_cdn_load_balancer}', 'privatekey' => '\#{sign_url_key_path}', 'keyname' => '\#{Runtime::Env.google_cdn_signurl_key_name}' } }] }\n      registry['storage'] = { 'gcs' => { 'bucket' => '\#{Runtime::Env.gcs_cdn_bucket_name}', 'keyfile' => '\#{cdn_gcloud_path}' } }\n    OMNIBUS\n\n    gitlab.instance do\n      Component::Specs.perform do |specs|\n        specs.suite = 'Test::Integration::RegistryWithCDN'\n        specs.release = gitlab.release\n        specs.network = gitlab.network\n        specs.args = [gitlab.address, *rspec_args]\n      end\n    ensure\n      gitlab.delete_key_file(sign_url_key_path)\n      gitlab.delete_key_file(cdn_gcloud_path)\n    end\n  end\nend\n"