postgresql-action icon indicating copy to clipboard operation
postgresql-action copied to clipboard

Add parameter for optional DB init scripts.

Open danielweller-swp opened this issue 5 years ago • 6 comments

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.

danielweller-swp avatar Oct 30 '19 08:10 danielweller-swp

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 :(

hank-cp avatar Nov 19 '19 21:11 hank-cp

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 :(

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.

danielweller-swp avatar Nov 20 '19 12:11 danielweller-swp

@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 avatar Nov 21 '19 07:11 danielweller-swp

@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.

hank-cp avatar Nov 21 '19 17:11 hank-cp

as repo maintainer is not here can we maintain another repo?

shirshak55 avatar Jan 06 '20 03:01 shirshak55

@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.

danielweller-swp avatar Jan 07 '20 12:01 danielweller-swp