Skip to content

Commit 5c8f55e

Browse files
authored
Merge pull request #2 from clearpathrobotics/CORE-21733-dev-environment-changes
Move postgres host and port to a single location.
2 parents 3016026 + d7e6bfc commit 5c8f55e

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

flake.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,10 @@
624624
export HYDRA_HOME="$(pwd)/src/"
625625
mkdir -p .hydra-data
626626
export HYDRA_DATA="$(pwd)/.hydra-data"
627-
export HYDRA_DBI='dbi:Pg:dbname=hydra;host=localhost;port=64444'
627+
export LOGNAME="hydra-dev"
628+
export PGPORT=64444
629+
export PGHOST="localhost"
630+
export HYDRA_DBI="dbi:Pg:dbname=hydra;host=$PGHOST;port=$PGPORT"
628631
629632
popd >/dev/null
630633
'';

foreman/start-hydra.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/bin/sh
22

33
# wait for postgresql to listen
4-
while ! pg_isready -h $(pwd)/.hydra-data/postgres -p 64444; do sleep 1; done
4+
while ! pg_isready ; do sleep 1; done
55

6-
createdb -h $(pwd)/.hydra-data/postgres -p 64444 hydra
6+
createdb hydra
77

88
# create a db for the default user. Not sure why, but
99
# the terminal is otherwise spammed with:
1010
#
1111
# FATAL: database "USERNAME" does not exist
12-
createdb -h $(pwd)/.hydra-data/postgres -p 64444 "$(whoami)" || true
12+
createdb "$(whoami)" || true
1313

1414
hydra-init
1515
hydra-create-user alice --password foobar --role admin

foreman/start-postgres.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22

33
initdb ./.hydra-data/postgres
4-
exec postgres -D ./.hydra-data/postgres -k $(pwd)/.hydra-data/postgres -p 64444
4+
exec postgres -D ./.hydra-data/postgres -k $(pwd)/.hydra-data/postgres -p ${PGPORT}

0 commit comments

Comments
 (0)