forked from lix-project/hydra
Use pg_ctl for readiness check
Using `pg_ctl status` is more reliable than relying checking an open port via netcat.
This commit is contained in:
parent
45ac8e0cbc
commit
d9d58b7055
3 changed files with 5 additions and 5 deletions
|
@ -295,7 +295,7 @@
|
||||||
|
|
||||||
runHydra = pkgs.callPackage ./run-hydra.nix {};
|
runHydra = pkgs.callPackage ./run-hydra.nix {};
|
||||||
devShell = pkgs.hydra.overrideAttrs (old: {
|
devShell = pkgs.hydra.overrideAttrs (old: {
|
||||||
buildInputs = old.buildInputs ++ [ pkgs.foreman pkgs.netcat ];
|
buildInputs = old.buildInputs ++ [ pkgs.foreman ];
|
||||||
shellHook = old.shellHook + ''
|
shellHook = old.shellHook + ''
|
||||||
export HYDRA_HOME="src/"
|
export HYDRA_HOME="src/"
|
||||||
mkdir -p .hydra-data
|
mkdir -p .hydra-data
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{ foreman, mkShell, hydra, netcat, postgresql95 }:
|
{ foreman, mkShell, hydra, postgresql95 }:
|
||||||
{ doCheck ? true }:
|
{ doCheck ? true }:
|
||||||
mkShell {
|
mkShell {
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
foreman (hydra.overrideAttrs (_: { inherit doCheck; })) netcat postgresql95
|
foreman (hydra.overrideAttrs (_: { inherit doCheck; })) postgresql95
|
||||||
];
|
];
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# wait for postgresql to listen
|
# wait for postgresql to be up
|
||||||
while ! nc -z localhost 64444; do sleep 1; done
|
while ! pg_ctl -D $(pwd)/.hydra-data/postgres status; do sleep 1; done
|
||||||
|
|
||||||
createdb -h $(pwd)/.hydra-data/postgres -p 64444 hydra
|
createdb -h $(pwd)/.hydra-data/postgres -p 64444 hydra
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue