global.gitlab-ci.yml 2.57 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
13
.default-before_script:
  before_script:
    - date
14
    - '[ "$FOSS_ONLY" = "1" ] && rm -rf ee/ qa/spec/ee/ qa/qa/specs/features/ee/ qa/qa/ee/ qa/qa/ee.rb'
15
16
    - export GOPATH=$CI_PROJECT_DIR/.go
    - mkdir -p $GOPATH
Stan Hu's avatar
Stan Hu committed
17
18
19
    - source scripts/utils.sh
    - source scripts/prepare_build.sh
    - date
Kamil Trzciński's avatar
Kamil Trzciński committed
20
21

# Jobs that only need to pull cache
Stan Hu's avatar
Stan Hu committed
22
.default-cache:
Kamil Trzciński's avatar
Kamil Trzciński committed
23
  cache:
24
    key: "debian-stretch-ruby-2.6.6-pg11-node-12.x"
Stan Hu's avatar
Stan Hu committed
25
    paths:
26
      - .go/pkg/mod
Stan Hu's avatar
Stan Hu committed
27
28
29
      - vendor/ruby
      - .yarn-cache/
      - vendor/gitaly-ruby
Kamil Trzciński's avatar
Kamil Trzciński committed
30
31
    policy: pull

32
.rails-cache:
33
  cache:
34
35
36
37
38
39
40
41
42
43
    key:
      files:
        - Gemfile.lock
        - GITALY_SERVER_VERSION
      prefix: "ruby-go-cache-v1"
    paths:
      - vendor/ruby
      - vendor/gitaly-ruby
      - .go/pkg/mod
    policy: pull
Stan Hu's avatar
Stan Hu committed
44

45
.yarn-cache:
46
  cache:
47
48
49
50
51
52
    key:
      files:
        - yarn.lock
      prefix: "v1"
    paths:
      - node_modules/
53

54
.use-pg11:
55
  image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-11-graphicsmagick-1.3.34"
56
57
58
59
60
61
  services:
    - name: postgres:11.6
      command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
    - name: redis:alpine
  variables:
    POSTGRES_HOST_AUTH_METHOD: trust
62

63
.use-pg11-ee:
64
  image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-postgresql-11-graphicsmagick-1.3.34"
65
66
67
68
69
70
71
72
  services:
    - name: postgres:11.6
      command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
    - name: redis:alpine
    - name: elasticsearch:6.4.2
  variables:
    POSTGRES_HOST_AUTH_METHOD: trust

73
74
.use-kaniko:
  image:
75
    name: gcr.io/kaniko-project/executor:debug-v0.20.0
76
77
    entrypoint: [""]
  before_script:
78
    - mkdir -p /kaniko/.docker
79
80
    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json

81
.as-if-foss:
82
  variables:
83
    FOSS_ONLY: '1'
84
85
86
87
88
89
90
91
92
93
94
95

.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