mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-10-01 01:36:06 -04:00
launch and use postgres in a container whilst using mx-tester
This commit is contained in:
parent
a0da2e1145
commit
8771ca936d
@ -2,6 +2,11 @@ name: mjolnir
|
||||
|
||||
up:
|
||||
before:
|
||||
- docker run --rm --network $MX_TEST_NETWORK_NAME --name mjolnir-test-postgres --domainname mjolnir-test-postgres -e POSTGRES_PASSWORD=mjolnir-test -e POSTGRES_USER=mjolnir-tester -e POSTGRES_DB=mjolnir-test-db -d -p 127.0.0.1:8082:5432 postgres
|
||||
# Wait until postgresql is ready
|
||||
- until psql postgres://mjolnir-tester:mjolnir-test@localhost:8082/mjolnir-test-db -c ""; do echo "Waiting for psql..."; sleep 1s; done
|
||||
# Make table in postgres
|
||||
- psql postgres://mjolnir-tester:mjolnir-test@localhost:8082/mjolnir-test-db -c "CREATE TABLE mjolnir (local_part VARCHAR(255), owner VARCHAR(255), management_room TEXT)"
|
||||
# Launch the reverse proxy, listening for connections *only* on the local host.
|
||||
- docker run --rm --network host --name mjolnir-test-reverse-proxy -p 127.0.0.1:8081:80 -v $MX_TEST_CWD/test/nginx.conf:/etc/nginx/nginx.conf:ro -d nginx
|
||||
- cp mjolnir-registration.yaml $MX_TEST_SYNAPSE_DIR/data/
|
||||
@ -15,6 +20,7 @@ run:
|
||||
|
||||
down:
|
||||
finally:
|
||||
- docker stop mjolnir-test-postgres || true
|
||||
- docker stop mjolnir-test-reverse-proxy || true
|
||||
|
||||
modules:
|
||||
|
@ -32,7 +32,7 @@ export class MjolnirAppService {
|
||||
public readonly mjolnirManager: MjolnirManager = new MjolnirManager();
|
||||
|
||||
public constructor() {
|
||||
this.dataStore = new PgDataStore("foo bar baz");
|
||||
this.dataStore = new PgDataStore("postgres://mjolnir-tester:mjolnir-test@localhost:8082/mjolnir-test-db");
|
||||
new Api("http://localhost:8081", this).start(9001);
|
||||
this.bridge = new Bridge({
|
||||
homeserverUrl: "http://localhost:8081",
|
||||
|
Loading…
Reference in New Issue
Block a user