forked from lix-project/hydra
Maximilian Bosch
3a4e0d4917
* justfile, inspired from Lix. * let foreman use the stuff from outputs, similar to what Lix does> * mess around with PERL5LIB[1] and PATH to get tests running locally. [1] I don't really know how `Setup` was found before tbh.
32 lines
919 B
Bash
Executable file
32 lines
919 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# wait for postgresql to listen
|
|
while ! pg_isready -h $(pwd)/.hydra-data/postgres -p 64444; do sleep 1; done
|
|
|
|
createdb -h $(pwd)/.hydra-data/postgres -p 64444 hydra
|
|
|
|
# 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
|
|
|
|
hydra-init
|
|
hydra-create-user alice --password foobar --role admin
|
|
|
|
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
|
|
|
|
<hydra_notify>
|
|
<prometheus>
|
|
listen_address = 127.0.0.1
|
|
port = 64445
|
|
</prometheus>
|
|
</hydra_notify>
|
|
EOF
|
|
fi
|
|
HYDRA_CONFIG=$(pwd)/.hydra-data/hydra.conf exec $(pwd)/outputs/out/bin/hydra-dev-server --port 63333 --restart --debug
|