mirror of
https://github.com/juspay/services-flake.git
synced 2024-08-16 15:50:38 +03:00
postgres ensure socketDir mktemp init succeeds (#81)
* fix: ensure socketDir mktemp succeeds when path does not exist yet * postgres: test socketDir with a multi-level non-existing path
This commit is contained in:
parent
1a3f2d1936
commit
eb8361b9ab
@ -7,6 +7,7 @@
|
||||
};
|
||||
services.postgres."pg2" = {
|
||||
enable = true;
|
||||
socketDir = "./test/new/socket/path";
|
||||
port = 5433;
|
||||
listen_addresses = "127.0.0.1";
|
||||
# INFO: pg1 creates $USER database while pg2 doesn't because `initialDatabases` is present
|
||||
@ -29,7 +30,7 @@
|
||||
text = ''
|
||||
echo 'SELECT version();' | psql -h 127.0.0.1
|
||||
echo 'SHOW hba_file;' | psql -h 127.0.0.1 | ${pkgs.gawk}/bin/awk 'NR==3' | grep '^ /nix/store'
|
||||
|
||||
|
||||
# initialScript.before test
|
||||
echo "SELECT 1 FROM pg_roles WHERE rolname = 'bar';" | psql -h 127.0.0.1 | grep -q 1
|
||||
|
||||
|
@ -100,7 +100,7 @@ in
|
||||
echo
|
||||
echo "PostgreSQL is setting up the initial database."
|
||||
echo
|
||||
PGHOST=$(mktemp -d "$(readlink -f "${config.socketDir}")/pg-init-XXXXXX")
|
||||
PGHOST=$(mkdir -p "${config.socketDir}" && mktemp -d "$(readlink -f "${config.socketDir}")/pg-init-XXXXXX")
|
||||
export PGHOST
|
||||
|
||||
function remove_tmp_pg_init_sock_dir() {
|
||||
|
Loading…
Reference in New Issue
Block a user