Commit 5fa0ccc3 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'ee-31693-move-db-name-to-last-part-of-job-name' into 'master'

[EE] Resolve "Make the DB name a suffix of the first part of jobs' name"

See merge request !1820
parents e4003ebd 2adbde03
...@@ -143,6 +143,13 @@ stages: ...@@ -143,6 +143,13 @@ stages:
<<: *only-master-and-ee-or-mysql <<: *only-master-and-ee-or-mysql
<<: *except-docs <<: *except-docs
.only-canonical-masters: &only-canonical-masters
only:
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
- master@gitlab/gitlabhq
- master@gitlab/gitlab-ee
# Trigger a package build on omnibus-gitlab repository # Trigger a package build on omnibus-gitlab repository
build-package: build-package:
...@@ -172,17 +179,13 @@ knapsack: ...@@ -172,17 +179,13 @@ knapsack:
update-knapsack: update-knapsack:
<<: *knapsack-state <<: *knapsack-state
<<: *dedicated-runner <<: *dedicated-runner
<<: *only-canonical-masters
stage: post-test stage: post-test
script: script:
- 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
- scripts/merge-reports ${KNAPSACK_SPINACH_SUITE_REPORT_PATH} knapsack/${CI_PROJECT_NAME}/spinach_pg_node_*.json - scripts/merge-reports ${KNAPSACK_SPINACH_SUITE_REPORT_PATH} knapsack/${CI_PROJECT_NAME}/spinach_pg_node_*.json
- '[[ -z ${KNAPSACK_S3_BUCKET} ]] || scripts/sync-reports put $KNAPSACK_S3_BUCKET $KNAPSACK_RSPEC_SUITE_REPORT_PATH $KNAPSACK_SPINACH_SUITE_REPORT_PATH' - '[[ -z ${KNAPSACK_S3_BUCKET} ]] || scripts/sync-reports put $KNAPSACK_S3_BUCKET $KNAPSACK_RSPEC_SUITE_REPORT_PATH $KNAPSACK_SPINACH_SUITE_REPORT_PATH'
- rm -f knapsack/${CI_PROJECT_NAME}/*_node_*.json - rm -f knapsack/${CI_PROJECT_NAME}/*_node_*.json
only:
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
- master@gitlab/gitlabhq
- master@gitlab/gitlab-ee
setup-test-env: setup-test-env:
<<: *use-pg <<: *use-pg
...@@ -201,76 +204,75 @@ setup-test-env: ...@@ -201,76 +204,75 @@ setup-test-env:
- public/assets - public/assets
- tmp/tests - tmp/tests
rspec pg 0 20: *rspec-knapsack-pg rspec-pg 0 20: *rspec-knapsack-pg
rspec pg 1 20: *rspec-knapsack-pg rspec-pg 1 20: *rspec-knapsack-pg
rspec pg 2 20: *rspec-knapsack-pg rspec-pg 2 20: *rspec-knapsack-pg
rspec pg 3 20: *rspec-knapsack-pg rspec-pg 3 20: *rspec-knapsack-pg
rspec pg 4 20: *rspec-knapsack-pg rspec-pg 4 20: *rspec-knapsack-pg
rspec pg 5 20: *rspec-knapsack-pg rspec-pg 5 20: *rspec-knapsack-pg
rspec pg 6 20: *rspec-knapsack-pg rspec-pg 6 20: *rspec-knapsack-pg
rspec pg 7 20: *rspec-knapsack-pg rspec-pg 7 20: *rspec-knapsack-pg
rspec pg 8 20: *rspec-knapsack-pg rspec-pg 8 20: *rspec-knapsack-pg
rspec pg 9 20: *rspec-knapsack-pg rspec-pg 9 20: *rspec-knapsack-pg
rspec pg 10 20: *rspec-knapsack-pg rspec-pg 10 20: *rspec-knapsack-pg
rspec pg 11 20: *rspec-knapsack-pg rspec-pg 11 20: *rspec-knapsack-pg
rspec pg 12 20: *rspec-knapsack-pg rspec-pg 12 20: *rspec-knapsack-pg
rspec pg 13 20: *rspec-knapsack-pg rspec-pg 13 20: *rspec-knapsack-pg
rspec pg 14 20: *rspec-knapsack-pg rspec-pg 14 20: *rspec-knapsack-pg
rspec pg 15 20: *rspec-knapsack-pg rspec-pg 15 20: *rspec-knapsack-pg
rspec pg 16 20: *rspec-knapsack-pg rspec-pg 16 20: *rspec-knapsack-pg
rspec pg 17 20: *rspec-knapsack-pg rspec-pg 17 20: *rspec-knapsack-pg
rspec pg 18 20: *rspec-knapsack-pg rspec-pg 18 20: *rspec-knapsack-pg
rspec pg 19 20: *rspec-knapsack-pg rspec-pg 19 20: *rspec-knapsack-pg
rspec mysql 0 20: *rspec-knapsack-mysql rspec-mysql 0 20: *rspec-knapsack-mysql
rspec mysql 1 20: *rspec-knapsack-mysql rspec-mysql 1 20: *rspec-knapsack-mysql
rspec mysql 2 20: *rspec-knapsack-mysql rspec-mysql 2 20: *rspec-knapsack-mysql
rspec mysql 3 20: *rspec-knapsack-mysql rspec-mysql 3 20: *rspec-knapsack-mysql
rspec mysql 4 20: *rspec-knapsack-mysql rspec-mysql 4 20: *rspec-knapsack-mysql
rspec mysql 5 20: *rspec-knapsack-mysql rspec-mysql 5 20: *rspec-knapsack-mysql
rspec mysql 6 20: *rspec-knapsack-mysql rspec-mysql 6 20: *rspec-knapsack-mysql
rspec mysql 7 20: *rspec-knapsack-mysql rspec-mysql 7 20: *rspec-knapsack-mysql
rspec mysql 8 20: *rspec-knapsack-mysql rspec-mysql 8 20: *rspec-knapsack-mysql
rspec mysql 9 20: *rspec-knapsack-mysql rspec-mysql 9 20: *rspec-knapsack-mysql
rspec mysql 10 20: *rspec-knapsack-mysql rspec-mysql 10 20: *rspec-knapsack-mysql
rspec mysql 11 20: *rspec-knapsack-mysql rspec-mysql 11 20: *rspec-knapsack-mysql
rspec mysql 12 20: *rspec-knapsack-mysql rspec-mysql 12 20: *rspec-knapsack-mysql
rspec mysql 13 20: *rspec-knapsack-mysql rspec-mysql 13 20: *rspec-knapsack-mysql
rspec mysql 14 20: *rspec-knapsack-mysql rspec-mysql 14 20: *rspec-knapsack-mysql
rspec mysql 15 20: *rspec-knapsack-mysql rspec-mysql 15 20: *rspec-knapsack-mysql
rspec mysql 16 20: *rspec-knapsack-mysql rspec-mysql 16 20: *rspec-knapsack-mysql
rspec mysql 17 20: *rspec-knapsack-mysql rspec-mysql 17 20: *rspec-knapsack-mysql
rspec mysql 18 20: *rspec-knapsack-mysql rspec-mysql 18 20: *rspec-knapsack-mysql
rspec mysql 19 20: *rspec-knapsack-mysql rspec-mysql 19 20: *rspec-knapsack-mysql
spinach pg 0 10: *spinach-knapsack-pg spinach-pg 0 10: *spinach-knapsack-pg
spinach pg 1 10: *spinach-knapsack-pg spinach-pg 1 10: *spinach-knapsack-pg
spinach pg 2 10: *spinach-knapsack-pg spinach-pg 2 10: *spinach-knapsack-pg
spinach pg 3 10: *spinach-knapsack-pg spinach-pg 3 10: *spinach-knapsack-pg
spinach pg 4 10: *spinach-knapsack-pg spinach-pg 4 10: *spinach-knapsack-pg
spinach pg 5 10: *spinach-knapsack-pg spinach-pg 5 10: *spinach-knapsack-pg
spinach pg 6 10: *spinach-knapsack-pg spinach-pg 6 10: *spinach-knapsack-pg
spinach pg 7 10: *spinach-knapsack-pg spinach-pg 7 10: *spinach-knapsack-pg
spinach pg 8 10: *spinach-knapsack-pg spinach-pg 8 10: *spinach-knapsack-pg
spinach pg 9 10: *spinach-knapsack-pg spinach-pg 9 10: *spinach-knapsack-pg
spinach mysql 0 10: *spinach-knapsack-mysql spinach-mysql 0 10: *spinach-knapsack-mysql
spinach mysql 1 10: *spinach-knapsack-mysql spinach-mysql 1 10: *spinach-knapsack-mysql
spinach mysql 2 10: *spinach-knapsack-mysql spinach-mysql 2 10: *spinach-knapsack-mysql
spinach mysql 3 10: *spinach-knapsack-mysql spinach-mysql 3 10: *spinach-knapsack-mysql
spinach mysql 4 10: *spinach-knapsack-mysql spinach-mysql 4 10: *spinach-knapsack-mysql
spinach mysql 5 10: *spinach-knapsack-mysql spinach-mysql 5 10: *spinach-knapsack-mysql
spinach mysql 6 10: *spinach-knapsack-mysql spinach-mysql 6 10: *spinach-knapsack-mysql
spinach mysql 7 10: *spinach-knapsack-mysql spinach-mysql 7 10: *spinach-knapsack-mysql
spinach mysql 8 10: *spinach-knapsack-mysql spinach-mysql 8 10: *spinach-knapsack-mysql
spinach mysql 9 10: *spinach-knapsack-mysql spinach-mysql 9 10: *spinach-knapsack-mysql
# Other generic tests # Static analysis jobs
.ruby-static-analysis: &ruby-static-analysis .ruby-static-analysis: &ruby-static-analysis
variables: variables:
SIMPLECOV: "false" SIMPLECOV: "false"
SETUP_DB: "false" SETUP_DB: "false"
USE_BUNDLE_INSTALL: "true"
.rake-exec: &rake-exec .rake-exec: &rake-exec
<<: *ruby-static-analysis <<: *ruby-static-analysis
...@@ -315,6 +317,7 @@ downtime_check: ...@@ -315,6 +317,7 @@ downtime_check:
- /^[\d-]+-stable(-ee)?$/ - /^[\d-]+-stable(-ee)?$/
- /(^docs[\/-].*|.*-docs$)/ - /(^docs[\/-].*|.*-docs$)/
# DB migration, rollback, and seed jobs
.db-migrate-reset: &db-migrate-reset .db-migrate-reset: &db-migrate-reset
stage: test stage: test
<<: *dedicated-runner <<: *dedicated-runner
...@@ -322,14 +325,38 @@ downtime_check: ...@@ -322,14 +325,38 @@ downtime_check:
script: script:
- bundle exec rake db:migrate:reset - bundle exec rake db:migrate:reset
rake pg db:migrate:reset: db:migrate:reset-pg:
<<: *db-migrate-reset <<: *db-migrate-reset
<<: *use-pg <<: *use-pg
rake mysql db:migrate:reset: db:migrate:reset-mysql:
<<: *db-migrate-reset <<: *db-migrate-reset
<<: *use-mysql <<: *use-mysql
.migration-paths: &migration-paths
stage: test
<<: *dedicated-runner
variables:
SETUP_DB: "false"
<<: *only-canonical-masters
script:
- git fetch origin v8.14.10
- git checkout -f FETCH_HEAD
- bundle install $BUNDLE_INSTALL_FLAGS
- bundle exec rake db:drop db:create db:schema:load db:seed_fu
- git checkout $CI_COMMIT_SHA
- bundle install $BUNDLE_INSTALL_FLAGS
- . scripts/prepare_build.sh
- bundle exec rake db:migrate
migration:path-pg:
<<: *migration-paths
<<: *use-pg
migration:path-mysql:
<<: *migration-paths
<<: *use-mysql
.db-rollback: &db-rollback .db-rollback: &db-rollback
stage: test stage: test
<<: *dedicated-runner <<: *dedicated-runner
...@@ -338,11 +365,11 @@ rake mysql db:migrate:reset: ...@@ -338,11 +365,11 @@ rake mysql db:migrate:reset:
- bundle exec rake db:rollback STEP=120 - bundle exec rake db:rollback STEP=120
- bundle exec rake db:migrate - bundle exec rake db:migrate
rake pg db:rollback: db:rollback-pg:
<<: *db-rollback <<: *db-rollback
<<: *use-pg <<: *use-pg
rake mysql db:rollback: db:rollback-mysql:
<<: *db-rollback <<: *db-rollback
<<: *use-mysql <<: *use-mysql
...@@ -364,15 +391,16 @@ rake mysql db:rollback: ...@@ -364,15 +391,16 @@ rake mysql db:rollback:
paths: paths:
- log/development.log - log/development.log
rake pg db:seed_fu: db:seed_fu-pg:
<<: *db-seed_fu <<: *db-seed_fu
<<: *use-pg <<: *use-pg
rake mysql db:seed_fu: db:seed_fu-mysql:
<<: *db-seed_fu <<: *db-seed_fu
<<: *use-mysql <<: *use-mysql
rake gitlab:assets:compile: # Frontend-related jobs
gitlab:assets:compile:
stage: test stage: test
<<: *dedicated-runner <<: *dedicated-runner
<<: *except-docs <<: *except-docs
...@@ -392,7 +420,7 @@ rake gitlab:assets:compile: ...@@ -392,7 +420,7 @@ rake gitlab:assets:compile:
paths: paths:
- webpack-report/ - webpack-report/
rake karma: karma:
cache: cache:
paths: paths:
- vendor/ruby - vendor/ruby
...@@ -411,34 +439,6 @@ rake karma: ...@@ -411,34 +439,6 @@ rake karma:
paths: paths:
- coverage-javascript/ - coverage-javascript/
.migration-paths: &migration-paths
stage: test
<<: *dedicated-runner
variables:
SETUP_DB: "false"
only:
- master@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
- master@gitlab/gitlabhq
- master@gitlab/gitlab-ee
script:
- git fetch origin v8.14.10
- git checkout -f FETCH_HEAD
- bundle install $BUNDLE_INSTALL_FLAGS
- bundle exec rake db:drop db:create db:schema:load db:seed_fu
- git checkout $CI_COMMIT_SHA
- bundle install $BUNDLE_INSTALL_FLAGS
- . scripts/prepare_build.sh
- bundle exec rake db:migrate
migration pg paths:
<<: *migration-paths
<<: *use-pg
migration mysql paths:
<<: *migration-paths
<<: *use-mysql
coverage: coverage:
stage: post-test stage: post-test
services: [] services: []
...@@ -495,8 +495,8 @@ pages: ...@@ -495,8 +495,8 @@ pages:
<<: *dedicated-runner <<: *dedicated-runner
dependencies: dependencies:
- coverage - coverage
- rake karma - karma
- rake gitlab:assets:compile - gitlab:assets:compile
- lint:javascript:report - lint:javascript:report
script: script:
- mv public/ .public/ - mv public/ .public/
......
...@@ -4,9 +4,22 @@ export SETUP_DB=${SETUP_DB:-true} ...@@ -4,9 +4,22 @@ export SETUP_DB=${SETUP_DB:-true}
export USE_BUNDLE_INSTALL=${USE_BUNDLE_INSTALL:-true} export USE_BUNDLE_INSTALL=${USE_BUNDLE_INSTALL:-true}
export BUNDLE_INSTALL_FLAGS="--without production --jobs $(nproc) --path vendor --retry 3 --quiet" export BUNDLE_INSTALL_FLAGS="--without production --jobs $(nproc) --path vendor --retry 3 --quiet"
if [ "$USE_BUNDLE_INSTALL" != "false" ]; then
bundle install --clean $BUNDLE_INSTALL_FLAGS && bundle check
fi
# Only install knapsack after bundle install! Otherwise oddly some native
# gems could not be found under some circumstance. No idea why, hours wasted.
retry gem install knapsack fog-aws mime-types
cp config/resque.yml.example config/resque.yml
sed -i 's/localhost/redis/g' config/resque.yml
cp config/gitlab.yml.example config/gitlab.yml
# Determine the database by looking at the job name. # Determine the database by looking at the job name.
# For example, we'll get pg if the job is `rspec pg 19 20` # For example, we'll get pg if the job is `rspec-pg 19 20`
export GITLAB_DATABASE=$(echo $CI_JOB_NAME | cut -f2 -d' ') export GITLAB_DATABASE=$(echo $CI_JOB_NAME | cut -f1 -d' ' | cut -f2 -d-)
# This would make the default database postgresql, and we could also use # This would make the default database postgresql, and we could also use
# pg to mean postgresql. # pg to mean postgresql.
...@@ -24,7 +37,6 @@ if [ "$GITLAB_DATABASE" = 'postgresql' ]; then ...@@ -24,7 +37,6 @@ if [ "$GITLAB_DATABASE" = 'postgresql' ]; then
# EE-only # EE-only
sed -i 's/# host:.*/host: postgres/g' config/database_geo.yml sed -i 's/# host:.*/host: postgres/g' config/database_geo.yml
else # Assume it's mysql else # Assume it's mysql
sed -i 's/username:.*/username: root/g' config/database.yml sed -i 's/username:.*/username: root/g' config/database.yml
sed -i 's/password:.*/password:/g' config/database.yml sed -i 's/password:.*/password:/g' config/database.yml
...@@ -36,19 +48,6 @@ else # Assume it's mysql ...@@ -36,19 +48,6 @@ else # Assume it's mysql
sed -i 's/# host:.*/host: mysql/g' config/database_geo.yml sed -i 's/# host:.*/host: mysql/g' config/database_geo.yml
fi fi
cp config/resque.yml.example config/resque.yml
sed -i 's/localhost/redis/g' config/resque.yml
cp config/gitlab.yml.example config/gitlab.yml
if [ "$USE_BUNDLE_INSTALL" != "false" ]; then
bundle install --clean $BUNDLE_INSTALL_FLAGS && bundle check
fi
# Only install knapsack after bundle install! Otherwise oddly some native
# gems could not be found under some circumstance. No idea why, hours wasted.
retry gem install knapsack fog-aws mime-types
if [ "$SETUP_DB" != "false" ]; then if [ "$SETUP_DB" != "false" ]; then
bundle exec rake db:drop db:create db:schema:load db:migrate bundle exec rake db:drop db:create db:schema:load db:migrate
......
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