mbucc / shmig

Database migration tool written in BASH.
BSD 3-Clause "New" or "Revised" License
458 stars 49 forks source link

Dockerizing #15

Closed synchrone closed 7 years ago

synchrone commented 7 years ago

I just needed a way to deploy a no-frills solution to run migrations.

ENV vars to .conf file conversion is added for docker-compose structuring

mbucc commented 7 years ago

@synchrone This is awesome in so many ways. Thanks.

mbucc commented 7 years ago

@synchrone I think Docker would be great for testing.

How hard is it to write a shell script that

  1. spins up a docker image with a database and shmig
  2. starts database if necessary
  3. runs a shmig migration, capturing stdout & stderr to two different files
  4. runs a shell script that verifies state

(I have very little experience with docker.)

synchrone commented 7 years ago

Regarding your usecase for testing: no, a docker container with both shmig AND the DB is probably not a good idea. This one is made from alpine (just enough linux for a container) and mysql\pgsql\sqlite clients only to run the migrations, not actually host the db.

In my usecase I have a docker-compose with pgsql as one container, and then shmig, which connects to it to run the migrations.

mbucc commented 7 years ago

Can you share your docker-compose script here? I have only played a little with docker, but I understood your suggestion and it should work fine.