theory / tap-parser-sourcehandler-pgtap

TAP::Parser::SourceHandler::pgTAP
http://search.cpan.org/dist/TAP::Parser::SourceHandler::pgTAP
10 stars 13 forks source link

docker documentation wrong/missing #36

Open xenoterracide opened 4 years ago

xenoterracide commented 4 years ago

first, it'd be nice if the docs mentioned the docker distribution, it's not at the top of the dockerhub list (I'll remove mine), the dockerhub documentation is wrong, the link leads to a 404

docker pull itheory/pg_prove
curl -L https://git.io/fpgAk -o pg_prove && chmod +x pg_prove
./pg_prove --help

also the docker documentation should probably mention the environment variables... I wonder if it would be better to have a sample docker-compose file documented instead of this pg_prove script, since you can run docker-compose up and if it's a container that just exits it will exit when it's done.

maybe something like this

version: '3.7'
services:
  pg_prove:
    image: itheory/pg_prove
    command: --ext .sql --recurse
    volumes:
      - ./:/repo
      - ${PGSERVICEFILE:-./pg_service.conf}:/root/.pg_service.conf
      - ${PGPASSFILE:-./pgpass}:/root/.pgpass
    environment:
      PGSERVICE: ${PGSERVICE:-localhost}
    network_mode: host

one last thing, why is the script mounting $HOME? this seems... strange, and maybe a bad idea in certain CI environments

theory commented 4 years ago

Fixed the broken git.io link in d6f18fc; totally forgot about it when I renamed master to main.

theory commented 4 years ago

It mounts home so that it can read your .pgpass and .pgservice files.

theory commented 3 years ago

@xenoterracide I think there could be a use for a docker compose file, but I don't understand the one you have here. The script mounts home so that it can read all of your Postgres config files as if you were running it on your machine, rather than in a container. It's a way to make execution feel as close to native as possible.

That said, I'm not familiar with docker-compose; maybe it'd be a much better fit! Does it let one map files on the host machine into the container on run? Also, it would have to support a _lot_more environment variables; see the complete list.