diff options
author | Philippe Lafoucrière <plafoucriere@gitlab.com> | 2019-07-01 18:04:19 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-07-01 18:04:19 +0300 |
commit | de99b7ba9057eef8f809e920a93d06ecfdc21392 (patch) | |
tree | e0634c402bac01d58654a8fe5afd109301aa786c /.gitlab/ci/rails.gitlab-ci.yml | |
parent | 055ed2e8e79e917609e27f19e9149885036e503b (diff) |
Refactor except code
We repeat the same code in many places. With the support of multiple
extends, we can clean up several jobs.
Diffstat (limited to '.gitlab/ci/rails.gitlab-ci.yml')
-rw-r--r-- | .gitlab/ci/rails.gitlab-ci.yml | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml index 9dcc9479cca..009c18310e4 100644 --- a/.gitlab/ci/rails.gitlab-ci.yml +++ b/.gitlab/ci/rails.gitlab-ci.yml @@ -20,8 +20,9 @@ - master@gitlab/gitlab-ee .gitlab-setup: &gitlab-setup - extends: .dedicated-no-docs-and-no-qa-pull-cache-job - <<: *use-pg + extends: + - .dedicated-no-docs-and-no-qa-pull-cache-job + - .use-pg variables: SETUP_DB: "false" script: @@ -43,7 +44,9 @@ - bundle exec rake $CI_JOB_NAME .rspec-metadata: &rspec-metadata - extends: .dedicated-pull-cache-job + extends: + - .dedicated-pull-cache-job + - .no-docs-and-no-qa stage: test script: - JOB_NAME=( $CI_JOB_NAME ) @@ -76,9 +79,6 @@ - tmp/capybara/ reports: junit: junit_rspec.xml - except: - - /(^docs[\/-].*|.*-docs$)/ - - /(^qa[\/-].*|.*-qa$)/ .rspec-metadata-pg: &rspec-metadata-pg <<: *rspec-metadata @@ -122,8 +122,10 @@ - setup-test-env setup-test-env: - extends: .dedicated-runner-default-cache - <<: *use-pg + extends: + - .dedicated-runner-default-cache + - .no-docs + - .use-pg stage: prepare script: - bundle exec ruby -Ispec -e 'require "spec_helper" ; TestEnv.init' @@ -134,8 +136,6 @@ setup-test-env: - tmp/tests - config/secrets.yml - vendor/gitaly-ruby - except: - - /(^docs[\/-].*|.*-docs$)/ rspec unit pg: <<: *rspec-metadata-pg @@ -200,11 +200,12 @@ static-analysis: downtime_check: <<: *rake-exec except: - - master - - tags - - /^[\d-]+-stable(-ee)?$/ - - /(^docs[\/-].*|.*-docs$)/ - - /(^qa[\/-].*|.*-qa$)/ + refs: + - master + - tags + - /^[\d-]+-stable(-ee)?$/ + - /(^docs[\/-].*|.*-docs$)/ + - /(^qa[\/-].*|.*-qa$)/ dependencies: - setup-test-env @@ -212,12 +213,13 @@ ee_compat_check: <<: *rake-exec dependencies: [] except: - - master - - tags - - /[\d-]+-stable(-ee)?/ - - /^security-/ - - branches@gitlab-org/gitlab-ee - - branches@gitlab/gitlab-ee + refs: + - master + - tags + - /[\d-]+-stable(-ee)?/ + - /^security-/ + - branches@gitlab-org/gitlab-ee + - branches@gitlab/gitlab-ee retry: 0 artifacts: name: "${CI_JOB_NAME}_${CI_COMIT_REF_NAME}_${CI_COMMIT_SHA}" @@ -261,7 +263,9 @@ gitlab:setup-pg: coverage: # Don't include dedicated-no-docs-no-db-pull-cache-job here since we need to # download artifacts from all the rspec jobs instead of from setup-test-env only - extends: .dedicated-runner-default-cache + extends: + - .dedicated-runner-default-cache + - .no-docs-and-no-qa cache: policy: pull variables: @@ -276,6 +280,3 @@ coverage: paths: - coverage/index.html - coverage/assets/ - except: - - /(^docs[\/-].*|.*-docs$)/ - - /(^qa[\/-].*|.*-qa$)/ |