diff options
Diffstat (limited to 'scripts/utils.sh')
-rw-r--r-- | scripts/utils.sh | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/utils.sh b/scripts/utils.sh index e896fe40e06..ae071b98b43 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -15,16 +15,18 @@ function retry() { function test_url() { local url="${1}" - local curl_output="${2}" local status - status=$(curl -s -o "${curl_output}" -L -w ''%{http_code}'' "${url}") + status=$(curl --output /dev/null -L -s -w ''%{http_code}'' "${url}") if [[ $status == "200" ]]; then return 0 + else + # We display the error in the job to allow for better debugging + curl -L --fail --output /dev/null "${url}" + echo -e "\nExpected HTTP status 200: received ${status}\n" + return 1 fi - - return 1 } function bundle_install_script() { @@ -59,9 +61,14 @@ function setup_db_user_only() { source scripts/create_postgres_user.sh } +function setup_db_praefect() { + createdb -h postgres -U postgres --encoding=UTF8 --echo praefect_test +} + function setup_db() { run_timed_command "setup_db_user_only" run_timed_command_with_metric "bundle exec rake db:drop db:create db:structure:load db:migrate gitlab:db:setup_ee" "setup_db" + run_timed_command "setup_db_praefect" } function install_api_client_dependencies_with_apk() { |