diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-04 15:07:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-04 15:07:52 +0300 |
commit | c6c7437861bff9572747674095c4dfbdfbea4988 (patch) | |
tree | 237d1ed922193f19ae326923457344c082003788 /lib/gitlab/ci/config | |
parent | d80f3cd75e700b6e62910865bfd36734644ffa89 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/ci/config')
-rw-r--r-- | lib/gitlab/ci/config/entry/artifacts.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/bridge.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/cache.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/default.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/job.rb | 5 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/processable.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/release.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/release/assets.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/root.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/ci/config/entry/service.rb | 34 |
10 files changed, 33 insertions, 24 deletions
diff --git a/lib/gitlab/ci/config/entry/artifacts.rb b/lib/gitlab/ci/config/entry/artifacts.rb index aebc1675bec..241c73db3bb 100644 --- a/lib/gitlab/ci/config/entry/artifacts.rb +++ b/lib/gitlab/ci/config/entry/artifacts.rb @@ -44,8 +44,6 @@ module Gitlab end end - helpers :reports - def value @config[:reports] = reports_value if @config.key?(:reports) @config diff --git a/lib/gitlab/ci/config/entry/bridge.rb b/lib/gitlab/ci/config/entry/bridge.rb index 721c7c8b6d7..6fdaa373170 100644 --- a/lib/gitlab/ci/config/entry/bridge.rb +++ b/lib/gitlab/ci/config/entry/bridge.rb @@ -49,8 +49,6 @@ module Gitlab description: 'Environment variables available for this job.', inherit: false - helpers :trigger, :needs, :variables - attributes :when, :allow_failure def self.matching?(name, config) diff --git a/lib/gitlab/ci/config/entry/cache.rb b/lib/gitlab/ci/config/entry/cache.rb index ef07c319ce4..a304d9b724f 100644 --- a/lib/gitlab/ci/config/entry/cache.rb +++ b/lib/gitlab/ci/config/entry/cache.rb @@ -28,8 +28,6 @@ module Gitlab entry :paths, Entry::Paths, description: 'Specify which paths should be cached across builds.' - helpers :key - attributes :policy def value diff --git a/lib/gitlab/ci/config/entry/default.rb b/lib/gitlab/ci/config/entry/default.rb index 88db17a75da..ab493ff7d78 100644 --- a/lib/gitlab/ci/config/entry/default.rb +++ b/lib/gitlab/ci/config/entry/default.rb @@ -61,8 +61,6 @@ module Gitlab description: 'Default artifacts.', inherit: false - helpers :before_script, :image, :services, :after_script, :cache - private def overwrite_entry(deps, key, current_entry) diff --git a/lib/gitlab/ci/config/entry/job.rb b/lib/gitlab/ci/config/entry/job.rb index 931f769e920..8db21b116eb 100644 --- a/lib/gitlab/ci/config/entry/job.rb +++ b/lib/gitlab/ci/config/entry/job.rb @@ -128,11 +128,6 @@ module Gitlab description: 'This job will produce a release.', inherit: false - helpers :before_script, :script, :type, :after_script, - :cache, :image, :services, :variables, - :artifacts, :environment, :coverage, :retry, - :needs, :interruptible, :release, :tags - attributes :script, :tags, :allow_failure, :when, :dependencies, :needs, :retry, :parallel, :start_in, :interruptible, :timeout, :resource_group, :release diff --git a/lib/gitlab/ci/config/entry/processable.rb b/lib/gitlab/ci/config/entry/processable.rb index 19e6601e31f..bfa2905ed77 100644 --- a/lib/gitlab/ci/config/entry/processable.rb +++ b/lib/gitlab/ci/config/entry/processable.rb @@ -54,8 +54,6 @@ module Gitlab allowed_when: %w[on_success on_failure always never manual delayed].freeze } - helpers :stage, :only, :except, :rules - attributes :extends, :rules end diff --git a/lib/gitlab/ci/config/entry/release.rb b/lib/gitlab/ci/config/entry/release.rb index 3eceaa0ccd9..b4e4c149730 100644 --- a/lib/gitlab/ci/config/entry/release.rb +++ b/lib/gitlab/ci/config/entry/release.rb @@ -33,8 +33,6 @@ module Gitlab validates :description, type: String, presence: true end - helpers :assets - def value @config[:assets] = assets_value if @config.key?(:assets) @config diff --git a/lib/gitlab/ci/config/entry/release/assets.rb b/lib/gitlab/ci/config/entry/release/assets.rb index 82ed39f51e0..1f7057d1bf6 100644 --- a/lib/gitlab/ci/config/entry/release/assets.rb +++ b/lib/gitlab/ci/config/entry/release/assets.rb @@ -23,8 +23,6 @@ module Gitlab validates :links, array_of_hashes: true, presence: true end - helpers :links - def value @config[:links] = links_value if @config.key?(:links) @config diff --git a/lib/gitlab/ci/config/entry/root.rb b/lib/gitlab/ci/config/entry/root.rb index 620f6a95e9d..caa0725c4bd 100644 --- a/lib/gitlab/ci/config/entry/root.rb +++ b/lib/gitlab/ci/config/entry/root.rb @@ -67,9 +67,7 @@ module Gitlab entry :workflow, Entry::Workflow, description: 'List of evaluable rules to determine Pipeline status' - helpers :default, :stages, :types, :variables, :workflow - - helpers :jobs, dynamic: true + dynamic_helpers :jobs delegate :before_script_value, :image_value, diff --git a/lib/gitlab/ci/config/entry/service.rb b/lib/gitlab/ci/config/entry/service.rb index 8d16371e857..247bf930d3b 100644 --- a/lib/gitlab/ci/config/entry/service.rb +++ b/lib/gitlab/ci/config/entry/service.rb @@ -7,8 +7,13 @@ module Gitlab ## # Entry that represents a configuration of Docker service. # - class Service < Image + # TODO: remove duplication with Image superclass by defining a common + # Imageable concern. + # https://gitlab.com/gitlab-org/gitlab/issues/208774 + class Service < ::Gitlab::Config::Entry::Node include ::Gitlab::Config::Entry::Validatable + include ::Gitlab::Config::Entry::Attributable + include ::Gitlab::Config::Entry::Configurable ALLOWED_KEYS = %i[name entrypoint command alias ports].freeze @@ -16,9 +21,9 @@ module Gitlab validates :config, hash_or_string: true validates :config, allowed_keys: ALLOWED_KEYS validates :config, disallowed_keys: %i[ports], unless: :with_image_ports? - validates :name, type: String, presence: true validates :entrypoint, array_of_strings: true, allow_nil: true + validates :command, array_of_strings: true, allow_nil: true validates :alias, type: String, allow_nil: true validates :alias, type: String, presence: true, unless: ->(record) { record.ports.blank? } @@ -27,6 +32,8 @@ module Gitlab entry :ports, Entry::Ports, description: 'Ports used to expose the service' + attributes :ports + def alias value[:alias] end @@ -34,6 +41,29 @@ module Gitlab def command value[:command] end + + def name + value[:name] + end + + def entrypoint + value[:entrypoint] + end + + def value + return { name: @config } if string? + return @config if hash? + + {} + end + + def with_image_ports? + opt(:with_image_ports) + end + + def skip_config_hash_validation? + true + end end end end |