Read about our upcoming Code of Conduct on this issue

global.gitlab-ci.yml 3.84 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/
26
27
28
29
      # Heptapod specific: frontend assets don't change much within
      # a given upstream version
      - public/assets
      - node_modules
Kamil Trzciński's avatar
Kamil Trzciński committed
30
31
    policy: pull

32
33
34
35
36
37
38
39
40
41
.static-analysis-cache:
  cache:
    key: "static-analysis-v1"
    paths:
      - vendor/ruby/
      - node_modules/
      - tmp/rubocop_cache/
    policy: pull

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

48
.yarn-cache:
49
  cache:
50
    key: "yarn-v1"
51
52
    paths:
      - node_modules/
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
      - 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
69

70
.use-pg11:
71
72
  # TODO minor base image change between v13.1 and v13.3, so we should
  # build a new image and make Docker tags '0.15', '0.16' etc.
73
  image: "registry.heptapod.net/heptapod/ci-images/heptapod-base"
74
75
76
  services:
    - name: postgres:11.6
      command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
77
    - name: redis:4.0-alpine
78
79
  variables:
    POSTGRES_HOST_AUTH_METHOD: trust
80

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

90
.use-pg11-ee:
91
  image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.28-lfs-2.9-chrome-84-node-12.x-yarn-1.21-postgresql-11-graphicsmagick-1.3.34"
92
93
94
  services:
    - name: postgres:11.6
      command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
95
    - name: redis:4.0-alpine
96
97
98
99
    - name: elasticsearch:6.4.2
  variables:
    POSTGRES_HOST_AUTH_METHOD: trust

100
.use-pg12-ee:
101
  image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.28-lfs-2.9-chrome-84-node-12.x-yarn-1.21-postgresql-12-graphicsmagick-1.3.34"
102
103
104
  services:
    - name: postgres:12
      command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
105
    - name: redis:4.0-alpine
106
107
108
109
    - name: elasticsearch:6.4.2
  variables:
    POSTGRES_HOST_AUTH_METHOD: trust

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

119
.as-if-foss:
120
  variables:
121
    FOSS_ONLY: '1'
122
123
124
125
126
127
128
129
130
131
132
133

.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