Class: Gitlab::QA::Scenario::Test::Instance::Image

Inherits:
Gitlab::QA::Scenario::Template show all
Defined in:
lib/gitlab/qa/scenario/test/instance/image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Gitlab::QA::Scenario::Template

perform

Constructor Details

#initializeImage

Returns a new instance of Image.



9
10
11
12
# File 'lib/gitlab/qa/scenario/test/instance/image.rb', line 9

def initialize
  @tag = 'nightly'
  @volumes = {}
end

Instance Attribute Details

#tag=(value) ⇒ Object (writeonly)

Sets the attribute tag

Parameters:

  • value

    the value to set the attribute tag to.



7
8
9
# File 'lib/gitlab/qa/scenario/test/instance/image.rb', line 7

def tag=(value)
  @tag = value
end

#volumes=(value) ⇒ Object (writeonly)

Sets the attribute volumes

Parameters:

  • value

    the value to set the attribute volumes to.



7
8
9
# File 'lib/gitlab/qa/scenario/test/instance/image.rb', line 7

def volumes=(value)
  @volumes = value
end

Instance Method Details

#perform(version) ⇒ Object

rubocop:disable Metrics/MethodLength



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/gitlab/qa/scenario/test/instance/image.rb', line 16

def perform(version)
  unless %w(CE EE).include?(version)
    raise 'Unknown GitLab release type specified!'
  end

  Docker::Gitlab.perform do |gitlab|
    gitlab.release = version.downcase.to_sym
    gitlab.name = "gitlab-qa-#{gitlab.release}"
    gitlab.image = "gitlab/gitlab-#{gitlab.release}"
    gitlab.tag = @tag
    gitlab.volumes = @volumes
    gitlab.network = 'test'

    gitlab.instance do
      Docker::Specs.perform do |instance|
        instance.test(gitlab)
      end
    end
  end
end