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/prepare_build.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'scripts/prepare_build.sh') diff --git a/scripts/prepare_build.sh b/scripts/prepare_build.sh index 206d62dbc78..01cb01ed812 100644 --- a/scripts/prepare_build.sh +++ b/scripts/prepare_build.sh @@ -60,9 +60,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 + setup_db 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/prepare_build.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'scripts/prepare_build.sh') diff --git a/scripts/prepare_build.sh b/scripts/prepare_build.sh index 01cb01ed812..d8bcc9f8191 100644 --- a/scripts/prepare_build.sh +++ b/scripts/prepare_build.sh @@ -49,16 +49,8 @@ sed -i 's/localhost/redis/g' config/redis.queues.yml cp config/redis.shared_state.yml.example config/redis.shared_state.yml sed -i 's/localhost/redis/g' config/redis.shared_state.yml -# Some tasks (e.g. db:seed_fu) need to have a properly-configured database -# user but not necessarily a full schema loaded -if [ "$CREATE_DB_USER" != "false" ]; then - if [ "$GITLAB_DATABASE" = 'postgresql' ]; then - . scripts/create_postgres_user.sh - else - . scripts/create_mysql_user.sh - fi -fi - if [ "$SETUP_DB" != "false" ]; then setup_db +elif getent hosts postgres || getent hosts mysql; then + setup_db_user_only fi -- cgit v1.2.1 From bc57a62a5c8c4c1e08cdf5c4a1656357d885026d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Fri, 18 May 2018 15:32:07 +0200 Subject: Improve the single-script jobs CI config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- scripts/prepare_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/prepare_build.sh') diff --git a/scripts/prepare_build.sh b/scripts/prepare_build.sh index d8bcc9f8191..75a3cea0448 100644 --- a/scripts/prepare_build.sh +++ b/scripts/prepare_build.sh @@ -11,7 +11,7 @@ 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 +retry gem install knapsack --no-ri --no-rdoc cp config/gitlab.yml.example config/gitlab.yml sed -i 's/bin_path: \/usr\/bin\/git/bin_path: \/usr\/local\/bin\/git/' config/gitlab.yml -- cgit v1.2.1