2020-05-13 15:37:25 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-05-14 13:24:32 +00:00
|
|
|
# wait for postgresql to listen
|
|
|
|
while ! pg_isready -h $(pwd)/.hydra-data/postgres -p 64444; do sleep 1; done
|
2020-05-13 15:37:25 +00:00
|
|
|
|
2020-05-14 09:49:29 +00:00
|
|
|
createdb -h $(pwd)/.hydra-data/postgres -p 64444 hydra
|
2020-05-13 15:37:25 +00:00
|
|
|
|
2021-04-05 15:47:25 +00:00
|
|
|
# create a db for the default user. Not sure why, but
|
|
|
|
# the terminal is otherwise spammed with:
|
|
|
|
#
|
|
|
|
# FATAL: database "USERNAME" does not exist
|
|
|
|
createdb -h $(pwd)/.hydra-data/postgres -p 64444 "$(whoami)" || true
|
|
|
|
|
2020-05-13 15:37:25 +00:00
|
|
|
hydra-init
|
|
|
|
hydra-create-user alice --password foobar --role admin
|
|
|
|
|
2020-07-27 20:17:40 +00:00
|
|
|
if [ ! -f ./.hydra-data/hydra.conf ]; then
|
|
|
|
echo "Creating a default hydra.conf"
|
|
|
|
cat << EOF > .hydra-data/hydra.conf
|
|
|
|
# test-time instances likely don't want to bootstrap nixpkgs from scratch
|
|
|
|
use-substitutes = true
|
2021-08-18 19:26:04 +00:00
|
|
|
|
|
|
|
<hydra_notify>
|
|
|
|
<prometheus>
|
|
|
|
listen_address = 127.0.0.1
|
|
|
|
port = 64445
|
|
|
|
</prometheus>
|
|
|
|
</hydra_notify>
|
2020-07-27 20:17:40 +00:00
|
|
|
EOF
|
|
|
|
fi
|
2024-08-17 18:35:43 +00:00
|
|
|
HYDRA_CONFIG=$(pwd)/.hydra-data/hydra.conf exec $(pwd)/outputs/out/bin/hydra-dev-server --port 63333 --restart --debug
|