Sha256: 75c8fd621261c270f6680b50573b5d72e235bdcda4681d3fa2f0792fb6c1a2be

Contents?: true

Size: 1.87 KB

Versions: 28

Compression:

Stored size: 1.87 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'
                gitlab.seed_admin_token = false
                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 << <<~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
                ensure
                  gitlab.delete_key_file(sign_url_key_path)
                  gitlab.delete_key_file(cdn_gcloud_path)
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
gitlab-qa-14.9.0 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-14.8.1 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-14.8.0 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-14.7.0 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-14.6.0 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-14.5.0 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-14.4.0 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-14.3.0 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-14.2.1 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-14.2.0 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-14.1.0 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-14.0.2 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-14.0.1 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-14.0.0 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-13.2.1 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-13.2.0 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-13.1.0 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-13.0.0 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-12.5.1 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb
gitlab-qa-12.5.0 lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb