postgresql-action
postgresql-action copied to clipboard
Add parameter for optional DB init scripts.
The PostgreSQL docker image allows mounting a volume containing SQL scripts that are executed when the docker image is started. This PR exposes this functionality in the Github Action.
hi @danielweller-swp, pwd is not working with this docker in docker case. The first part of -v must be the host path, which should be /home/runner/work/{repo}/{repo} in this case.
It costs me a whole damn day to figure it out :(
hi @danielweller-swp,
pwdis not working with this docker in docker case. The first part of-vmust be the host path, which should be/home/runner/work/{repo}/{repo}in this case.It costs me a whole damn day to figure it out :(
Thanks, you are completely correct - this is not working as intended. Sorry for the inconvenience it caused! I'll try to figure out whether this can be handled in a generic way and update this PR.
@hank-cp: Thanks again for your input. I fixed the action to correctly compute the path and added a test for the action (in form of a Github Action workflow).
@danielweller-swp Cool and THX~
Not sure when this PR will be accepted, but I actually would like to add some more changes upon your PR to support inject postgres.conf.
According to postgres docker's doc
$ docker run -d --name some-postgres -v "$PWD/my-postgres.conf":/etc/postgresql/postgresql.conf postgres -c 'config_file=/etc/postgresql/postgresql.conf'
could do the job.
as repo maintainer is not here can we maintain another repo?
@shirshak55: I've created a fork on my account, I guess I can maintain this for a while.
@hank-cp: Feel free to submit your PR there.