2019-08-26 16:41:55 -04:00
|
|
|
.assets-compile-cache:
|
2019-04-12 04:56:38 -04:00
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- vendor/ruby/
|
2020-03-19 11:09:41 -04:00
|
|
|
- public/assets/webpack/
|
|
|
|
- assets-hash.txt
|
2019-04-12 04:56:38 -04:00
|
|
|
- .yarn-cache/
|
|
|
|
- tmp/cache/assets/sprockets
|
2020-01-10 19:08:28 -05:00
|
|
|
- tmp/cache/babel-loader
|
|
|
|
- tmp/cache/vue-loader
|
2020-02-18 16:09:11 -05:00
|
|
|
- tmp/cache/webpack-dlls
|
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-retry
|
|
|
|
- .default-before_script
|
2019-09-17 10:16:34 -04:00
|
|
|
- .assets-compile-cache
|
2020-04-01 14:07:56 -04:00
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.5-git-2.26-lfs-2.9-chrome-73.0-node-12.x-yarn-1.21-graphicsmagick-1.3.34-docker-19.03.1
|
2019-12-24 07:08:01 -05:00
|
|
|
stage: prepare
|
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
|
2019-08-26 16:41:55 -04:00
|
|
|
cache:
|
2020-03-19 11:09:41 -04:00
|
|
|
key: "assets-compile:production:v1"
|
2019-08-26 16:41:55 -04:00
|
|
|
artifacts:
|
|
|
|
name: webpack-report
|
|
|
|
expire_in: 31d
|
|
|
|
paths:
|
|
|
|
- webpack-report/
|
2020-03-19 11:09:41 -04:00
|
|
|
- assets-compile.log
|
2020-03-19 17:09:17 -04:00
|
|
|
# We consume these files in GitLab UI for integration tests:
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab-ui/-/blob/e88493b3c855aea30bf60baee692a64606b0eb1e/.storybook/preview-head.pug#L1
|
2020-03-19 11:09:41 -04:00
|
|
|
- public/assets/application-*.css
|
|
|
|
- public/assets/application-*.css.gz
|
|
|
|
when: always
|
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
|
2020-03-19 11:09:41 -04:00
|
|
|
- time bin/rake gitlab:assets:compile > assets-compile.log 2>&1
|
2019-04-12 04:56:38 -04:00
|
|
|
- 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
|
|
|
|
2019-10-16 14:08:01 -04:00
|
|
|
gitlab:assets:compile pull-push-cache:
|
2020-02-18 10:08:51 -05:00
|
|
|
extends:
|
|
|
|
- .gitlab:assets:compile-metadata
|
|
|
|
- .frontend:rules:gitlab-assets-compile-pull-push-cache
|
2019-06-14 06:13:35 -04:00
|
|
|
cache:
|
|
|
|
policy: pull-push
|
|
|
|
|
|
|
|
gitlab:assets:compile pull-cache:
|
2020-02-18 10:08:51 -05:00
|
|
|
extends:
|
|
|
|
- .gitlab:assets:compile-metadata
|
|
|
|
- .frontend:rules:gitlab-assets-compile-pull-cache
|
2019-08-26 16:41:55 -04:00
|
|
|
cache:
|
|
|
|
policy: pull
|
2019-06-14 06:13:35 -04:00
|
|
|
|
2020-04-28 08:09:44 -04:00
|
|
|
build-assets-image:
|
|
|
|
extends:
|
|
|
|
- .use-kaniko
|
|
|
|
- .frontend:rules:gitlab-assets-compile-pull-cache
|
|
|
|
stage: build-images
|
|
|
|
needs: ["gitlab:assets:compile pull-cache"]
|
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
|
|
|
script:
|
|
|
|
- wget -O ./build_assets_image "${CI_PROJECT_URL}/raw/${CI_COMMIT_SHA}/scripts/build_assets_image"
|
|
|
|
- wget -O ./Dockerfile.assets "${CI_PROJECT_URL}/raw/${CI_COMMIT_SHA}/Dockerfile.assets"
|
|
|
|
- chmod +x build_assets_image
|
|
|
|
# TODO: Change the image tag to be the MD5 of assets files and skip image building if the image exists
|
|
|
|
# We'll also need to pass GITLAB_ASSETS_TAG to the trigerred omnibus-gitlab pipeline similarly to how we do it for trigerred CNG pipelines
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab/issues/208389
|
|
|
|
- ./build_assets_image
|
|
|
|
|
2019-06-14 06:13:35 -04:00
|
|
|
.compile-assets-metadata:
|
2019-08-26 16:41:55 -04:00
|
|
|
extends:
|
|
|
|
- .default-retry
|
|
|
|
- .default-before_script
|
2019-09-17 10:16:34 -04:00
|
|
|
- .assets-compile-cache
|
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
|
2020-03-19 11:09:41 -04:00
|
|
|
- time bin/rake gitlab:assets:compile > assets-compile.log 2>&1
|
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
|
2020-02-18 16:09:11 -05:00
|
|
|
WEBPACK_VENDOR_DLL: "true"
|
2019-08-26 16:41:55 -04:00
|
|
|
cache:
|
2020-03-19 11:09:41 -04:00
|
|
|
key: "assets-compile:test:v1"
|
2019-04-12 04:56:38 -04:00
|
|
|
artifacts:
|
|
|
|
expire_in: 7d
|
|
|
|
paths:
|
|
|
|
- node_modules
|
|
|
|
- public/assets
|
2020-03-19 11:09:41 -04:00
|
|
|
- assets-compile.log
|
2020-04-01 02:07:50 -04:00
|
|
|
when: always
|
2019-06-14 06:13:35 -04:00
|
|
|
|
2019-10-16 14:08:01 -04:00
|
|
|
compile-assets pull-push-cache:
|
2020-02-18 10:08:51 -05:00
|
|
|
extends:
|
|
|
|
- .compile-assets-metadata
|
|
|
|
- .frontend:rules:compile-assets-pull-push-cache
|
2019-06-14 06:13:35 -04:00
|
|
|
cache:
|
|
|
|
policy: pull-push
|
|
|
|
|
2020-02-18 10:08:51 -05:00
|
|
|
compile-assets pull-push-cache as-if-foss:
|
2020-01-28 13:08:35 -05:00
|
|
|
extends:
|
|
|
|
- .compile-assets-metadata
|
2020-02-18 10:08:51 -05:00
|
|
|
- .frontend:rules:compile-assets-pull-push-cache-as-if-foss
|
2020-01-28 13:08:35 -05:00
|
|
|
- .as-if-foss
|
2019-10-16 14:08:01 -04:00
|
|
|
cache:
|
|
|
|
policy: pull-push
|
2020-03-19 11:09:41 -04:00
|
|
|
key: "assets-compile:test:as-if-foss:v1"
|
2019-10-16 14:08:01 -04:00
|
|
|
|
|
|
|
compile-assets pull-cache:
|
2020-02-18 10:08:51 -05:00
|
|
|
extends:
|
|
|
|
- .compile-assets-metadata
|
|
|
|
- .frontend:rules:compile-assets-pull-cache
|
2019-10-16 14:08:01 -04:00
|
|
|
cache:
|
|
|
|
policy: pull
|
|
|
|
|
2020-02-18 10:08:51 -05:00
|
|
|
compile-assets pull-cache as-if-foss:
|
2020-01-28 13:08:35 -05:00
|
|
|
extends:
|
|
|
|
- .compile-assets-metadata
|
2020-02-18 10:08:51 -05:00
|
|
|
- .frontend:rules:compile-assets-pull-cache-as-if-foss
|
2020-01-28 13:08:35 -05:00
|
|
|
- .as-if-foss
|
2019-08-26 16:41:55 -04:00
|
|
|
cache:
|
|
|
|
policy: pull
|
2020-03-19 11:09:41 -04:00
|
|
|
key: "assets-compile:test:as-if-foss:v1"
|
2019-04-12 04:56:38 -04:00
|
|
|
|
2020-02-20 07:08:51 -05:00
|
|
|
.frontend-fixtures-base:
|
2019-08-26 16:41:55 -04:00
|
|
|
extends:
|
|
|
|
- .default-retry
|
|
|
|
- .default-cache
|
|
|
|
- .default-before_script
|
2020-04-28 05:09:34 -04:00
|
|
|
- .use-pg9
|
2020-02-20 07:08:51 -05:00
|
|
|
stage: fixtures
|
2020-04-28 05:09:34 -04:00
|
|
|
needs: ["setup-test-env pg9", "compile-assets pull-cache"]
|
2020-02-20 07:08:51 -05:00
|
|
|
script:
|
|
|
|
- date
|
|
|
|
- scripts/gitaly-test-spawn
|
|
|
|
- date
|
|
|
|
- bundle exec rake frontend:fixtures
|
|
|
|
artifacts:
|
|
|
|
name: frontend-fixtures
|
|
|
|
expire_in: 31d
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- node_modules
|
|
|
|
- public/assets
|
|
|
|
- tmp/tests/frontend/
|
|
|
|
|
|
|
|
frontend-fixtures:
|
|
|
|
extends:
|
|
|
|
- .frontend-fixtures-base
|
|
|
|
- .frontend:rules:default-frontend-jobs
|
|
|
|
|
|
|
|
frontend-fixtures-as-if-foss:
|
|
|
|
extends:
|
|
|
|
- .frontend-fixtures-base
|
2020-03-23 11:09:36 -04:00
|
|
|
- .frontend:rules:default-frontend-jobs-no-foss
|
2020-02-20 07:08:51 -05:00
|
|
|
- .as-if-foss
|
|
|
|
|
|
|
|
.frontend-job-base:
|
|
|
|
extends:
|
|
|
|
- .default-retry
|
|
|
|
- .default-cache
|
|
|
|
- .default-before_script
|
|
|
|
variables:
|
|
|
|
USE_BUNDLE_INSTALL: "false"
|
|
|
|
SETUP_DB: "false"
|
2019-10-16 14:08:01 -04:00
|
|
|
stage: test
|
2019-09-17 10:16:34 -04:00
|
|
|
|
2019-10-04 11:06:38 -04:00
|
|
|
.karma-base:
|
2020-02-04 04:08:32 -05:00
|
|
|
extends: .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
|
2020-02-20 07:08:51 -05:00
|
|
|
- yarn karma
|
2019-10-04 11:06:38 -04:00
|
|
|
|
|
|
|
karma:
|
2020-02-18 10:08:51 -05:00
|
|
|
extends:
|
|
|
|
- .karma-base
|
|
|
|
- .frontend:rules:default-frontend-jobs
|
2020-02-20 07:08:51 -05:00
|
|
|
needs: ["frontend-fixtures"]
|
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
|
|
|
|
2020-02-18 10:08:51 -05:00
|
|
|
karma-as-if-foss:
|
2019-10-04 11:06:38 -04:00
|
|
|
extends:
|
|
|
|
- .karma-base
|
2020-03-23 11:09:36 -04:00
|
|
|
- .frontend:rules:default-frontend-jobs-no-foss
|
2020-02-04 04:08:32 -05:00
|
|
|
- .as-if-foss
|
2020-02-20 07:08:51 -05:00
|
|
|
needs: ["frontend-fixtures-as-if-foss"]
|
2019-10-04 11:06:38 -04:00
|
|
|
|
|
|
|
.jest-base:
|
2020-02-04 04:08:32 -05:00
|
|
|
extends: .frontend-job-base
|
2019-04-12 04:56:38 -04:00
|
|
|
script:
|
|
|
|
- date
|
2020-02-26 04:08:47 -05:00
|
|
|
- yarn jest --ci --coverage --testSequencer ./scripts/frontend/parallel_ci_sequencer.js
|
2019-10-04 11:06:38 -04:00
|
|
|
cache:
|
|
|
|
key: jest
|
|
|
|
paths:
|
2020-02-26 04:08:47 -05:00
|
|
|
- tmp/cache/jest/
|
2019-10-04 11:06:38 -04:00
|
|
|
policy: pull-push
|
|
|
|
|
|
|
|
jest:
|
2020-02-18 10:08:51 -05:00
|
|
|
extends:
|
|
|
|
- .jest-base
|
|
|
|
- .frontend:rules:default-frontend-jobs
|
2020-02-20 07:08:51 -05:00
|
|
|
needs: ["frontend-fixtures"]
|
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
|
2020-02-26 04:08:47 -05:00
|
|
|
parallel: 2
|
2019-10-04 11:06:38 -04:00
|
|
|
|
2020-02-18 10:08:51 -05:00
|
|
|
jest-as-if-foss:
|
2019-10-04 11:06:38 -04:00
|
|
|
extends:
|
|
|
|
- .jest-base
|
2020-03-23 11:09:36 -04:00
|
|
|
- .frontend:rules:default-frontend-jobs-no-foss
|
2020-02-04 04:08:32 -05:00
|
|
|
- .as-if-foss
|
2020-02-20 07:08:51 -05:00
|
|
|
needs: ["frontend-fixtures-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
|
|
|
|
2020-02-26 04:08:47 -05:00
|
|
|
coverage-frontend:
|
|
|
|
extends:
|
|
|
|
- .default-retry
|
2020-04-24 14:09:46 -04:00
|
|
|
- .frontend:rules:ee-mr-and-master-only
|
2020-02-26 04:08:47 -05:00
|
|
|
needs: ["jest"]
|
|
|
|
stage: post-test
|
|
|
|
before_script:
|
|
|
|
- yarn install --frozen-lockfile --cache-folder .yarn-cache --prefer-offline
|
|
|
|
script:
|
|
|
|
- yarn node scripts/frontend/merge_coverage_frontend.js
|
|
|
|
artifacts:
|
|
|
|
name: coverage-frontend
|
|
|
|
expire_in: 31d
|
|
|
|
paths:
|
|
|
|
- coverage-frontend/
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- .yarn-cache/
|
|
|
|
|
2019-08-26 16:41:55 -04:00
|
|
|
.qa-frontend-node:
|
|
|
|
extends:
|
|
|
|
- .default-retry
|
2020-02-18 10:08:51 -05:00
|
|
|
- .frontend:rules:qa-frontend-node
|
2019-10-16 14:08:01 -04:00
|
|
|
stage: test
|
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: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-retry
|
2020-02-18 10:08:51 -05:00
|
|
|
- .frontend:rules:default-frontend-jobs
|
2019-10-16 14:08:01 -04:00
|
|
|
stage: test
|
2020-04-23 17:09:31 -04:00
|
|
|
needs: []
|
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"
|
2020-04-23 17:09:31 -04:00
|
|
|
cache:
|
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- yarn.lock
|
|
|
|
- config/webpack.vendor.config.js
|
|
|
|
prefix: "v2"
|
|
|
|
paths:
|
|
|
|
- node_modules/
|
2019-09-11 12:36:18 -04:00
|
|
|
script:
|
2020-04-23 17:09:31 -04:00
|
|
|
- source scripts/utils.sh
|
|
|
|
- retry yarn install --frozen-lockfile
|
|
|
|
- retry 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
|