test: Update process-compose-flake

Also wrap in startScript because 'command' no longer does that.
This commit is contained in:
Sridhar Ratnakumar 2023-06-21 10:00:45 -04:00
parent 1a0cd58b08
commit b7c1a05eff
2 changed files with 23 additions and 16 deletions

View File

@ -258,19 +258,26 @@ in
'';
# DB process
${cfg.name} = {
command = ''
set -x
export PATH="${postgresPkg}"/bin:$PATH
export LOCKDIR="/tmp"
postgres -k $LOCKDIR -D ${cfg.dataDir}
'';
depends_on."${cfg.name}-init".condition = "process_completed_successfully";
# SIGINT (= 2) for faster shutdown: https://www.postgresql.org/docs/current/server-shutdown.html
shutdown.signal = 2;
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";
};
${cfg.name} =
let
startScript = pkgs.writeShellApplication {
name = "start-postgres";
text = ''
set -x
export PATH="${postgresPkg}"/bin:$PATH
export LOCKDIR="/tmp"
postgres -k "$LOCKDIR" -D ${cfg.dataDir}
'';
};
in
{
command = startScript;
depends_on."${cfg.name}-init".condition = "process_completed_successfully";
# SIGINT (= 2) for faster shutdown: https://www.postgresql.org/docs/current/server-shutdown.html
shutdown.signal = 2;
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability.restart = "on_failure";
};
};
};
}

View File

@ -54,11 +54,11 @@
},
"process-compose-flake": {
"locked": {
"lastModified": 1687211949,
"narHash": "sha256-PKZhjtrLkN1+AuWiv+m+n0tL5xcrjwXRdAR6pS+UwxI=",
"lastModified": 1687298948,
"narHash": "sha256-7Lu4/odCkkwrzR8Mo+3D+URv4oLap8WWLESzi/75eb0=",
"owner": "Platonic-Systems",
"repo": "process-compose-flake",
"rev": "1483bd7fecd59254d8531b6c3202f3f765b22468",
"rev": "5bdb90b85642901cf9a5dccfe8c907091c261604",
"type": "github"
},
"original": {