summaryrefslogtreecommitdiff
path: root/qa/qa/service/omnibus.rb
blob: b54fd5628f28dec5d76f2c16d97cae3dd95f87df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

module QA
  module Service
    class Omnibus
      include Scenario::Actable
      include Service::Shellout

      def initialize(container)
        @name = container
      end

      def gitlab_ctl(command, input: nil)
        if input.nil?
          shell "docker exec #{@name} gitlab-ctl #{command}"
        else
          shell "docker exec #{@name} bash -c '#{input} | gitlab-ctl #{command}'"
        end
      end
    end
  end
end