global.gitlab-ci.yml 3.96 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
.static-analysis-cache:
  cache:
    key: "static-analysis-v1"
    paths:
      - vendor/ruby/
      - node_modules/
      - tmp/rubocop_cache/
    policy: pull

41
42
43
44
45
46
47
.coverage-cache:
  cache:
    key: "coverage-cache-v1"
    paths:
      - vendor/ruby/
    policy: pull

48
.qa-cache:
49
  cache:
50
    key: "qa-v1"
51
    paths:
52
      - qa/vendor/ruby/
53
    policy: pull
Stan Hu's avatar
Stan Hu committed
54

55
.yarn-cache:
56
  cache:
57
    key: "yarn-v1"
58
59
    paths:
      - node_modules/
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
      - 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
76

77
.use-pg11:
78
  image: "registry.heptapod.net/heptapod/ci-images/heptapod-base:default"
79
80
81
  services:
    - name: postgres:11.6
      command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
82
    - name: redis:4.0-alpine
83
84
  variables:
    POSTGRES_HOST_AUTH_METHOD: trust
85

86
.use-pg12:
87
  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"
88
89
90
  services:
    - name: postgres:12
      command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
91
    - name: redis:4.0-alpine
92
93
  variables:
    POSTGRES_HOST_AUTH_METHOD: trust
94

95
.use-pg11-ee:
96
  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"
97
98
99
  services:
    - name: postgres:11.6
      command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
100
    - name: redis:4.0-alpine
101
102
    - name: elasticsearch:7.9.2
      command: ["elasticsearch", "-E", "discovery.type=single-node"]
103
104
105
  variables:
    POSTGRES_HOST_AUTH_METHOD: trust

106
.use-pg12-ee:
107
  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"
108
109
110
  services:
    - name: postgres:12
      command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
111
    - name: redis:4.0-alpine
112
113
    - name: elasticsearch:7.9.2
      command: ["elasticsearch", "-E", "discovery.type=single-node"]
114
115
116
  variables:
    POSTGRES_HOST_AUTH_METHOD: trust

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

126
.as-if-foss:
127
  variables:
128
    FOSS_ONLY: '1'
129
130
131
132
133
134
135
136
137
138
139
140

.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