Set up GitLab CI to create Geo database

parent 470c491e
......@@ -26,7 +26,7 @@ before_script:
- bundle --version
- '[ "$USE_BUNDLE_INSTALL" != "true" ] || retry bundle install --without postgres production --jobs $(nproc) $FLAGS'
- retry gem install knapsack
- '[ "$SETUP_DB" != "true" ] || bundle exec rake db:drop db:create db:schema:load db:migrate add_limits_mysql'
- '[ "$SETUP_DB" != "true" ] || bundle exec rake db:drop db:create db:schema:load db:migrate geo:db:drop geo:db:create geo:db:schema:load geo:db:migrate add_limits_mysql'
stages:
- prepare
......
# Warning: We don't support MySQL replication for GitLab Geo,
# this file is needed to run tests on GitLab CI.
#
# PRODUCTION
#
production:
adapter: mysql2
encoding: utf8
collation: utf8_general_ci
reconnect: false
database: gitlabhq_geo_production
pool: 10
username: git
password: "secure password"
# host: localhost
# socket: /tmp/mysql.sock
#
# Development specific
#
development:
adapter: mysql2
encoding: utf8
collation: utf8_general_ci
reconnect: false
database: gitlabhq_geo_development
pool: 5
username: root
password: "secure password"
# socket: /tmp/mysql.sock
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test: &test
adapter: mysql2
encoding: utf8mb4
collation: utf8mb4_general_ci
reconnect: false
database: gitlabhq_geo_test
pool: 5
username: root
password:
# socket: /tmp/mysql.sock
......@@ -21,6 +21,11 @@ if [ -f /.dockerenv ] || [ -f ./dockerinit ]; then
sed -i 's/password:.*/password:/g' config/database.yml
sed -i 's/# socket:.*/host: mysql/g' config/database.yml
cp config/database_geo.yml.mysql config/database_geo.yml
sed -i 's/username:.*/username: root/g' config/database_geo.yml
sed -i 's/password:.*/password:/g' config/database_geo.yml
sed -i 's/# socket:.*/host: mysql/g' config/database_geo.yml
cp config/resque.yml.example config/resque.yml
sed -i 's/localhost/redis/g' config/resque.yml
......@@ -32,4 +37,9 @@ else
sed "s/username\:.*$/username\: runner/" -i config/database.yml
sed "s/password\:.*$/password\: 'password'/" -i config/database.yml
sed "s/gitlabhq_test/gitlabhq_test_$rnd/" -i config/database.yml
cp config/database_geo.yml.mysql config/database_geo.yml
sed "s/username\:.*$/username\: runner/" -i config/database_geo.yml
sed "s/password\:.*$/password\: 'password'/" -i config/database_geo.yml
sed "s/gitlabhq_test/gitlabhq_test_$rnd/" -i config/database_geo.yml
fi
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