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

job_type.rb « config « ci « types « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 65fdc4c261591e5cf4b9a02b855de97c850bc56e (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# frozen_string_literal: true

module Types
  module Ci
    # rubocop: disable Graphql/AuthorizeTypes
    module Config
      class JobType < BaseObject
        graphql_name 'CiConfigJob'

        field :name, GraphQL::STRING_TYPE, null: true,
              description: 'Name of the job.'
        field :group_name, GraphQL::STRING_TYPE, null: true,
              description: 'Name of the job group.'
        field :stage, GraphQL::STRING_TYPE, null: true,
              description: 'Name of the job stage.'
        field :needs, Types::Ci::Config::NeedType.connection_type, null: true,
              description: 'Builds that must complete before the jobs run.'
        field :allow_failure, GraphQL::BOOLEAN_TYPE, null: true,
              description:  'Allow job to fail.'
        field :before_script, [GraphQL::STRING_TYPE], null: true,
              description: 'Override a set of commands that are executed before the job.'
        field :script, [GraphQL::STRING_TYPE], null: true,
              description: 'Shell script that is executed by a runner.'
        field :after_script, [GraphQL::STRING_TYPE], null: true,
              description: 'Override a set of commands that are executed after the job.'
        field :when, GraphQL::STRING_TYPE, null: true,
              description: 'When to run the job.',
              resolver_method: :restrict_when_to_run_jobs
        field :environment, GraphQL::STRING_TYPE, null: true,
              description: 'Name of an environment to which the job deploys.'
        field :except, Types::Ci::Config::JobRestrictionType, null: true,
              description: 'Limit when jobs are not created.'
        field :only, Types::Ci::Config::JobRestrictionType, null: true,
               description: 'Jobs are created when these conditions do not apply.'
        field :tags, [GraphQL::STRING_TYPE], null: true,
              description: 'List of tags that are used to select a runner.'

        def restrict_when_to_run_jobs
          object[:when]
        end
      end
    end
  end
end