Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaUnisikhin committed Mar 18, 2024
1 parent 110578f commit 15484ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions docker/bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ sudo -u postgres /usr/bin/pg_basebackup -D /var/lib/postgresql/14/repl -R -h loc
sudo -u postgres /usr/lib/postgresql/14/bin/pg_ctl -D /var/lib/postgresql/14/repl/ -o '-p 5433' start

# Create databases
for database_name in db scram_db ldap_db auth_query_db db1 hba_db tsa_db addr_db xproto_db; do
for database_name in db scram_db ldap_db auth_query_db db1 hba_db tsa_db addr_db xproto_db "spqr-console"; do
sudo -u postgres createdb $database_name >> "$SETUP_LOG" 2>&1 || {
echo "ERROR: 'createdb $database_name' failed, examine the log"
cat "$SETUP_LOG"
Expand Down Expand Up @@ -171,7 +171,14 @@ psql -h localhost -p 5432 -U postgres -c "set password_encryption TO 'md5'; crea
exit 1
}

psql -h localhost -p 5432 -U postgres -c "create user xproto" -d xproto_db >> $SETUP_LOG 2>&1 || {
psql -h localhost -p 5432 -U postgres -c "create role xproto SUPERUSER LOGIN" -d xproto_db >> $SETUP_LOG 2>&1 || {
echo "ERROR: users creation failed, examine the log"
cat "$SETUP_LOG"
cat "$PG_LOG"
exit 1
}

psql -h localhost -p 5432 -U postgres -c "create user \"spqr-console\"" -d "spqr-console" >> $SETUP_LOG 2>&1 || {
echo "ERROR: users creation failed, examine the log"
cat "$SETUP_LOG"
cat "$PG_LOG"
Expand Down
2 changes: 1 addition & 1 deletion docker/xproto/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ git clone https://github.com/pg-sharding/spqr.git /xproto/spqr
cp /xproto/spqr/test/xproto/proto_test.go /xproto/proto_test.go
rm -rf /xproto/spqr
docker build -t xproto-tests /xproto
docker run -e POSTGRES_HOST=localhost -e POSTGRES_PORT=5432 -e POSTGRES_DB=xproto_db -e POSTGRES_USER=xproto --network=host xproto-tests
docker run -e POSTGRES_HOST=odyssey -e POSTGRES_PORT=6432 -e POSTGRES_DB=xproto_db -e POSTGRES_USER=xproto --network=odyssey_od_net xproto-tests

0 comments on commit 15484ca

Please sign in to comment.