debian-mirror-gitlab/.gitlab/ci/global.gitlab-ci.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

375 lines
12 KiB
YAML
Raw Normal View History

2019-12-04 20:38:33 +05:30
.default-retry:
2019-07-31 22:56:46 +05:30
retry:
2019-09-04 21:01:54 +05:30
max: 2 # This is confusing but this means "3 runs at max".
2019-07-31 22:56:46 +05:30
when:
- unknown_failure
- api_failure
- runner_system_failure
2020-03-13 15:44:24 +05:30
- job_execution_timeout
- stuck_or_timeout_failure
2019-07-31 22:56:46 +05:30
2022-11-25 23:54:43 +05:30
.default-utils-before_script:
2019-12-04 20:38:33 +05:30
before_script:
2021-11-18 22:05:49 +05:30
- echo $FOSS_ONLY
2020-03-13 15:44:24 +05:30
- '[ "$FOSS_ONLY" = "1" ] && rm -rf ee/ qa/spec/ee/ qa/qa/specs/features/ee/ qa/qa/ee/ qa/qa/ee.rb'
2019-12-21 20:55:43 +05:30
- export GOPATH=$CI_PROJECT_DIR/.go
- mkdir -p $GOPATH
2019-12-04 20:38:33 +05:30
- source scripts/utils.sh
2022-11-25 23:54:43 +05:30
.default-before_script:
before_script:
- !reference [.default-utils-before_script, before_script]
2019-12-04 20:38:33 +05:30
- source scripts/prepare_build.sh
2019-07-31 22:56:46 +05:30
2023-04-23 21:23:45 +05:30
.production:
variables:
RAILS_ENV: "production"
NODE_ENV: "production"
GITLAB_ALLOW_SEPARATE_CI_DATABASE: "true"
2021-06-08 01:23:25 +05:30
.ruby-gems-cache: &ruby-gems-cache
2022-07-23 23:45:48 +05:30
key: "ruby-gems-debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}"
2021-06-08 01:23:25 +05:30
paths:
- vendor/ruby/
policy: pull
.ruby-gems-cache-push: &ruby-gems-cache-push
<<: *ruby-gems-cache
policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
.gitaly-ruby-gems-cache: &gitaly-ruby-gems-cache
2022-07-23 23:45:48 +05:30
key: "gitaly-ruby-gems-debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}"
2021-06-08 01:23:25 +05:30
paths:
- vendor/gitaly-ruby/
policy: pull
.gitaly-ruby-gems-cache-push: &gitaly-ruby-gems-cache-push
<<: *gitaly-ruby-gems-cache
policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
2021-09-04 01:27:46 +05:30
.gitaly-binaries-cache: &gitaly-binaries-cache
key:
files:
- GITALY_SERVER_VERSION
2022-06-21 17:19:12 +05:30
- lib/gitlab/setup_helper.rb
2022-07-23 23:45:48 +05:30
prefix: "gitaly-binaries-debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}"
2021-09-04 01:27:46 +05:30
paths:
2022-06-21 17:19:12 +05:30
- ${TMP_TEST_FOLDER}/gitaly/_build/bin/
- ${TMP_TEST_FOLDER}/gitaly/_build/deps/git/install/
- ${TMP_TEST_FOLDER}/gitaly/config.toml
- ${TMP_TEST_FOLDER}/gitaly/gitaly2.config.toml
- ${TMP_TEST_FOLDER}/gitaly/internal/
- ${TMP_TEST_FOLDER}/gitaly/run/
- ${TMP_TEST_FOLDER}/gitaly/run2/
- ${TMP_TEST_FOLDER}/gitaly/Makefile
- ${TMP_TEST_FOLDER}/gitaly/praefect.config.toml
2022-07-16 23:28:13 +05:30
- ${TMP_TEST_FOLDER}/gitaly/praefect-db.config.toml
2022-06-21 17:19:12 +05:30
- ${TMP_TEST_FOLDER}/gitaly/ruby/
2021-09-04 01:27:46 +05:30
policy: pull
2021-06-08 01:23:25 +05:30
.go-pkg-cache: &go-pkg-cache
2022-04-04 11:22:00 +05:30
key: "go-pkg-${DEBIAN_VERSION}"
2021-06-08 01:23:25 +05:30
paths:
- .go/pkg/mod/
policy: pull
.go-pkg-cache-push: &go-pkg-cache-push
<<: *go-pkg-cache
policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
.node-modules-cache: &node-modules-cache
2022-04-04 11:22:00 +05:30
key: "node-modules-${DEBIAN_VERSION}-${NODE_ENV}"
2021-06-08 01:23:25 +05:30
paths:
- node_modules/
- tmp/cache/webpack-dlls/
policy: pull
.node-modules-cache-push: &node-modules-cache-push
<<: *node-modules-cache
policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
2022-11-25 23:54:43 +05:30
.assets-tmp-cache: &assets-tmp-cache
key: "assets-tmp-debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}-node-${NODE_ENV}-v1"
paths:
- tmp/cache/assets/sprockets/
- tmp/cache/babel-loader/
- tmp/cache/vue-loader/
policy: pull
.assets-tmp-cache-push: &assets-tmp-cache-push
<<: *assets-tmp-cache
policy: push # We want to rebuild the cache from scratch to ensure we don't pile up outdated cache files.
2021-09-30 23:02:18 +05:30
.storybook-node-modules-cache: &storybook-node-modules-cache
2022-04-04 11:22:00 +05:30
key: "storybook-node-modules-${DEBIAN_VERSION}-${NODE_ENV}"
2021-09-30 23:02:18 +05:30
paths:
- storybook/node_modules/
policy: pull
.storybook-node-modules-cache-push: &storybook-node-modules-cache-push
<<: *storybook-node-modules-cache
policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
2021-06-08 01:23:25 +05:30
.rubocop-cache: &rubocop-cache
2022-07-23 23:45:48 +05:30
key: "rubocop-debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}"
2021-06-08 01:23:25 +05:30
paths:
- tmp/rubocop_cache/
policy: pull
.rubocop-cache-push: &rubocop-cache-push
<<: *rubocop-cache
# We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up but RuboCop has a mechanism
# for keeping only the N latest cache files, so we take advantage of it with `pull-push`.
2021-09-04 01:27:46 +05:30
policy: push
2021-06-08 01:23:25 +05:30
.qa-ruby-gems-cache: &qa-ruby-gems-cache
2022-07-16 23:28:13 +05:30
key:
2022-07-23 23:45:48 +05:30
prefix: "qa-ruby-gems-debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}"
2022-07-16 23:28:13 +05:30
files:
- qa/Gemfile.lock
2021-06-08 01:23:25 +05:30
paths:
2022-07-16 23:28:13 +05:30
- qa/vendor/ruby
2021-06-08 01:23:25 +05:30
policy: pull
.qa-ruby-gems-cache-push: &qa-ruby-gems-cache-push
<<: *qa-ruby-gems-cache
2022-07-16 23:28:13 +05:30
policy: pull-push
2021-06-08 01:23:25 +05:30
2021-03-11 19:13:27 +05:30
.setup-test-env-cache:
2019-07-31 22:56:46 +05:30
cache:
2021-06-08 01:23:25 +05:30
- *ruby-gems-cache
- *gitaly-ruby-gems-cache
2021-09-04 01:27:46 +05:30
- *gitaly-binaries-cache
2021-06-08 01:23:25 +05:30
- *go-pkg-cache
.setup-test-env-cache-push:
cache:
- *ruby-gems-cache-push
- *gitaly-ruby-gems-cache-push
- *go-pkg-cache-push
2019-07-31 22:56:46 +05:30
2021-09-04 01:27:46 +05:30
.gitaly-binaries-cache-push:
cache:
- <<: *gitaly-binaries-cache
policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
2021-12-11 22:18:48 +05:30
.ruby-cache:
cache:
- *ruby-gems-cache
2021-03-11 19:13:27 +05:30
.rails-cache:
cache:
2021-06-08 01:23:25 +05:30
- *ruby-gems-cache
- *gitaly-ruby-gems-cache
2021-03-11 19:13:27 +05:30
2020-06-23 00:09:42 +05:30
.static-analysis-cache:
cache:
2021-06-08 01:23:25 +05:30
- *ruby-gems-cache
- *node-modules-cache
- *rubocop-cache
2021-12-11 22:18:48 +05:30
.rubocop-job-cache:
cache:
- *ruby-gems-cache
- *rubocop-cache
.rubocop-job-cache-push:
2021-06-08 01:23:25 +05:30
cache:
- *ruby-gems-cache # We don't push this cache as it's already rebuilt by `update-setup-test-env-cache`
- *rubocop-cache-push
2020-06-23 00:09:42 +05:30
2021-01-03 14:25:43 +05:30
.coverage-cache:
cache:
2021-06-08 01:23:25 +05:30
- *ruby-gems-cache
2021-01-03 14:25:43 +05:30
2022-11-25 23:54:43 +05:30
.ruby-node-cache:
2021-04-17 20:07:23 +05:30
cache:
2021-06-08 01:23:25 +05:30
- *ruby-gems-cache
- *node-modules-cache
2021-04-17 20:07:23 +05:30
2022-08-13 15:12:31 +05:30
.qa-bundler-variables: &qa-bundler-variables
variables:
BUNDLE_SUPPRESS_INSTALL_USING_MESSAGES: "true"
BUNDLE_SILENCE_ROOT_WARNING: "true"
BUNDLE_PATH: vendor
2020-06-23 00:09:42 +05:30
.qa-cache:
2022-08-13 15:12:31 +05:30
<<: *qa-bundler-variables
2020-04-22 19:07:51 +05:30
cache:
2021-06-08 01:23:25 +05:30
- *qa-ruby-gems-cache
.qa-cache-push:
2022-08-13 15:12:31 +05:30
<<: *qa-bundler-variables
2021-06-08 01:23:25 +05:30
cache:
- *qa-ruby-gems-cache-push
2019-12-21 20:55:43 +05:30
2020-05-24 23:13:21 +05:30
.yarn-cache:
2020-04-22 19:07:51 +05:30
cache:
2021-06-08 01:23:25 +05:30
- *node-modules-cache
2020-06-23 00:09:42 +05:30
.assets-compile-cache:
cache:
2021-06-08 01:23:25 +05:30
- *ruby-gems-cache
- *node-modules-cache
2022-11-25 23:54:43 +05:30
- *assets-tmp-cache
2021-06-08 01:23:25 +05:30
.assets-compile-cache-push:
cache:
- *ruby-gems-cache # We don't push this cache as it's already rebuilt by `update-setup-test-env-cache`
- *node-modules-cache-push
2022-11-25 23:54:43 +05:30
- *assets-tmp-cache-push
2019-07-31 22:56:46 +05:30
2021-09-30 23:02:18 +05:30
.storybook-yarn-cache:
cache:
2021-11-18 22:05:49 +05:30
- *node-modules-cache
2021-09-30 23:02:18 +05:30
- *storybook-node-modules-cache
.storybook-yarn-cache-push:
cache:
2023-01-13 00:05:48 +05:30
- *node-modules-cache # We don't push this cache as it's already rebuilt by `update-assets-compile-*-cache`
2021-09-30 23:02:18 +05:30
- *storybook-node-modules-cache-push
2019-09-30 21:07:59 +05:30
2020-07-28 23:09:34 +05:30
.use-pg12:
services:
- name: postgres:12
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
2022-05-07 20:08:51 +05:30
- name: redis:6.0-alpine
2020-07-28 23:09:34 +05:30
variables:
POSTGRES_HOST_AUTH_METHOD: trust
2022-06-21 17:19:12 +05:30
PG_VERSION: "12"
2020-07-28 23:09:34 +05:30
2021-09-30 23:02:18 +05:30
.use-pg13:
services:
- name: postgres:13
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
2022-07-23 23:45:48 +05:30
- name: redis:6.2-alpine
2021-09-30 23:02:18 +05:30
variables:
POSTGRES_HOST_AUTH_METHOD: trust
2022-06-21 17:19:12 +05:30
PG_VERSION: "13"
2021-09-30 23:02:18 +05:30
2023-01-13 00:05:48 +05:30
.use-pg12-es7-ee:
2020-07-28 23:09:34 +05:30
services:
- name: postgres:12
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
2022-05-07 20:08:51 +05:30
- name: redis:6.0-alpine
2023-01-13 00:05:48 +05:30
- name: elasticsearch:7.17.6
2022-07-16 23:28:13 +05:30
command: ["elasticsearch", "-E", "discovery.type=single-node", "-E", "xpack.security.enabled=false"]
2023-04-23 21:23:45 +05:30
- name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:zoekt-ci-image-1.0
alias: zoekt-ci-image
2021-09-30 23:02:18 +05:30
variables:
POSTGRES_HOST_AUTH_METHOD: trust
2022-06-21 17:19:12 +05:30
PG_VERSION: "12"
2023-04-23 21:23:45 +05:30
ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060
ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070
2021-09-30 23:02:18 +05:30
2023-01-13 00:05:48 +05:30
.use-pg13-es7-ee:
2021-09-30 23:02:18 +05:30
services:
- name: postgres:13
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
2022-07-23 23:45:48 +05:30
- name: redis:6.2-alpine
2023-01-13 00:05:48 +05:30
- name: elasticsearch:7.17.6
2022-07-16 23:28:13 +05:30
command: ["elasticsearch", "-E", "discovery.type=single-node", "-E", "xpack.security.enabled=false"]
2023-04-23 21:23:45 +05:30
- name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:zoekt-ci-image-1.0
alias: zoekt-ci-image
2020-07-28 23:09:34 +05:30
variables:
POSTGRES_HOST_AUTH_METHOD: trust
2022-06-21 17:19:12 +05:30
PG_VERSION: "13"
2023-04-23 21:23:45 +05:30
ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060
ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070
2020-07-28 23:09:34 +05:30
2022-07-16 23:28:13 +05:30
.use-pg12-es8-ee:
services:
- name: postgres:12
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:6.0-alpine
2023-05-27 22:25:52 +05:30
- name: elasticsearch:8.6.2
2023-04-23 21:23:45 +05:30
- name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:zoekt-ci-image-1.0
alias: zoekt-ci-image
2022-07-16 23:28:13 +05:30
variables:
POSTGRES_HOST_AUTH_METHOD: trust
PG_VERSION: "12"
ES_SETTING_DISCOVERY_TYPE: "single-node"
ES_SETTING_XPACK_SECURITY_ENABLED: "false"
2023-04-23 21:23:45 +05:30
ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060
ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070
2022-07-16 23:28:13 +05:30
.use-pg12-opensearch1-ee:
services:
- name: postgres:12
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:6.0-alpine
2023-01-13 00:05:48 +05:30
- name: opensearchproject/opensearch:1.3.5
alias: elasticsearch
command: ["bin/opensearch", "-E", "discovery.type=single-node", "-E", "plugins.security.disabled=true"]
2023-04-23 21:23:45 +05:30
- name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:zoekt-ci-image-1.0
alias: zoekt-ci-image
2023-01-13 00:05:48 +05:30
variables:
POSTGRES_HOST_AUTH_METHOD: trust
PG_VERSION: "12"
2023-04-23 21:23:45 +05:30
ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060
ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070
2023-01-13 00:05:48 +05:30
.use-pg12-opensearch2-ee:
services:
- name: postgres:12
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:6.0-alpine
- name: opensearchproject/opensearch:2.2.1
2022-07-16 23:28:13 +05:30
alias: elasticsearch
command: ["bin/opensearch", "-E", "discovery.type=single-node", "-E", "plugins.security.disabled=true"]
2023-04-23 21:23:45 +05:30
- name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:zoekt-ci-image-1.0
alias: zoekt-ci-image
2022-07-16 23:28:13 +05:30
variables:
POSTGRES_HOST_AUTH_METHOD: trust
PG_VERSION: "12"
2023-04-23 21:23:45 +05:30
ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060
ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070
2022-07-16 23:28:13 +05:30
2020-04-22 19:07:51 +05:30
.use-kaniko:
image:
2022-01-26 12:08:38 +05:30
name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:kaniko
2020-04-22 19:07:51 +05:30
entrypoint: [""]
before_script:
2020-06-23 00:09:42 +05:30
- source scripts/utils.sh
2020-05-24 23:13:21 +05:30
- mkdir -p /kaniko/.docker
2020-04-22 19:07:51 +05:30
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
2020-04-08 14:13:33 +05:30
2020-03-13 15:44:24 +05:30
.as-if-foss:
2019-12-21 20:55:43 +05:30
variables:
FOSS_ONLY: '1'
2020-04-22 19:07:51 +05:30
.use-docker-in-docker:
2022-11-25 23:54:43 +05:30
image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}docker:${DOCKER_VERSION}
2020-04-22 19:07:51 +05:30
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
2023-01-13 00:05:48 +05:30
.use-buildx:
extends: .use-docker-in-docker
2023-05-27 22:25:52 +05:30
image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-bullseye-slim:docker-${DOCKER_VERSION}
2023-01-13 00:05:48 +05:30
variables:
QEMU_IMAGE: tonistiigi/binfmt:qemu-v7.0.0
before_script:
2023-03-17 16:20:25 +05:30
- !reference [.default-utils-before_script, before_script]
2023-01-13 00:05:48 +05:30
- echo "$CI_REGISTRY_PASSWORD" | docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" --password-stdin
- |
if [[ "${ARCH}" =~ arm64 ]]; then
echo -e "\033[1;33mInstalling latest qemu emulators\033[0m"
docker pull -q ${QEMU_IMAGE};
docker run --rm --privileged ${QEMU_IMAGE} --uninstall qemu-*;
docker run --rm --privileged ${QEMU_IMAGE} --install all;
fi
- docker buildx create --use # creates and set's to active buildkit builder
2023-03-04 22:38:38 +05:30
.use-kube-context:
before_script:
- export KUBE_CONTEXT="gitlab-org/gitlab:review-apps"
- kubectl config use-context ${KUBE_CONTEXT}