Commit 4229bcbf authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'rc/leverage-new-cache-policies' into 'master'

Leverage the new cache policies in .gitlab-ci.yml

See merge request !12978
parents 0b837ec3 36c9d209
image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3.3-golang-1.8-git-2.7-phantomjs-2.1-node-7.1-postgresql-9.6" image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3.3-golang-1.8-git-2.7-phantomjs-2.1-node-7.1-postgresql-9.6"
cache: .default-cache: &default-cache
key: "ruby-233-with-yarn" key: "ruby-233-with-yarn"
paths: paths:
- vendor/ruby - vendor/ruby
- .yarn-cache/ - .yarn-cache/
.push-cache: &push-cache
cache:
<<: *default-cache
policy: push
.pull-cache: &pull-cache
cache:
<<: *default-cache
policy: pull
variables: variables:
MYSQL_ALLOW_EMPTY_PASSWORD: "1" MYSQL_ALLOW_EMPTY_PASSWORD: "1"
...@@ -24,11 +34,11 @@ before_script: ...@@ -24,11 +34,11 @@ before_script:
- source scripts/prepare_build.sh - source scripts/prepare_build.sh
stages: stages:
- build - build
- prepare - prepare
- test - test
- post-test - post-test
- pages - pages
# Predefined scopes # Predefined scopes
.dedicated-runner: &dedicated-runner .dedicated-runner: &dedicated-runner
...@@ -41,10 +51,6 @@ stages: ...@@ -41,10 +51,6 @@ stages:
SETUP_DB: "false" SETUP_DB: "false"
USE_BUNDLE_INSTALL: "false" USE_BUNDLE_INSTALL: "false"
KNAPSACK_S3_BUCKET: "gitlab-ce-cache" KNAPSACK_S3_BUCKET: "gitlab-ce-cache"
cache:
key: "knapsack"
paths:
- knapsack/
artifacts: artifacts:
expire_in: 31d expire_in: 31d
paths: paths:
...@@ -79,8 +85,9 @@ stages: ...@@ -79,8 +85,9 @@ stages:
- /(^docs[\/-].*|.*-docs$)/ - /(^docs[\/-].*|.*-docs$)/
.rspec-knapsack: &rspec-knapsack .rspec-knapsack: &rspec-knapsack
stage: test
<<: *dedicated-runner <<: *dedicated-runner
<<: *pull-cache
stage: test
script: script:
- JOB_NAME=( $CI_JOB_NAME ) - JOB_NAME=( $CI_JOB_NAME )
- export CI_NODE_INDEX=${JOB_NAME[-2]} - export CI_NODE_INDEX=${JOB_NAME[-2]}
...@@ -110,8 +117,9 @@ stages: ...@@ -110,8 +117,9 @@ stages:
<<: *except-docs <<: *except-docs
.spinach-knapsack: &spinach-knapsack .spinach-knapsack: &spinach-knapsack
stage: test
<<: *dedicated-runner <<: *dedicated-runner
<<: *pull-cache
stage: test
script: script:
- JOB_NAME=( $CI_JOB_NAME ) - JOB_NAME=( $CI_JOB_NAME )
- export CI_NODE_INDEX=${JOB_NAME[-2]} - export CI_NODE_INDEX=${JOB_NAME[-2]}
...@@ -157,6 +165,7 @@ build-package: ...@@ -157,6 +165,7 @@ build-package:
SETUP_DB: "false" SETUP_DB: "false"
USE_BUNDLE_INSTALL: "false" USE_BUNDLE_INSTALL: "false"
stage: build stage: build
cache: {}
when: manual when: manual
script: script:
- scripts/trigger-build - scripts/trigger-build
...@@ -170,6 +179,11 @@ knapsack: ...@@ -170,6 +179,11 @@ knapsack:
<<: *dedicated-runner <<: *dedicated-runner
<<: *except-docs <<: *except-docs
stage: prepare stage: prepare
cache:
key: knapsack
paths:
- knapsack/
policy: pull
script: script:
- mkdir -p knapsack/${CI_PROJECT_NAME}/ - mkdir -p knapsack/${CI_PROJECT_NAME}/
- wget -O $KNAPSACK_RSPEC_SUITE_REPORT_PATH http://${KNAPSACK_S3_BUCKET}.s3.amazonaws.com/$KNAPSACK_RSPEC_SUITE_REPORT_PATH || rm $KNAPSACK_RSPEC_SUITE_REPORT_PATH - wget -O $KNAPSACK_RSPEC_SUITE_REPORT_PATH http://${KNAPSACK_S3_BUCKET}.s3.amazonaws.com/$KNAPSACK_RSPEC_SUITE_REPORT_PATH || rm $KNAPSACK_RSPEC_SUITE_REPORT_PATH
...@@ -182,6 +196,11 @@ update-knapsack: ...@@ -182,6 +196,11 @@ update-knapsack:
<<: *dedicated-runner <<: *dedicated-runner
<<: *only-canonical-masters <<: *only-canonical-masters
stage: post-test stage: post-test
cache:
key: knapsack
paths:
- knapsack/
policy: push
script: script:
- retry gem install fog-aws mime-types - retry gem install fog-aws mime-types
- scripts/merge-reports ${KNAPSACK_RSPEC_SUITE_REPORT_PATH} knapsack/${CI_PROJECT_NAME}/rspec-pg_node_*.json - scripts/merge-reports ${KNAPSACK_RSPEC_SUITE_REPORT_PATH} knapsack/${CI_PROJECT_NAME}/rspec-pg_node_*.json
...@@ -194,6 +213,8 @@ setup-test-env: ...@@ -194,6 +213,8 @@ setup-test-env:
<<: *dedicated-runner <<: *dedicated-runner
<<: *except-docs <<: *except-docs
stage: prepare stage: prepare
cache:
<<: *default-cache
script: script:
- node --version - node --version
- yarn install --pure-lockfile --cache-folder .yarn-cache - yarn install --pure-lockfile --cache-folder .yarn-cache
...@@ -273,6 +294,7 @@ spinach-mysql 4 5: *spinach-knapsack-mysql ...@@ -273,6 +294,7 @@ spinach-mysql 4 5: *spinach-knapsack-mysql
# Static analysis jobs # Static analysis jobs
.ruby-static-analysis: &ruby-static-analysis .ruby-static-analysis: &ruby-static-analysis
<<: *pull-cache
variables: variables:
SIMPLECOV: "false" SIMPLECOV: "false"
SETUP_DB: "false" SETUP_DB: "false"
...@@ -281,6 +303,7 @@ spinach-mysql 4 5: *spinach-knapsack-mysql ...@@ -281,6 +303,7 @@ spinach-mysql 4 5: *spinach-knapsack-mysql
<<: *ruby-static-analysis <<: *ruby-static-analysis
<<: *dedicated-runner <<: *dedicated-runner
<<: *except-docs <<: *except-docs
<<: *pull-cache
stage: test stage: test
script: script:
- bundle exec rake $CI_JOB_NAME - bundle exec rake $CI_JOB_NAME
...@@ -297,9 +320,9 @@ static-analysis: ...@@ -297,9 +320,9 @@ static-analysis:
# - Check validity of relative links # - Check validity of relative links
# - Make sure cURL examples in API docs use the full switches # - Make sure cURL examples in API docs use the full switches
docs lint: docs lint:
<<: *dedicated-runner
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:nanoc-bootstrap-ruby-2.4-alpine" image: "registry.gitlab.com/gitlab-org/gitlab-build-images:nanoc-bootstrap-ruby-2.4-alpine"
stage: test stage: test
<<: *dedicated-runner
cache: {} cache: {}
dependencies: [] dependencies: []
before_script: [] before_script: []
...@@ -342,9 +365,10 @@ ee_compat_check: ...@@ -342,9 +365,10 @@ ee_compat_check:
# DB migration, rollback, and seed jobs # DB migration, rollback, and seed jobs
.db-migrate-reset: &db-migrate-reset .db-migrate-reset: &db-migrate-reset
stage: test
<<: *dedicated-runner <<: *dedicated-runner
<<: *except-docs <<: *except-docs
<<: *pull-cache
stage: test
script: script:
- bundle exec rake db:migrate:reset - bundle exec rake db:migrate:reset
...@@ -357,11 +381,12 @@ db:migrate:reset-mysql: ...@@ -357,11 +381,12 @@ db:migrate:reset-mysql:
<<: *use-mysql <<: *use-mysql
.migration-paths: &migration-paths .migration-paths: &migration-paths
stage: test
<<: *dedicated-runner <<: *dedicated-runner
<<: *only-canonical-masters
<<: *pull-cache
stage: test
variables: variables:
SETUP_DB: "false" SETUP_DB: "false"
<<: *only-canonical-masters
script: script:
- git fetch origin v8.14.10 - git fetch origin v8.14.10
- git checkout -f FETCH_HEAD - git checkout -f FETCH_HEAD
...@@ -382,9 +407,10 @@ migration:path-mysql: ...@@ -382,9 +407,10 @@ migration:path-mysql:
<<: *use-mysql <<: *use-mysql
.db-rollback: &db-rollback .db-rollback: &db-rollback
stage: test
<<: *dedicated-runner <<: *dedicated-runner
<<: *except-docs <<: *except-docs
<<: *pull-cache
stage: test
script: script:
- bundle exec rake db:rollback STEP=120 - bundle exec rake db:rollback STEP=120
- bundle exec rake db:migrate - bundle exec rake db:migrate
...@@ -398,9 +424,10 @@ db:rollback-mysql: ...@@ -398,9 +424,10 @@ db:rollback-mysql:
<<: *use-mysql <<: *use-mysql
.db-seed_fu: &db-seed_fu .db-seed_fu: &db-seed_fu
stage: test
<<: *dedicated-runner <<: *dedicated-runner
<<: *except-docs <<: *except-docs
<<: *pull-cache
stage: test
variables: variables:
SIZE: "1" SIZE: "1"
SETUP_DB: "false" SETUP_DB: "false"
...@@ -425,9 +452,10 @@ db:seed_fu-mysql: ...@@ -425,9 +452,10 @@ db:seed_fu-mysql:
# Frontend-related jobs # Frontend-related jobs
gitlab:assets:compile: gitlab:assets:compile:
stage: test
<<: *dedicated-runner <<: *dedicated-runner
<<: *except-docs <<: *except-docs
<<: *pull-cache
stage: test
dependencies: [] dependencies: []
variables: variables:
NODE_ENV: "production" NODE_ENV: "production"
...@@ -445,14 +473,15 @@ gitlab:assets:compile: ...@@ -445,14 +473,15 @@ gitlab:assets:compile:
name: webpack-report name: webpack-report
expire_in: 31d expire_in: 31d
paths: paths:
- webpack-report/ - webpack-report/
karma: karma:
image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3.3-golang-1.8-git-2.7-chrome-59.0-node-7.1-postgresql-9.6"
stage: test
<<: *use-pg <<: *use-pg
<<: *dedicated-runner <<: *dedicated-runner
<<: *except-docs <<: *except-docs
<<: *pull-cache
image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3.3-golang-1.8-git-2.7-chrome-59.0-node-7.1-postgresql-9.6"
stage: test
variables: variables:
BABEL_ENV: "coverage" BABEL_ENV: "coverage"
CHROME_LOG_FILE: "chrome_debug.log" CHROME_LOG_FILE: "chrome_debug.log"
...@@ -470,6 +499,7 @@ karma: ...@@ -470,6 +499,7 @@ karma:
codeclimate: codeclimate:
<<: *except-docs <<: *except-docs
<<: *pull-cache
before_script: [] before_script: []
image: docker:latest image: docker:latest
stage: test stage: test
...@@ -485,10 +515,11 @@ codeclimate: ...@@ -485,10 +515,11 @@ codeclimate:
paths: [codeclimate.json] paths: [codeclimate.json]
coverage: coverage:
stage: post-test
services: []
<<: *dedicated-runner <<: *dedicated-runner
<<: *except-docs <<: *except-docs
<<: *pull-cache
stage: post-test
services: []
variables: variables:
SETUP_DB: "false" SETUP_DB: "false"
USE_BUNDLE_INSTALL: "true" USE_BUNDLE_INSTALL: "true"
...@@ -505,6 +536,7 @@ coverage: ...@@ -505,6 +536,7 @@ coverage:
lint:javascript:report: lint:javascript:report:
<<: *dedicated-runner <<: *dedicated-runner
<<: *except-docs <<: *except-docs
<<: *pull-cache
stage: post-test stage: post-test
before_script: [] before_script: []
script: script:
...@@ -517,9 +549,10 @@ lint:javascript:report: ...@@ -517,9 +549,10 @@ lint:javascript:report:
- eslint-report.html - eslint-report.html
pages: pages:
<<: *dedicated-runner
<<: *pull-cache
before_script: [] before_script: []
stage: pages stage: pages
<<: *dedicated-runner
dependencies: dependencies:
- coverage - coverage
- karma - karma
...@@ -543,6 +576,7 @@ pages: ...@@ -543,6 +576,7 @@ pages:
# rubygems.org in the future. # rubygems.org in the future.
cache gems: cache gems:
<<: *dedicated-runner <<: *dedicated-runner
<<: *pull-cache
only: only:
- tags - tags
variables: variables:
...@@ -557,8 +591,9 @@ cache gems: ...@@ -557,8 +591,9 @@ cache gems:
- master@gitlab-org/gitlab-ee - master@gitlab-org/gitlab-ee
gitlab_git_test: gitlab_git_test:
<<: *pull-cache
<<: *except-docs
variables: variables:
SETUP_DB: "false" SETUP_DB: "false"
script: script:
- spec/support/prepare-gitlab-git-test-for-commit --check-for-changes - spec/support/prepare-gitlab-git-test-for-commit --check-for-changes
<<: *except-docs
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment