diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2017-05-07 00:29:43 +0300 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2017-05-07 00:29:43 +0300 |
commit | 295cecfb56af4e064340d255140a28959c47b25d (patch) | |
tree | f88460655eddc755c56234c92b5e5f393867ede5 /lib/gitlab/ci | |
parent | 1005389f70070245092c1ae5f3f9b10b8e7c102e (diff) |
Allow numeric values in gitlab-ci.yml
Diffstat (limited to 'lib/gitlab/ci')
-rw-r--r-- | lib/gitlab/ci/config/entry/legacy_validation_helpers.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/variables.rb | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/gitlab/ci/config/entry/legacy_validation_helpers.rb b/lib/gitlab/ci/config/entry/legacy_validation_helpers.rb index 9b9a0a8125a..a78a85397bd 100644 --- a/lib/gitlab/ci/config/entry/legacy_validation_helpers.rb +++ b/lib/gitlab/ci/config/entry/legacy_validation_helpers.rb @@ -21,7 +21,13 @@ module Gitlab def validate_variables(variables) variables.is_a?(Hash) && - variables.all? { |key, value| validate_string(key) && validate_string(value) } + variables.flatten.all? do |value| + validate_string(value) || validate_integer(value) + end + end + + def validate_integer(value) + value.is_a?(Integer) end def validate_string(value) diff --git a/lib/gitlab/ci/config/entry/variables.rb b/lib/gitlab/ci/config/entry/variables.rb index c3b0e651c3a..8acab605c91 100644 --- a/lib/gitlab/ci/config/entry/variables.rb +++ b/lib/gitlab/ci/config/entry/variables.rb @@ -15,6 +15,10 @@ module Gitlab def self.default {} end + + def value + Hash[@config.map { |key, value| [key.to_s, value.to_s] }] + end end end end |