aboutsummaryrefslogtreecommitdiff
path: root/justfile
diff options
context:
space:
mode:
Diffstat (limited to 'justfile')
-rw-r--r--justfile14
1 files changed, 9 insertions, 5 deletions
diff --git a/justfile b/justfile
index d1b7058..88c8152 100644
--- a/justfile
+++ b/justfile
@@ -2,7 +2,8 @@ PG_USER := "secduser"
PG_PASS := "p4ssw0rd"
PG_DB := "secd"
PG_PORT := "5412"
-PG_URL := "postgres://" + PG_USER + ":" + PG_PASS + "@host.docker.internal:" + PG_PORT / PG_DB
+PG_URL := "postgres://" + PG_USER + ":" + PG_PASS + "@0.0.0.0:" + PG_PORT / PG_DB
+PG_DOCKER_URL := "postgres://" + PG_USER + ":" + PG_PASS + "@host.docker.internal:" + PG_PORT / PG_DB
@run-debug:
RUST_BACKTRACE=1 cargo run $@
@@ -20,16 +21,19 @@ PG_URL := "postgres://" + PG_USER + ":" + PG_PASS + "@host.docker.internal:" + P
@start-postgres: _start_postgres start-spice
@migrate-spice:
- docker run --rm --add-host host.docker.internal:host-gateway --name spice_migrator authzed/spicedb migrate head --datastore-engine postgres --datastore-conn-uri "{{PG_URL}}"
+ docker run --rm --add-host host.docker.internal:host-gateway --name spice_migrator authzed/spicedb migrate head --datastore-engine postgres --datastore-conn-uri "{{PG_DOCKER_URL}}"
@start-spice: migrate-spice
- docker start spice || docker run -d --add-host host.docker.internal:host-gateway --name spice -p 50051:50051 -p 9090:9090 -p 8080:8080 -p 9443:8443 authzed/spicedb serve --grpc-preshared-key "sup3rs3cr3tk3y" --http-enabled --datastore-engine postgres --datastore-conn-uri "{{PG_URL}}"
+ docker start spice || docker run -d --add-host host.docker.internal:host-gateway --name spice -p 50051:50051 -p 9090:9090 -p 8080:8080 -p 9443:8443 authzed/spicedb serve --grpc-preshared-key "sup3rs3cr3tk3y" --http-enabled --datastore-engine postgres --datastore-conn-uri "{{PG_DOCKER_URL}}"
-@_start_postgres:
- docker start secddb || docker run -d --name secddb -e POSTGRES_PASSWORD={{PG_PASS}} -e POSTGRES_USER={{PG_USER}} -e POSTGRES_DB={{PG_DB}} -p {{PG_PORT}}:5432 postgres:13 -c log_statement=all
+@_start_postgres: apply-secd-tables
+ docker start secddb || docker run -d --name secddb -e POSTGRES_PASSWORD={{PG_PASS}} -e POSTGRES_USER={{PG_USER}} -e POSTGRES_DB={{PG_DB}} -p {{PG_PORT}}:5432 postgres:14 -c log_statement=all
@start-mailserver:
docker start mailhog || docker run -d --name mailhog -p 7180:8025 -p 25:1025 mailhog/mailhog:latest
+@apply-secd-tables:
+ sqlx migrate run --database-url {{PG_URL}} --source crates/secd/store/pg/migrations secd;
+
@clean:
docker rm -f spice secddb