2018-12-13 13:39:08 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
class Config
|
2017-08-17 22:00:37 +05:30
|
|
|
module Entry
|
2016-08-24 12:49:21 +05:30
|
|
|
##
|
|
|
|
# Entry that represents environment variables.
|
|
|
|
#
|
2018-12-23 12:14:25 +05:30
|
|
|
class Variables < ::Gitlab::Config::Entry::Node
|
|
|
|
include ::Gitlab::Config::Entry::Validatable
|
2016-08-24 12:49:21 +05:30
|
|
|
|
|
|
|
validations do
|
|
|
|
validates :config, variables: true
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.default
|
|
|
|
{}
|
|
|
|
end
|
2017-09-10 17:25:29 +05:30
|
|
|
|
|
|
|
def value
|
|
|
|
Hash[@config.map { |key, value| [key.to_s, value.to_s] }]
|
|
|
|
end
|
2016-08-24 12:49:21 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|