epoc mock postgresql db with seed data
docker run --rm -p 5432:5432 ghcr.io/three-consulting/epoc-db:latest
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.
- Decrypt
gopass show 3/epoc/GPG | gpg -q --batch --yes --decrypt-files --passphrase-fd 0 *.gpg
- Modify decrypted sql files
- 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