zonkyio / embedded-postgres

Java embedded PostgreSQL component for testing
Apache License 2.0
341 stars 41 forks source link

Changing the directory where the initdb is unpacked #120

Closed pal548 closed 8 months ago

pal548 commented 8 months ago

Hello, we're facing an issue running build with Jenkins, Cannot run program "/tmp/embedded-pg/PG-cb4c5b55707c145bb9aa5d2425d52f0c/bin/initdb": error=2, No such file or directory

Due to security reasons we can not write to /tmp, so is it possible to change the directory where the initdb is unpacked?

tomix26 commented 8 months ago

Hi @pal548, thanks for the question. You can change the directory either by using the ot.epg.working-dir system property or by passing additional configuration in form of EmbeddedPostgres.Builder and setting the overrideWorkingDirectory property to any path you want.

pal548 commented 8 months ago

It works, thanks a lot.