~vpzom/lotide

lotide: developers helper script for starting postgres container v1 REJECTED

Matthias Beyer: 1
 Add script to boot up prepared postgres docker container

 1 files changed, 20 insertions(+), 0 deletions(-)
#376078 .build.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~vpzom/lotide/patches/16113/mbox | git am -3
Learn more about email & git

[RFC PATCH lotide 1/1] Add script to boot up prepared postgres docker container Export this patch

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
---
 scripts/boot-pg-dev.sh | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 scripts/boot-pg-dev.sh

diff --git a/scripts/boot-pg-dev.sh b/scripts/boot-pg-dev.sh
new file mode 100644
index 0000000..031dcea
--- /dev/null
+++ b/scripts/boot-pg-dev.sh
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

CONTAINER_NAME=lotide-pg-dev
DB_PW=password
DB_USER=dbuser
DB_NAME=lotidedev

docker run \
    --name "${CONTAINER_NAME}" \
    -e POSTGRES_PASSWORD=${DB_PW} \
    -p 5432:5432 \
    -m 512m \
    -d \
    --rm \
    postgres

sleep 2
docker exec -it "${CONTAINER_NAME}" psql -U postgres -c "CREATE USER ${DB_USER} PASSWORD '${DB_PW}' SUPERUSER CREATEDB INHERIT LOGIN"
docker exec -it "${CONTAINER_NAME}" psql -U postgres -c "CREATE DATABASE ${DB_NAME}"

-- 
2.29.2