From cdcde75bb782951b27ab9db0d54a71db7c94d7cb Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Fri, 11 May 2018 23:06:08 +0800 Subject: Only setup db in the first checkout! --- scripts/utils.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scripts/utils.sh') diff --git a/scripts/utils.sh b/scripts/utils.sh index 6faa701f0ce..08c33f3f67e 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -12,3 +12,11 @@ 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 +} -- cgit v1.2.1 From 0ab6469187285368d9f64f9ec67dbbcfa3e5a901 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Tue, 15 May 2018 01:49:46 +0800 Subject: Grant privileges after database is created Never drop the database when granting privileges --- scripts/utils.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'scripts/utils.sh') diff --git a/scripts/utils.sh b/scripts/utils.sh index 08c33f3f67e..2d2ba115563 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -13,7 +13,17 @@ retry() { return 1 } +setup_db_user_only() { + if [ "$GITLAB_DATABASE" = "postgresql" ]; then + . scripts/create_postgres_user.sh + else + . scripts/create_mysql_user.sh + fi +} + setup_db() { + setup_db_user_only + bundle exec rake db:drop db:create db:schema:load db:migrate if [ "$GITLAB_DATABASE" = "mysql" ]; then -- cgit v1.2.1