remove cfp-db-init, fix cfp-sqitch

iac
Brian Hicks 2019-04-02 19:41:01 -05:00
parent 14e005f3b7
commit 392eb1bca8
2 changed files with 1 additions and 12 deletions

View File

@ -27,18 +27,8 @@ pkgs.stdenv.mkDerivation {
#!/usr/bin/env bash
set -euo pipefail
cd $out/lib/cfp-db
exec sqitch \$@
exec ${pkgs.sqitchPg}/bin/sqitch \$@
EOF
chmod +x $out/bin/cfp-sqitch
# cfp-db-init
cat > $out/bin/cfp-db-init <<EOF
#!/usr/bin/env bash
${pkgs.postgresql}/bin/createdb -e cfp
${pkgs.postgresql}/bin/psql -d cfp -c 'CREATE ROLE postgraphile LOGIN;'
${pkgs.postgresql}/bin/psql -d cfp -c 'GRANT ALL PRIVILEGES ON DATABASE cfp TO postgraphile;'
echo 'database initialized. Now set the application password for postgraphile.'
EOF
chmod +x $out/bin/cfp-db-init
'';
}

View File

@ -18,7 +18,6 @@ in
installPhase = ''
mkdir -p $out/bin
ln -s ${db}/bin/cfp-db-init $out/bin/cfp-db-init
ln -s ${db}/bin/cfp-sqitch $out/bin/cfp-sqitch
ln -s ${backend}/bin/cfp-backend $out/bin/cfp-backend
'';