Class: Gitlab::QA::Scenario::Test::Omnibus::Upgrade

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

Constant Summary collapse

VOLUMES =
{ 'config' => '/etc/gitlab',
'logs' => '/var/log/gitlab',
'data' => '/var/opt/gitlab' }.freeze

Instance Method Summary collapse

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

perform

Instance Method Details

#perform(next_release) ⇒ Object

rubocop:disable Metrics/MethodLength



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/gitlab/qa/scenario/test/omnibus/upgrade.rb', line 16

def perform(next_release)
  next_release = Release.new(next_release)

  with_temporary_volumes do |volumes|
    Scenario::Test::Instance::Image
      .perform(next_release.previous_stable) do |scenario|
      scenario.volumes = volumes
    end

    Scenario::Test::Instance::Image
      .perform(next_release) do |scenario|
      scenario.volumes = volumes
    end
  end
end

#with_temporary_volumesObject



32
33
34
35
36
# File 'lib/gitlab/qa/scenario/test/omnibus/upgrade.rb', line 32

def with_temporary_volumes
  Dir.mktmpdir('gitlab-qa-').tap do |dir|
    yield Hash[VOLUMES.map { |k, v| ["#{dir}/#{k}", v] }]
  end
end