From 855f8d255c7ac9dd2952be1fe65e739eb7240f9f Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Mon, 24 Oct 2022 16:24:43 +0100 Subject: [PATCH] new build scripts --- create-db.sh | 22 ++++++++++++++++++++++ create-pod.sh | 12 ++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 create-db.sh create mode 100644 create-pod.sh diff --git a/create-db.sh b/create-db.sh new file mode 100644 index 0000000..657d2aa --- /dev/null +++ b/create-db.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +first=false +if [[ ! -d ./postgres ]]; then + mkdir ./postgres + $first=true + +fi +podman run -d \ + --name pleroma-db \ + --pod pleroma-pod \ + -e POSTGRES_USER=pleroma \ + -e POSTGRES_PASSWORD=CHANGHEME \ + -e POSTGRES_DB=pleroma \ + -v ./postgres:/var/lib/postgresql/data \ + postgres:12.1-alpine + +if [[ $first == true ]]; then + podman exec -i pleroma-db psql -U pleroma -c "CREATE EXTENSION IF NOT EXISTS citext;" + exit 0 +fi + diff --git a/create-pod.sh b/create-pod.sh new file mode 100644 index 0000000..ffe097d --- /dev/null +++ b/create-pod.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +mkdir ./uploads +mkdir ./static +touch config.exs +chown -R 911:911 ./uploads + +podman pod create \ + --name pleroma-pod \ + -p 4000:4000 + +bash ./create-db.sh