2020-01-14 10:07:55 -05:00
|
|
|
# Make sure to update all the similar conditions in other CI config files if you modify these conditions
|
|
|
|
.if-default: &if-default
|
|
|
|
if: '$CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/ || $CI_COMMIT_REF_NAME =~ /^\d+-\d+-auto-deploy-\d+$/ || $CI_COMMIT_REF_NAME =~ /^security\// || $CI_MERGE_REQUEST_IID || $CI_COMMIT_TAG'
|
|
|
|
|
|
|
|
# Make sure to update all the similar conditions in other CI config files if you modify these conditions
|
|
|
|
.if-default-ee: &if-default-ee
|
|
|
|
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/ || $CI_COMMIT_REF_NAME =~ /^\d+-\d+-auto-deploy-\d+$/ || $CI_COMMIT_REF_NAME =~ /^security\// || $CI_MERGE_REQUEST_IID || $CI_COMMIT_TAG) && $CI_PROJECT_NAME =~ /^gitlab(-ee)?$/'
|
|
|
|
|
|
|
|
# Make sure to update all the similar conditions in other CI config files if you modify these conditions
|
|
|
|
.if-master: &if-master
|
|
|
|
if: '$CI_COMMIT_REF_NAME == "master"'
|
|
|
|
|
|
|
|
# Make sure to update all the similar patterns in other CI config files if you modify these patterns
|
|
|
|
.code-backstage-patterns: &code-backstage-patterns
|
|
|
|
- ".gitlab/ci/**/*"
|
|
|
|
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
|
|
|
|
- ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,scss-lint}.yml"
|
|
|
|
- ".csscomb.json"
|
|
|
|
- "Dockerfile.assets"
|
|
|
|
- "*_VERSION"
|
|
|
|
- "Gemfile{,.lock}"
|
|
|
|
- "Rakefile"
|
|
|
|
- "{babel.config,jest.config}.js"
|
|
|
|
- "config.ru"
|
|
|
|
- "{package.json,yarn.lock}"
|
|
|
|
- "{,ee/}{app,bin,config,db,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*"
|
|
|
|
- "doc/api/graphql/reference/*" # Files in this folder are auto-generated
|
|
|
|
# Backstage changes
|
|
|
|
- "Dangerfile"
|
|
|
|
- "danger/**/*"
|
|
|
|
- "{,ee/}fixtures/**/*"
|
|
|
|
- "{,ee/}rubocop/**/*"
|
|
|
|
- "{,ee/}spec/**/*"
|
|
|
|
- "doc/README.md" # Some RSpec test rely on this file
|
|
|
|
|
2019-08-26 16:41:55 -04:00
|
|
|
.assets-compile-cache:
|
2019-04-12 04:56:38 -04:00
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- vendor/ruby/
|
|
|
|
- .yarn-cache/
|
|
|
|
- tmp/cache/assets/sprockets
|
2020-01-10 19:08:28 -05:00
|
|
|
- tmp/cache/babel-loader
|
|
|
|
- tmp/cache/vue-loader
|
2019-04-12 04:56:38 -04:00
|
|
|
|
2019-06-14 06:13:35 -04:00
|
|
|
.gitlab:assets:compile-metadata:
|
2019-08-26 16:41:55 -04:00
|
|
|
extends:
|
|
|
|
- .default-tags
|
|
|
|
- .default-retry
|
2019-09-17 10:16:34 -04:00
|
|
|
- .default-only
|
2019-08-26 16:41:55 -04:00
|
|
|
- .default-before_script
|
2019-09-17 10:16:34 -04:00
|
|
|
- .assets-compile-cache
|
2019-10-30 17:07:58 -04:00
|
|
|
- .only:changes-code-backstage-qa
|
2020-01-03 01:08:16 -05:00
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.16-graphicsmagick-1.3.33-docker-19.03.1
|
2019-12-24 07:08:01 -05:00
|
|
|
stage: prepare
|
2019-04-12 04:56:38 -04:00
|
|
|
services:
|
2019-08-02 08:46:06 -04:00
|
|
|
- docker:19.03.0-dind
|
2019-04-12 04:56:38 -04:00
|
|
|
variables:
|
|
|
|
NODE_ENV: "production"
|
|
|
|
RAILS_ENV: "production"
|
|
|
|
SETUP_DB: "false"
|
|
|
|
SKIP_STORAGE_VALIDATION: "true"
|
|
|
|
WEBPACK_REPORT: "true"
|
|
|
|
# we override the max_old_space_size to prevent OOM errors
|
|
|
|
NODE_OPTIONS: --max_old_space_size=3584
|
|
|
|
DOCKER_DRIVER: overlay2
|
|
|
|
DOCKER_HOST: tcp://docker:2375
|
2019-08-26 16:41:55 -04:00
|
|
|
cache:
|
2020-01-10 19:08:28 -05:00
|
|
|
key: "assets-compile:production:vendor_ruby:.yarn-cache:tmp_cache_assets_sprockets:tmp_cache_webpack:v7"
|
2019-08-26 16:41:55 -04:00
|
|
|
artifacts:
|
|
|
|
name: webpack-report
|
|
|
|
expire_in: 31d
|
|
|
|
paths:
|
|
|
|
- webpack-report/
|
|
|
|
- public/assets/
|
2019-04-12 04:56:38 -04:00
|
|
|
script:
|
|
|
|
- node --version
|
2019-07-02 10:29:47 -04:00
|
|
|
- retry yarn install --frozen-lockfile --production --cache-folder .yarn-cache --prefer-offline
|
2019-04-12 04:56:38 -04:00
|
|
|
- free -m
|
2019-06-05 10:58:35 -04:00
|
|
|
- retry bundle exec rake gitlab:assets:compile
|
2019-04-12 04:56:38 -04:00
|
|
|
- time scripts/build_assets_image
|
|
|
|
- scripts/clean-old-cached-assets
|
2019-06-05 12:31:35 -04:00
|
|
|
- rm -f /etc/apt/sources.list.d/google*.list # We don't need to update Chrome here
|
2019-04-12 04:56:38 -04:00
|
|
|
only:
|
2019-09-17 10:16:34 -04:00
|
|
|
variables:
|
2019-09-19 14:06:18 -04:00
|
|
|
- $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ # Matches the gitlab-org group and its subgroups
|
2019-09-17 10:16:34 -04:00
|
|
|
- $CI_SERVER_HOST == "dev.gitlab.org"
|
2019-04-12 04:56:38 -04:00
|
|
|
tags:
|
|
|
|
- gitlab-org
|
2019-08-26 16:41:55 -04:00
|
|
|
- docker
|
2019-04-12 04:56:38 -04:00
|
|
|
|
2019-10-16 14:08:01 -04:00
|
|
|
gitlab:assets:compile pull-push-cache:
|
2019-06-14 06:13:35 -04:00
|
|
|
extends: .gitlab:assets:compile-metadata
|
2019-08-26 16:41:55 -04:00
|
|
|
only:
|
|
|
|
refs:
|
2019-09-17 10:16:34 -04:00
|
|
|
- master
|
2019-06-14 06:13:35 -04:00
|
|
|
cache:
|
|
|
|
policy: pull-push
|
|
|
|
|
|
|
|
gitlab:assets:compile pull-cache:
|
|
|
|
extends: .gitlab:assets:compile-metadata
|
2019-08-26 16:41:55 -04:00
|
|
|
cache:
|
|
|
|
policy: pull
|
2019-06-14 06:13:35 -04:00
|
|
|
|
|
|
|
.compile-assets-metadata:
|
2019-08-26 16:41:55 -04:00
|
|
|
extends:
|
|
|
|
- .default-tags
|
|
|
|
- .default-retry
|
2019-09-17 10:16:34 -04:00
|
|
|
- .default-only
|
2019-08-26 16:41:55 -04:00
|
|
|
- .default-before_script
|
2019-09-17 10:16:34 -04:00
|
|
|
- .assets-compile-cache
|
2019-10-30 17:07:58 -04:00
|
|
|
- .only:changes-code-backstage-qa
|
2019-04-12 04:56:38 -04:00
|
|
|
stage: prepare
|
|
|
|
script:
|
|
|
|
- node --version
|
2019-07-02 10:29:47 -04:00
|
|
|
- retry yarn install --frozen-lockfile --cache-folder .yarn-cache --prefer-offline
|
2019-04-12 04:56:38 -04:00
|
|
|
- free -m
|
2019-06-05 10:58:35 -04:00
|
|
|
- retry bundle exec rake gitlab:assets:compile
|
2019-04-12 04:56:38 -04:00
|
|
|
- scripts/clean-old-cached-assets
|
|
|
|
variables:
|
2019-12-17 07:08:11 -05:00
|
|
|
SETUP_DB: "false"
|
2019-04-12 04:56:38 -04:00
|
|
|
# we override the max_old_space_size to prevent OOM errors
|
|
|
|
NODE_OPTIONS: --max_old_space_size=3584
|
2019-08-26 16:41:55 -04:00
|
|
|
cache:
|
2020-01-10 19:08:28 -05:00
|
|
|
key: "assets-compile:v8"
|
2019-04-12 04:56:38 -04:00
|
|
|
artifacts:
|
|
|
|
expire_in: 7d
|
|
|
|
paths:
|
|
|
|
- node_modules
|
|
|
|
- public/assets
|
2019-06-14 06:13:35 -04:00
|
|
|
|
2019-10-16 14:08:01 -04:00
|
|
|
compile-assets pull-push-cache:
|
2019-09-17 10:16:34 -04:00
|
|
|
extends: .compile-assets-metadata
|
2019-08-26 16:41:55 -04:00
|
|
|
only:
|
|
|
|
refs:
|
2019-09-17 10:16:34 -04:00
|
|
|
- master
|
2019-06-14 06:13:35 -04:00
|
|
|
cache:
|
|
|
|
policy: pull-push
|
|
|
|
|
2019-10-16 14:08:01 -04:00
|
|
|
compile-assets pull-push-cache foss:
|
|
|
|
extends: [".compile-assets-metadata", ".only-ee-as-if-foss"]
|
|
|
|
only:
|
2019-07-01 11:04:19 -04:00
|
|
|
refs:
|
2019-09-17 10:16:34 -04:00
|
|
|
- master
|
2019-10-16 14:08:01 -04:00
|
|
|
cache:
|
|
|
|
policy: pull-push
|
2020-01-10 19:08:28 -05:00
|
|
|
key: "assets-compile:v8:foss"
|
2019-10-16 14:08:01 -04:00
|
|
|
|
|
|
|
compile-assets pull-cache:
|
|
|
|
extends: .compile-assets-metadata
|
|
|
|
cache:
|
|
|
|
policy: pull
|
|
|
|
|
|
|
|
compile-assets pull-cache foss:
|
|
|
|
extends: [".compile-assets-metadata", ".only-ee-as-if-foss"]
|
2019-08-26 16:41:55 -04:00
|
|
|
cache:
|
|
|
|
policy: pull
|
2020-01-10 19:08:28 -05:00
|
|
|
key: "assets-compile:v8:foss"
|
2019-04-12 04:56:38 -04:00
|
|
|
|
2019-09-17 10:16:34 -04:00
|
|
|
.only-code-frontend-job-base:
|
2019-08-26 16:41:55 -04:00
|
|
|
extends:
|
|
|
|
- .default-tags
|
|
|
|
- .default-retry
|
|
|
|
- .default-cache
|
2019-09-17 10:16:34 -04:00
|
|
|
- .default-only
|
2019-08-26 16:41:55 -04:00
|
|
|
- .default-before_script
|
2019-10-30 17:07:58 -04:00
|
|
|
- .only:changes-code-backstage
|
2019-09-27 11:06:16 -04:00
|
|
|
- .use-pg9
|
2019-10-16 14:08:01 -04:00
|
|
|
stage: test
|
|
|
|
needs: ["setup-test-env", "compile-assets pull-cache"]
|
2019-09-17 10:16:34 -04:00
|
|
|
|
2019-10-04 11:06:38 -04:00
|
|
|
.karma-base:
|
2019-09-17 10:16:34 -04:00
|
|
|
extends: .only-code-frontend-job-base
|
2019-04-12 04:56:38 -04:00
|
|
|
variables:
|
|
|
|
# we override the max_old_space_size to prevent OOM errors
|
|
|
|
NODE_OPTIONS: --max_old_space_size=3584
|
|
|
|
script:
|
|
|
|
- export BABEL_ENV=coverage CHROME_LOG_FILE=chrome_debug.log
|
|
|
|
- date
|
|
|
|
- scripts/gitaly-test-spawn
|
|
|
|
- date
|
|
|
|
- bundle exec rake karma
|
2019-10-04 11:06:38 -04:00
|
|
|
|
|
|
|
karma:
|
|
|
|
extends: .karma-base
|
2019-04-12 04:56:38 -04:00
|
|
|
coverage: '/^Statements *: (\d+\.\d+%)/'
|
|
|
|
artifacts:
|
|
|
|
name: coverage-javascript
|
|
|
|
expire_in: 31d
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- chrome_debug.log
|
|
|
|
- coverage-javascript/
|
2019-07-18 13:52:52 -04:00
|
|
|
- tmp/tests/frontend/
|
2019-07-19 02:53:53 -04:00
|
|
|
reports:
|
|
|
|
junit: junit_karma.xml
|
2019-04-12 04:56:38 -04:00
|
|
|
|
2019-10-04 11:06:38 -04:00
|
|
|
karma-foss:
|
|
|
|
extends:
|
|
|
|
- .karma-base
|
|
|
|
- .only-ee-as-if-foss
|
|
|
|
|
|
|
|
.jest-base:
|
2019-09-17 10:16:34 -04:00
|
|
|
extends: .only-code-frontend-job-base
|
2019-04-12 04:56:38 -04:00
|
|
|
script:
|
|
|
|
- scripts/gitaly-test-spawn
|
|
|
|
- date
|
2019-07-17 18:17:37 -04:00
|
|
|
- bundle exec rake frontend:fixtures
|
2019-04-12 04:56:38 -04:00
|
|
|
- date
|
|
|
|
- yarn jest --ci --coverage
|
2019-10-04 11:06:38 -04:00
|
|
|
cache:
|
|
|
|
key: jest
|
|
|
|
paths:
|
|
|
|
- tmp/jest/jest/
|
|
|
|
policy: pull-push
|
|
|
|
|
|
|
|
jest:
|
|
|
|
extends: .jest-base
|
2019-04-12 04:56:38 -04:00
|
|
|
artifacts:
|
|
|
|
name: coverage-frontend
|
|
|
|
expire_in: 31d
|
|
|
|
when: always
|
|
|
|
paths:
|
2019-06-05 12:31:35 -04:00
|
|
|
- coverage-frontend/
|
|
|
|
- junit_jest.xml
|
2019-07-18 13:52:52 -04:00
|
|
|
- tmp/tests/frontend/
|
2019-07-19 02:53:53 -04:00
|
|
|
reports:
|
|
|
|
junit: junit_jest.xml
|
2019-10-04 11:06:38 -04:00
|
|
|
|
|
|
|
jest-foss:
|
|
|
|
extends:
|
|
|
|
- .jest-base
|
|
|
|
- .only-ee-as-if-foss
|
2019-04-12 04:56:38 -04:00
|
|
|
cache:
|
2019-10-04 11:06:38 -04:00
|
|
|
policy: pull
|
2019-04-12 04:56:38 -04:00
|
|
|
|
2019-08-26 16:41:55 -04:00
|
|
|
.qa-frontend-node:
|
|
|
|
extends:
|
|
|
|
- .default-tags
|
|
|
|
- .default-retry
|
|
|
|
- .default-cache
|
2019-10-16 14:08:01 -04:00
|
|
|
stage: test
|
2020-01-14 10:07:55 -05:00
|
|
|
rules:
|
|
|
|
- <<: *if-master
|
|
|
|
when: on_success
|
2019-08-26 16:41:55 -04:00
|
|
|
dependencies: []
|
2019-04-12 04:56:38 -04:00
|
|
|
cache:
|
|
|
|
key: "$CI_JOB_NAME"
|
|
|
|
paths:
|
|
|
|
- .yarn-cache/
|
|
|
|
policy: pull-push
|
|
|
|
script:
|
|
|
|
- date
|
2019-07-02 10:29:47 -04:00
|
|
|
- yarn install --frozen-lockfile --cache-folder .yarn-cache --prefer-offline
|
2019-04-12 04:56:38 -04:00
|
|
|
- date
|
|
|
|
- yarn run webpack-prod
|
|
|
|
|
|
|
|
qa-frontend-node:8:
|
2019-08-26 16:41:55 -04:00
|
|
|
extends: .qa-frontend-node
|
2019-07-22 13:05:17 -04:00
|
|
|
image: node:carbon
|
2019-04-12 04:56:38 -04:00
|
|
|
|
|
|
|
qa-frontend-node:10:
|
2019-08-26 16:41:55 -04:00
|
|
|
extends: .qa-frontend-node
|
2019-07-22 13:05:17 -04:00
|
|
|
image: node:dubnium
|
2019-04-12 04:56:38 -04:00
|
|
|
|
|
|
|
qa-frontend-node:latest:
|
2019-08-26 16:41:55 -04:00
|
|
|
extends: .qa-frontend-node
|
2019-07-22 13:05:17 -04:00
|
|
|
image: node:latest
|
2019-04-12 04:56:38 -04:00
|
|
|
allow_failure: true
|
2019-09-11 12:36:18 -04:00
|
|
|
|
|
|
|
webpack-dev-server:
|
|
|
|
extends:
|
|
|
|
- .default-tags
|
|
|
|
- .default-retry
|
|
|
|
- .default-cache
|
2019-10-16 14:08:01 -04:00
|
|
|
stage: test
|
2020-01-14 10:07:55 -05:00
|
|
|
rules:
|
|
|
|
- <<: *if-default
|
|
|
|
changes: *code-backstage-patterns
|
|
|
|
when: on_success
|
2019-10-16 14:08:01 -04:00
|
|
|
needs: ["setup-test-env", "compile-assets pull-cache"]
|
2019-09-11 12:36:18 -04:00
|
|
|
variables:
|
|
|
|
WEBPACK_MEMORY_TEST: "true"
|
2019-12-17 04:07:48 -05:00
|
|
|
WEBPACK_VENDOR_DLL: "true"
|
2019-09-11 12:36:18 -04:00
|
|
|
script:
|
2019-12-17 04:07:48 -05:00
|
|
|
- yarn webpack-vendor
|
2019-09-11 12:36:18 -04:00
|
|
|
- node --expose-gc node_modules/.bin/webpack-dev-server --config config/webpack.config.js
|
2019-12-04 10:11:23 -05:00
|
|
|
artifacts:
|
|
|
|
name: webpack-dev-server
|
|
|
|
expire_in: 31d
|
|
|
|
paths:
|
|
|
|
- webpack-dev-server.json
|