debian-mirror-gitlab/lib/gitlab/ci/config/entry/workflow.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
911 B
Ruby
Raw Normal View History

2019-12-26 22:10:19 +05:30
# frozen_string_literal: true
module Gitlab
module Ci
class Config
module Entry
class Workflow < ::Gitlab::Config::Entry::Node
include ::Gitlab::Config::Entry::Configurable
2022-11-25 23:54:43 +05:30
include ::Gitlab::Config::Entry::Validatable
include ::Gitlab::Config::Entry::Attributable
2019-12-26 22:10:19 +05:30
2022-11-25 23:54:43 +05:30
ALLOWED_KEYS = %i[rules name].freeze
attributes :name
2019-12-26 22:10:19 +05:30
validations do
validates :config, type: Hash
validates :config, allowed_keys: ALLOWED_KEYS
2022-11-25 23:54:43 +05:30
validates :name, allow_nil: true, length: { minimum: 1, maximum: 255 }
2019-12-26 22:10:19 +05:30
end
entry :rules, Entry::Rules,
description: 'List of evaluable Rules to determine Pipeline status.',
metadata: { allowed_when: %w[always never] }
2020-01-01 13:55:28 +05:30
def has_rules?
@config.try(:key?, :rules)
end
2019-12-26 22:10:19 +05:30
end
end
end
end
end