Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter for optional DB init scripts. #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add parameter for optional DB init scripts. #2

wants to merge 3 commits into from

Conversation

danielweller-swp
Copy link

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.

@hank-cp
Copy link

hank-cp commented Nov 19, 2019

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

@danielweller-swp
Copy link
Author

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.

- The `postgres init scripts` parameter now actually works.
- A test was added.
@danielweller-swp
Copy link
Author

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

@hank-cp
Copy link

hank-cp commented Nov 21, 2019

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

@shirshak55
Copy link

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

@danielweller-swp
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants