Skip to content

jlazo/postgresql-docker

 
 

Repository files navigation

Running PostgreSQL and Flyway in Docker

If you want to see this repo without tests, only with Flyway, you can look at this version.

https://github.com/tomaszbartoszewski/postgresql-docker/tree/f626784c8c4e974430bed19c434f318d3da7e807

To run PostgreSQL in Docker and apply schema using flyway, you have to run:

./run_in_docker.sh

Press Ctrl+C when you no longer need db to run. To remove instance from your local machine run:

./destroy_docker_instance.sh

If you want to read more about Flyway schema migration in this repo, check this blog post.

If you want to read how I'm using pgTAP look at this blog post.

Running pgTAP tests

If you want to run tests in Docker, you have to build docker image first.

make build_test_image

Then you can run tests which are in tests directory.

make tests

Used materials

For this repo I used other's work, you can find it here:

docker-library/postgres#306 (comment)

https://github.com/walm/docker-pgtap

https://medium.com/engineering-on-the-incline/unit-testing-postgres-with-pgtap-af09ec42795

https://medium.com/engineering-on-the-incline/unit-testing-functions-in-postgresql-with-pgtap-in-5-simple-steps-beef933d02d3

pgTAP documentation https://pgtap.org/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PLpgSQL 48.2%
  • Shell 40.9%
  • Dockerfile 8.7%
  • Makefile 2.2%