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.
Instance Method Summary collapse
- #edition ⇒ Object
- #image ⇒ Object
-
#initialize(release) ⇒ Release
constructor
A new instance of Release.
- #tag ⇒ Object
Constructor Details
#initialize(release) ⇒ Release
Returns a new instance of Release.
9 10 11 |
# File 'lib/gitlab/qa/release.rb', line 9 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 |
Instance Method Details
#edition ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/gitlab/qa/release.rb', line 13 def edition if canonical? release.downcase.to_sym else release.match(CUSTOM_GITLAB_IMAGE_REGEX)[1].to_sym end end |
#image ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/gitlab/qa/release.rb', line 21 def image if canonical? "gitlab/gitlab-#{edition}" else release.sub(/:.+\z/, '') end end |
#tag ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/gitlab/qa/release.rb', line 29 def tag if canonical? DEFAULT_TAG else release.match(CUSTOM_GITLAB_IMAGE_REGEX)[2] end end |