Class: Gitlab::QA::Release
- Inherits:
-
Object
- Object
- Gitlab::QA::Release
- Defined in:
- lib/gitlab/qa/release.rb
Constant Summary collapse
- CUSTOM_GITLAB_IMAGE_REGEX =
%r{/gitlab-([ce]e):(.+)\z}- DEFAULT_TAG =
'nightly'.freeze
Instance Attribute Summary collapse
-
#release ⇒ Object
readonly
Returns the value of attribute release.
- #tag ⇒ Object
Instance Method Summary collapse
- #canonical_image ⇒ Object
- #edition ⇒ Object
- #edition_tag ⇒ Object
- #image ⇒ Object
-
#initialize(release) ⇒ Release
constructor
A new instance of Release.
- #previous_stable ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(release) ⇒ Release
Returns a new instance of Release.
10 11 12 |
# File 'lib/gitlab/qa/release.rb', line 10 def initialize(release) @release = release.to_s end |
Instance Attribute Details
#release ⇒ Object (readonly)
Returns the value of attribute release.
7 8 9 |
# File 'lib/gitlab/qa/release.rb', line 7 def release @release end |
#tag ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/gitlab/qa/release.rb', line 46 def tag @tag ||= if canonical? DEFAULT_TAG else release.match(CUSTOM_GITLAB_IMAGE_REGEX)[2] end end |
Instance Method Details
#canonical_image ⇒ Object
42 43 44 |
# File 'lib/gitlab/qa/release.rb', line 42 def canonical_image @canonical_image ||= "gitlab/gitlab-#{edition}" end |
#edition ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/gitlab/qa/release.rb', line 24 def edition @edition ||= if canonical? release.downcase.to_sym else release.match(CUSTOM_GITLAB_IMAGE_REGEX)[1].to_sym end end |
#edition_tag ⇒ Object
55 56 57 |
# File 'lib/gitlab/qa/release.rb', line 55 def edition_tag @edition_tag ||= "#{edition}-#{tag}" end |
#image ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/gitlab/qa/release.rb', line 33 def image @image ||= if canonical? "gitlab/gitlab-#{edition}" else release.sub(/:.+\z/, '') end end |
#previous_stable ⇒ Object
18 19 20 21 22 |
# File 'lib/gitlab/qa/release.rb', line 18 def previous_stable # The previous stable is always gitlab/gitlab-ce:latest or # gitlab/gitlab-ee:latest self.class.new("#{canonical_image}:latest") end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/gitlab/qa/release.rb', line 14 def to_s "#{image}:#{tag}" end |