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

ci_variables_helper.rb « helpers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5bfdeb9e33c58f45153dad58f5057a475c0334d1 (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
30
# frozen_string_literal: true

module CiVariablesHelper
  def ci_variable_protected_by_default?
    Gitlab::CurrentSettings.current_application_settings.protected_ci_variables
  end

  def ci_variable_protected?(variable, only_key_value)
    if variable && !only_key_value
      variable.protected
    else
      ci_variable_protected_by_default?
    end
  end

  def ci_variable_masked?(variable, only_key_value)
    if variable && !only_key_value
      variable.masked
    else
      true
    end
  end

  def ci_variable_type_options
    [
      %w(Variable env_var),
      %w(File file)
    ]
  end
end