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

rules.gitlab-ci.yml « ci « .gitlab - gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a19fd98c537e6b42ba30d5eac91567ae545cc33e (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
###############################################
#    Job configuration rules and defaults     #
###############################################

default:
  image: registry.gitlab.com/gitlab-org/gitlab-docs/base:alpine-3.16-ruby-3.0.5-2a7e4d1c
  tags:
    - gitlab-org

.bundle:
  before_script:
    - ruby --version
    - gem --version
    - bundle --version
    - bundle config set --local deployment true  # Install dependencies into ./vendor/bundle
    - bundle install
  cache:
    key:
      files:
        - Gemfile.lock
    paths:
      - vendor/bundle

.bundle_and_yarn:
  before_script:
    - ruby --version
    - gem --version
    - bundle --version
    - bundle config set --local deployment true  # Install dependencies into ./vendor/bundle
    - bundle install
    - node --version
    - yarn --version
    - yarn install --frozen-lockfile --cache-folder .yarn-cache
  cache:
    key:
      files:
        - Gemfile.lock
        - yarn.lock
    paths:
      - vendor/bundle
      - .yarn-cache/

.yarn:
  before_script:
    - node --version
    - yarn --version
    - yarn install --frozen-lockfile --cache-folder .yarn-cache
  cache:
    key:
      files:
        - yarn.lock
    paths:
      - .yarn-cache/

#
# Retry a job automatically if it fails (2 times)
#
.retry:
  retry: 2

#
# Rules to determine which pipelines jobs will run in.
#
.rules_scheduled_manual:
  rules:
    - if: $CHORES_PIPELINE == "true"
      when: never
    - if: '$CI_PIPELINE_SOURCE == "schedule"'
      when: manual
      allow_failure: true

.rules_chores:
  rules:
    - if: '$CI_PIPELINE_SOURCE == "schedule" && $CHORES_PIPELINE == "true"'
      when: manual
      allow_failure: true

.rules_site_tests:
  rules:
    - if: $CHORES_PIPELINE == "true"
      when: never
    # Don't run site tests for review apps.
    - if: '$CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "trigger"'
      when: never
    - if: '$CI_PIPELINE_SOURCE == "schedule"'
    - if: '$CI_MERGE_REQUEST_ID'
    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
    - if: '$CI_COMMIT_BRANCH =~ /^\d{1,2}\.\d{1,2}$/'

.rules_prod:
  rules:
    - if: $CHORES_PIPELINE == "true"
      when: never
    # Don't deploy to production for trigerred pipelines (usually review apps)
    - if: '$CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "trigger"'
      when: never
    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
    - if: '$CI_COMMIT_BRANCH =~ /^\d{1,2}\.\d{1,2}$/'

.rules_dev:
  rules:
    - if: $CI_MERGE_REQUEST_ID && $CI_COMMIT_REF_NAME =~ /algolia/
      variables:
        SEARCH_BACKEND: 'algolia'
    - if: $CI_MERGE_REQUEST_ID && $CI_COMMIT_REF_NAME =~ /gps/
      variables:
        SEARCH_BACKEND: 'google'
    - if: '$CI_MERGE_REQUEST_ID'
    - if: '$CI_COMMIT_BRANCH =~ /docs-preview/'  # TODO: Remove once no projects create such branch
    - if: '$CI_PIPELINE_SOURCE == "schedule" && $CHORES_PIPELINE == "true"'

.rules_upstream_review_app:
  rules:
    - if: '$CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "trigger"'

.rules_pages:
  rules:
    - if: $CHORES_PIPELINE == "true"
      when: never
    # Don't deploy to production for trigerred pipelines (usually review apps)
    - if: '$CI_PIPELINE_SOURCE == "pipeline"|| $CI_PIPELINE_SOURCE == "trigger"'
      when: never
    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'