Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

three-consulting/epoc-db

Repository files navigation

epoc-db

epoc mock postgresql db with seed data

run locally

docker run --rm -p 5432:5432 ghcr.io/three-consulting/epoc-db:latest

edit schema or data

In case of new migrations, a plain postgresql db should be run with the new epoc application. The migrations for this mock db can be generated by running an empty database and the latest backend, and then generating the db dump.

  • Run an empty db
docker run --rm --name postgres \
  -e POSTGRES_USER=user \
  -e POSTGRES_PASSWORD=password \
  -e POSTGRES_DB=epoc \
  -p 5432:5432 \
  postgres:14-alpine
  • Run the backend from the latest image (or from intellij idea)
docker run --rm --name epoc-backend \
  -e SPRING_DATASOURCE_USERNAME=user \
  -e SPRING_DATASOURCE_PASSWORD=password \
  -e SPRING_DATASOURCE_URL=jdbc:postgresql://postgres/epoc \
  -e SPRING_PROFILES_ACTIVE=dev \
  --link postgres \
  registry.heroku.com/epoc-backend-testing/web:latest
  • Generate the database dump
docker exec postgres pg_dump -U user -d epoc -O -x > db.sql

When editing only data, edit data.sql by hand.

edit secret data

  1. Decrypt
gopass show 3/epoc/GPG | gpg -q --batch --yes --decrypt-files --passphrase-fd 0 *.gpg
  1. Modify decrypted sql files
  2. Encrypt
for filename in $( find -name "*-secrets.sql" ); do \
  gpg --batch --yes --symmetric --passphrase $(gopass show 3/epoc/GPG) --cipher-algo AES-256 $filename; \
done

About

epoc postgresql db with seed data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •