Commit 0a1b4db6 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Only setup db in the first checkout!

parent 7650e4de
......@@ -323,6 +323,7 @@ stages:
<<: *dedicated-no-docs-and-no-qa-pull-cache-job
variables:
CREATE_DB_USER: "true"
SETUP_DB: "false"
script:
- git fetch https://gitlab.com/gitlab-org/gitlab-ee.git v9.3.0-ee
- git checkout -f FETCH_HEAD
......@@ -331,7 +332,7 @@ stages:
- cp config/gitlab.yml.example config/gitlab.yml
- bundle exec rake db:drop db:create db:schema:load db:seed_fu
- date
- git checkout $CI_COMMIT_SHA
- git checkout -f $CI_COMMIT_SHA
- bundle install $BUNDLE_INSTALL_FLAGS
- date
- . scripts/prepare_build.sh
......@@ -342,16 +343,16 @@ stages:
<<: *dedicated-no-docs-and-no-qa-pull-cache-job
variables:
CREATE_DB_USER: "true"
SETUP_DB: "false"
script:
- CE_HEAD=$(ruby -r./scripts/ee_specific_check/ee_specific_check -e'puts EESpecificCheck.fetch_remote_ce_branch')
- git checkout -f $CE_HEAD
- bundle install $BUNDLE_INSTALL_FLAGS
- . scripts/utils.sh
- . scripts/prepare_build.sh
- date
- cp config/gitlab.yml.example config/gitlab.yml
- bundle exec rake db:drop db:create db:schema:load db:seed_fu
- setup_db
- date
- git checkout $CI_COMMIT_SHA
- bundle install $BUNDLE_INSTALL_FLAGS
- git checkout -f $CI_COMMIT_SHA
- date
- . scripts/prepare_build.sh
- date
......
......@@ -69,12 +69,5 @@ if [ "$CREATE_DB_USER" != "false" ]; then
fi
if [ "$SETUP_DB" != "false" ]; then
bundle exec rake db:drop db:create db:schema:load db:migrate
if [ "$GITLAB_DATABASE" = "mysql" ]; then
bundle exec rake add_limits_mysql
fi
# EE-only
bundle exec rake geo:db:drop geo:db:create geo:db:schema:load geo:db:migrate
setup_db
fi
......@@ -12,3 +12,14 @@ retry() {
done
return 1
}
setup_db() {
bundle exec rake db:drop db:create db:schema:load db:migrate
if [ "$GITLAB_DATABASE" = "mysql" ]; then
bundle exec rake add_limits_mysql
fi
# EE-only
bundle exec rake geo:db:drop geo:db:create geo:db:schema:load geo: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