summaryrefslogtreecommitdiff
path: root/scripts/prepare_build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/prepare_build.sh')
-rw-r--r--[-rwxr-xr-x]scripts/prepare_build.sh29
1 files changed, 18 insertions, 11 deletions
diff --git a/scripts/prepare_build.sh b/scripts/prepare_build.sh
index fd173c0ba88..39806901274 100755..100644
--- a/scripts/prepare_build.sh
+++ b/scripts/prepare_build.sh
@@ -1,14 +1,22 @@
-#!/bin/sh
-
. scripts/utils.sh
export SETUP_DB=${SETUP_DB:-true}
export USE_BUNDLE_INSTALL=${USE_BUNDLE_INSTALL:-true}
export BUNDLE_INSTALL_FLAGS="--without production --jobs $(nproc) --path vendor --retry 3 --quiet"
+if [ "$USE_BUNDLE_INSTALL" != "false" ]; then
+ bundle install --clean $BUNDLE_INSTALL_FLAGS && bundle check
+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
+
+cp config/gitlab.yml.example config/gitlab.yml
+
# Determine the database by looking at the job name.
-# For example, we'll get pg if the job is `rspec pg 19 20`
-export GITLAB_DATABASE=$(echo $CI_JOB_NAME | cut -f2 -d' ')
+# For example, we'll get pg if the job is `rspec-pg 19 20`
+export GITLAB_DATABASE=$(echo $CI_JOB_NAME | cut -f1 -d' ' | cut -f2 -d-)
# This would make the default database postgresql, and we could also use
# pg to mean postgresql.
@@ -29,15 +37,14 @@ fi
cp config/resque.yml.example config/resque.yml
sed -i 's/localhost/redis/g' config/resque.yml
-cp config/gitlab.yml.example config/gitlab.yml
+cp config/redis.cache.yml.example config/redis.cache.yml
+sed -i 's/localhost/redis/g' config/redis.cache.yml
-if [ "$USE_BUNDLE_INSTALL" != "false" ]; then
- retry bundle install --clean $BUNDLE_INSTALL_FLAGS && bundle check
-fi
+cp config/redis.queues.yml.example config/redis.queues.yml
+sed -i 's/localhost/redis/g' config/redis.queues.yml
-# 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 fog-aws mime-types
+cp config/redis.shared_state.yml.example config/redis.shared_state.yml
+sed -i 's/localhost/redis/g' config/redis.shared_state.yml
if [ "$SETUP_DB" != "false" ]; then
bundle exec rake db:drop db:create db:schema:load db:migrate