From 1ef798e3992f090d26e48c244f10370195b6ca8d Mon Sep 17 00:00:00 2001 From: Ske Date: Tue, 28 Apr 2020 22:07:05 +0200 Subject: [PATCH] Add a script to spawn a local testing database --- README.md | 2 ++ scripts/run-test-db.sh | 5 +++++ 2 files changed, 7 insertions(+) create mode 100755 scripts/run-test-db.sh diff --git a/README.md b/README.md index 2a70039d..ad75dccb 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ $ docker-compose up -d * Create and fill in a `pluralkit.conf` file in the same directory as `docker-compose.yml` * Run the bot: `dotnet run --project PluralKit.Bot` +(tip: use `scripts/run-test-db.sh` to run a temporary PostgreSQL database on your local system. Requires Docker.) + # Building the docs The website and documentation are automatically built by GitHub Pages when pushed to the `master` branch. They use [Jekyll 3](https://jekyllrb.com), which requires [Ruby](https://www.ruby-lang.org) and [Bundler](https://bundler.io/). diff --git a/scripts/run-test-db.sh b/scripts/run-test-db.sh new file mode 100755 index 00000000..272d24e5 --- /dev/null +++ b/scripts/run-test-db.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +# Runs a local database in the background listening on port 5432, deleting itself once stopped +# Requires Docker. May need sudo if your user isn't in the `docker` group. +docker run --rm --detach --publish 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust postgres:alpine \ No newline at end of file