Class: Gitlab::QA::Component::Staging

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/qa/component/staging.rb

Direct Known Subclasses

Preprod, Production, Release, StagingRef

Defined Under Namespace

Classes: Version

Constant Summary collapse

ADDRESS =
Runtime::Env.staging_url
GEO_SECONDARY_ADDRESS =
Runtime::Env.geo_staging_url

Class Method Summary collapse

Class Method Details

.addressObject



41
42
43
# File 'lib/gitlab/qa/component/staging.rb', line 41

def self.address
  self::ADDRESS
end

.imageObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/gitlab/qa/component/staging.rb', line 22

def self.image
  # QA images are tagged with the following logic
  # 1. For auto-deploy versions, they are tagged with their corresponding commit SHA
  #    That is, if auto-deploy version is `15.4.202209150620+70251a89db4.a625f183e2e`,
  #    the QA image tag will be `70251a89db4`
  # 2. For stable/RC versions, they are tagged with the version with `v` prefix.
  #    That is, if the version is `15.3.3-ee`, the QA image tag will be `v15.3.3-ee`
  # These images are available from the GitLab project's container registry.

  # If token to access dev.gitlab.org registry is provided, we will
  # fetch from there. Else, we will try to fetch from GitLab.com
  # registry.
  if Runtime::Env.dev_access_token_variable
    "dev.gitlab.org:5005/gitlab/gitlab-ee/gitlab-ee-qa:#{tag}"
  else
    "registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:#{tag}"
  end
end

.releaseObject



14
15
16
17
18
19
20
# File 'lib/gitlab/qa/component/staging.rb', line 14

def self.release
  QA::Release.new(image)
rescue Support::InvalidResponseError => e
  warn e.message
  warn "#{e.response.code} #{e.response.message}: #{e.response.body}"
  exit 1
end

.tagObject



45
46
47
# File 'lib/gitlab/qa/component/staging.rb', line 45

def self.tag
  @tag ||= Version.new(address).tag
end