summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-24 00:09:52 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-24 00:09:52 +0000
commit0abfd0b478192436e7328469320923a04885a3b7 (patch)
tree89d0c8221a93de4bddf86e83eae08b3c18bd6c1a /scripts
parent4e7abe540dbd1d170bfb2b3594e645cbfb48cac3 (diff)
downloadgitlab-ce-0abfd0b478192436e7328469320923a04885a3b7.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/db_tasks3
-rw-r--r--scripts/prepare_build.sh6
2 files changed, 8 insertions, 1 deletions
diff --git a/scripts/db_tasks b/scripts/db_tasks
index 36040877abf..645e46e02d9 100755
--- a/scripts/db_tasks
+++ b/scripts/db_tasks
@@ -5,6 +5,7 @@ require 'yaml'
rails_env = ENV.fetch('RAILS_ENV')
database_config = YAML.load_file(File.join(File.expand_path('..', __dir__), 'config', 'database.yml'))[rails_env]
+database_config.reject! { |_k, v| v["database_tasks"] == false }
task = ARGV.shift
raise ArgumentError, 'You need to pass a task name!' unless task
@@ -14,4 +15,4 @@ cmd = ['bundle', 'exec', 'rake', task, *ARGV]
puts "Running: `#{cmd.join(' ')}`"
-system(*cmd)
+exit 1 unless system(*cmd)
diff --git a/scripts/prepare_build.sh b/scripts/prepare_build.sh
index 500e61ab76a..ca3dd0eec57 100644
--- a/scripts/prepare_build.sh
+++ b/scripts/prepare_build.sh
@@ -14,7 +14,13 @@ if [ "$DECOMPOSED_DB" == "true" ]; then
echo "Using decomposed database config (config/database.yml.decomposed-postgresql)"
cp config/database.yml.decomposed-postgresql config/database.yml
else
+ echo "Using decomposed database config (config/database.yml.postgresql)"
cp config/database.yml.postgresql config/database.yml
+
+ if [ "$CI_CONNECTION_DB" == "true" ]; then
+ echo "Enabling ci connection (database_tasks: false) in config/database.yml"
+ sed -i '/ci:/,/geo:/''s/^ # / /g' config/database.yml
+ fi
fi
# Set up Geo database if the job name matches `rspec-ee` or `geo`.