diff options
author | Mario <mario@mariovavti.com> | 2024-03-14 12:42:04 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-03-14 12:42:04 +0000 |
commit | e0de8137007ac849b58ae010704b87e40cdda1bf (patch) | |
tree | c567007cdf262d7d6f29480df4a74de79bcc55e8 /tests/create_test_db_pgsql.sh | |
parent | 4fb37ef6f393e4eea60c743fb50c9d4a61534b8b (diff) | |
parent | 39448a08717f20858e6efc80af4dd833645d151d (diff) | |
download | volse-hubzilla-e0de8137007ac849b58ae010704b87e40cdda1bf.tar.gz volse-hubzilla-e0de8137007ac849b58ae010704b87e40cdda1bf.tar.bz2 volse-hubzilla-e0de8137007ac849b58ae010704b87e40cdda1bf.zip |
Merge branch 'fix-test-setup-on-mariadb' into 'dev'
Fix test db setup on MySQL/Mariadb + changed default
See merge request hubzilla/core!2112
Diffstat (limited to 'tests/create_test_db_pgsql.sh')
-rwxr-xr-x | tests/create_test_db_pgsql.sh | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/tests/create_test_db_pgsql.sh b/tests/create_test_db_pgsql.sh deleted file mode 100755 index 8ec2bc371..000000000 --- a/tests/create_test_db_pgsql.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env bash - -# -# Copyright (c) 2016 Hubzilla -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# - -# Exit if anything fails -set -e - -# -# Initialize some defaults if they're not set by the environment -# -: ${DB_ROOT_USER:=postgres} -: ${DB_TEST_USER:=test_user} -: ${DB_TEST_DB:=hubzilla_test_db} - -echo "Creating test db for PostgreSQL..." - -if [[ "$POSTGRESQL_VERSION" == "10" ]]; then - echo "Using PostgreSQL in Docker container, need to use TCP" - export PROTO="-h localhost" -fi - -# Print out some PostgreSQL information -psql --version -# Why does this hang further execution of the job? -psql $PROTO -U $DB_ROOT_USER -c "SELECT VERSION();" - -# Create Hubzilla database -psql $PROTO -U $DB_ROOT_USER -v ON_ERROR_STOP=1 <<-EOSQL - DROP DATABASE IF EXISTS $DB_TEST_DB; - DROP USER IF EXISTS $DB_TEST_USER; - CREATE USER $DB_TEST_USER WITH PASSWORD 'hubzilla'; - CREATE DATABASE $DB_TEST_DB WITH OWNER $DB_TEST_USER; -EOSQL - -export PGPASSWORD=hubzilla - -# Import table structure -echo "Importing schema..." -psql $PROTO -U $DB_TEST_USER -v ON_ERROR_STOP=1 $DB_TEST_DB < ./install/schema_postgres.sql - -# Show databases and tables -psql $PROTO -U $DB_TEST_USER -l -psql $PROTO -U $DB_TEST_USER -d $DB_TEST_DB -c "\dt;" |