Sha256: d1cc3792ef974ff56661f10bd28b0303dbc477503e288cb99d7e488cf1bfb8d0

Contents?: true

Size: 1.68 KB

Versions: 5

Compression:

Stored size: 1.68 KB

Contents

# frozen_string_literal: true

module Gitlab
  module QA
    module Scenario
      module Test
        module Integration
          class RegistryWithCDN < Scenario::Template
            def perform(release, *rspec_args)
              Runtime::Env.require_gcs_with_cdn_environment!

              Component::Gitlab.perform do |gitlab|
                gitlab.release = release
                gitlab.network = 'test'
                gitlab.name = 'gitlab'
                sign_url_key_path = gitlab.copy_key_file('GOOGLE_CDN_SIGNURL_KEY')
                cdn_gcloud_path = gitlab.copy_key_file('GOOGLE_CDN_JSON_KEY')

                gitlab.omnibus_configuration << <<~OMNIBUS
                  external_url 'http://#{gitlab.name}.#{gitlab.network}';
                  registry_external_url 'http://#{gitlab.name}.#{gitlab.network}:5050';

                  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}' } }] }
                  registry['storage'] = { 'gcs' => { 'bucket' => '#{Runtime::Env.gcs_cdn_bucket_name}', 'keyfile' => '#{cdn_gcloud_path}' } }
                OMNIBUS

                gitlab.instance do
                  Component::Specs.perform do |specs|
                    specs.suite = 'Test::Integration::RegistryWithCDN'
                    specs.release = gitlab.release
                    specs.network = gitlab.network
                    specs.args = [gitlab.address, *rspec_args]
                  end
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gitlab-qa-7.27.1 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-7.27.0 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-7.26.0 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-7.25.1 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-7.25.0 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb