Read about our upcoming Code of Conduct on this issue

global.gitlab-ci.yml 3.91 KB
Newer Older
Stan Hu's avatar
Stan Hu committed
1
.default-retry:
Kamil Trzciński's avatar
Kamil Trzciński committed
2
  retry:
Kamil Trzciński's avatar
Kamil Trzciński committed
3
    max: 2  # This is confusing but this means "3 runs at max".
Kamil Trzciński's avatar
Kamil Trzciński committed
4
5
6
7
    when:
      - unknown_failure
      - api_failure
      - runner_system_failure
8
9
      - job_execution_timeout
      - stuck_or_timeout_failure
Kamil Trzciński's avatar
Kamil Trzciński committed
10

Stan Hu's avatar
Stan Hu committed
11
12
.default-before_script:
  before_script:
13
    - '[ "$FOSS_ONLY" = "1" ] && rm -rf ee/ qa/spec/ee/ qa/qa/specs/features/ee/ qa/qa/ee/ qa/qa/ee.rb'
14
15
    - export GOPATH=$CI_PROJECT_DIR/.go
    - mkdir -p $GOPATH
Stan Hu's avatar
Stan Hu committed
16
17
    - source scripts/utils.sh
    - source scripts/prepare_build.sh
Kamil Trzciński's avatar
Kamil Trzciński committed
18

19
.rails-cache:
Kamil Trzciński's avatar
Kamil Trzciński committed
20
  cache:
21
    key: "rails-v2"
Stan Hu's avatar
Stan Hu committed
22
    paths:
23
24
25
      - vendor/ruby/
      - vendor/gitaly-ruby/
      - .go/pkg/mod/
Kamil Trzciński's avatar
Kamil Trzciński committed
26
27
    policy: pull

28
29
30
31
32
33
34
35
36
.static-analysis-cache:
  cache:
    key: "static-analysis-v1"
    paths:
      - vendor/ruby/
      - node_modules/
      - tmp/rubocop_cache/
    policy: pull

37
38
39
40
41
42
43
.coverage-cache:
  cache:
    key: "coverage-cache-v1"
    paths:
      - vendor/ruby/
    policy: pull

44
.qa-cache:
45
  cache:
46
    key: "qa-v1"
47
    paths:
48
      - qa/vendor/ruby/
49
    policy: pull
Stan Hu's avatar
Stan Hu committed
50

51
.yarn-cache:
52
  cache:
53
    key: "yarn-v1"
54
55
    paths:
      - node_modules/
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
      - tmp/cache/webpack-dlls/
    policy: pull

.assets-compile-cache:
  cache:
    key: "assets-compile-${NODE_ENV}-v1"
    paths:
      - vendor/ruby/
      - node_modules/
      - assets-hash.txt
      - public/assets/webpack/
      - tmp/cache/assets/sprockets/
      - tmp/cache/babel-loader/
      - tmp/cache/vue-loader/
      - tmp/cache/webpack-dlls/
    policy: pull
72

73
.use-pg11:
74
  image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-11-graphicsmagick-1.3.34"
75
76
77
  services:
    - name: postgres:11.6
      command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
78
    - name: redis:4.0-alpine
79
80
  variables:
    POSTGRES_HOST_AUTH_METHOD: trust
81

82
.use-pg12:
83
  image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-12-graphicsmagick-1.3.34"
84
85
86
  services:
    - name: postgres:12
      command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
87
    - name: redis:4.0-alpine
88
89
90
  variables:
    POSTGRES_HOST_AUTH_METHOD: trust

91
.use-pg11-ee:
92
  image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-11-graphicsmagick-1.3.34"
93
94
95
  services:
    - name: postgres:11.6
      command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
96
    - name: redis:4.0-alpine
97
98
    - name: elasticsearch:7.9.2
      command: ["elasticsearch", "-E", "discovery.type=single-node"]
99
100
101
  variables:
    POSTGRES_HOST_AUTH_METHOD: trust

102
.use-pg12-ee:
103
  image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-12-graphicsmagick-1.3.34"
104
105
106
  services:
    - name: postgres:12
      command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
107
    - name: redis:4.0-alpine
108
109
    - name: elasticsearch:7.9.2
      command: ["elasticsearch", "-E", "discovery.type=single-node"]
110
111
112
  variables:
    POSTGRES_HOST_AUTH_METHOD: trust

113
114
.use-kaniko:
  image:
115
    name: gcr.io/kaniko-project/executor:debug-v0.20.0
116
117
    entrypoint: [""]
  before_script:
118
    - source scripts/utils.sh
119
    - mkdir -p /kaniko/.docker
120
121
    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json

122
.as-if-foss:
123
  variables:
124
    FOSS_ONLY: '1'
125
126
127
128
129
130
131
132
133
134
135
136

.use-docker-in-docker:
  image: docker:${DOCKER_VERSION}
  services:
    - docker:${DOCKER_VERSION}-dind
  variables:
    DOCKER_DRIVER: overlay2
    DOCKER_HOST: tcp://docker:2375
    DOCKER_TLS_CERTDIR: ""
  tags:
    # See https://gitlab.com/gitlab-com/www-gitlab-com/-/issues/7019 for tag descriptions
    - gitlab-org-docker