mirror of
https://github.com/bonfire-networks/bonfire-app.git
synced 2024-05-04 02:08:44 +00:00
feat: add just postgres init for nix
This commit is contained in:
parent
f9e594ae24
commit
a39cd3202b
10
justfile
10
justfile
|
@ -559,7 +559,11 @@ db-pre-migrations:
|
||||||
secrets:
|
secrets:
|
||||||
@cd lib/mix/tasks/secrets/ && mix escript.build && ./secrets 128 3
|
@cd lib/mix/tasks/secrets/ && mix escript.build && ./secrets 128 3
|
||||||
|
|
||||||
# start or stop nix postgres server
|
# Start or stop nix postgres server
|
||||||
nix-pg pg_cmd:
|
@nix-pg pg_cmd:
|
||||||
@pg_ctl -D ${PGDATA} -l ${PGDATA}/all.log -o "--unix_socket_directories='${PGDATA}'" $pg_cmd
|
pg_ctl -D ${PGDATA} -l ${PGDATA}/all.log -o "--unix_socket_directories='${PGDATA}'" $pg_cmd
|
||||||
|
|
||||||
|
# Initialize postgres database. Only need to run the first time!
|
||||||
|
nix-pg-init: (nix-pg "start")
|
||||||
|
createdb ${PGDATABASE}
|
||||||
|
createuser -dlsw ${PGUSERNAME}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
erlang_release = "24";
|
erlang_release = "24";
|
||||||
|
|
||||||
# remove dotenv variables POSTGRES_* to use these!
|
# remove dotenv variables POSTGRES_* to use these!
|
||||||
PGUSERNAME = "postgres";
|
PGUSERNAME = "bonfire";
|
||||||
PGDATABASE = "bonfire_db";
|
PGDATABASE = "bonfire_db";
|
||||||
PGPASS = "password";
|
PGPASS = "password";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue