Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions infra/dev/psql/scripts/configure-psql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
temp_pw_file=$(mktemp)
master_password=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c16)
echo ${master_password} > ${temp_pw_file}
sudo chown postgres:postgres "${temp_pw_file}"

export PGSETUP_INITDB_OPTIONS="-U ${master_username} --pwfile ${temp_pw_file}"
sudo postgresql-setup initdb
rm -f ${temp_pw_file}
export PGSETUP_INITDB_OPTIONS="-A password -U ${master_username} --pwfile ${temp_pw_file}"
sudo -E postgresql-setup initdb
sudo rm -f ${temp_pw_file}

ctx instance runtime-properties master_username ${master_username}
ctx instance runtime-properties master_password ${master_password}