Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mask_token.rb « helpers « support « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0c0af524c978d00f20886c2fa751ee0ca76fbe61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

module QA
  module Support
    module Helpers
      module MaskToken
        def use_ci_variable(name:, value:, project:)
          Resource::CiVariable.fabricate_via_api! do |ci_variable|
            ci_variable.project = project
            ci_variable.key = name
            ci_variable.value = value
            ci_variable.protected = true
          end
          "$#{name}"
        end

        def use_group_ci_variable(name:, value:, group:)
          Resource::GroupCiVariable.fabricate_via_api! do |ci_variable|
            ci_variable.group = group
            ci_variable.key = name
            ci_variable.value = value
            ci_variable.protected = true
          end
          "$#{name}"
        end
      end
    end
  end
end