summaryrefslogtreecommitdiff
path: root/scripts/prepare_build.sh
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-05-22 14:32:40 +0900
committerShinya Maeda <shinya@gitlab.com>2018-05-22 14:32:40 +0900
commitf61666c0d70ed2d8457e4a8d8d23e68816498035 (patch)
tree67478ee365f1c1f652ed3f3e5e8c69eefe7a48ee /scripts/prepare_build.sh
parent1c636b8080bad4f9ea8fb6992277e421816271ce (diff)
parentc6f72ac9a88521257991aa9a0cc6d558126f5bb9 (diff)
downloadgitlab-ce-f61666c0d70ed2d8457e4a8d8d23e68816498035.tar.gz
Merge branch 'master' into per-project-pipeline-iid
Diffstat (limited to 'scripts/prepare_build.sh')
-rw-r--r--scripts/prepare_build.sh20
1 files changed, 4 insertions, 16 deletions
diff --git a/scripts/prepare_build.sh b/scripts/prepare_build.sh
index 206d62dbc78..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
@@ -49,20 +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
- 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
+elif getent hosts postgres || getent hosts mysql; then
+ setup_db_user_only
fi