mbucc / shmig

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

error when cwd is read only #55

Closed srghma closed 5 years ago

srghma commented 5 years ago

With

docker-compose

  migrator:
    image: mkbucc/shmig:latest
    entrypoint: '' # i hate people that use custom entrypoints
    command: /bin/true # do nothing on `docker-compose up`
    working_dir: /migrations
    environment:
      TYPE:     postgresql
      LOGIN:    app_admin
      PASSWORD: app_admin_pass
      HOST:     postgres
      PORT:     5432
      DATABASE: gb_test
    volumes:
      - ../../migrations:/migrations:ro # READ-ONLY!!!, if i make it rw - error will dissappear 
      - ../../scripts/waitforit:/bin/waitforit:ro
      - ../../scripts/wait-for-postgres:/bin/wait-for-postgres:ro

makefile

feature_tests_dev_db_migrate:
    docker-compose \
        -p "$(PROJECT_NAME)_feature_tests_dev" \
        -f docker/feature_tests_dev.yml \
        run --rm migrator sh -c '\
        /bin/waitforit -host=$$HOST -port=$$PORT -timeout=10 && \
        DBNAME=postgres://$$LOGIN:$$PASSWORD@$$HOST:$$PORT/$$DATABASE /bin/wait-for-postgres && \
        shmig -m /migrations -C always migrate'

I'm gettirng error

/bin/shmig: line 169: 332874447.1.out: Read-only file system
srghma commented 5 years ago
FROM mkbucc/shmig:latest

RUN apk add --no-cache curl && \
  curl --header 'Accept: application/vnd.github.v3.raw' --output /bin/shmig --location https://raw.githubusercontent.com/mbucc/shmig/260a6aa0d9259e602fa497e9e42390df83a467f4/shmig

worked for me

mbucc commented 5 years ago

Thanks for all your input, it all looks good at first glance. I'll take a look this weekend.

srghma commented 5 years ago

this project needs travis ci and ability to run tests through docker-compose

I didn't run tests

mbucc commented 5 years ago

Just last night, I was looking at acme.sh as a good place to copy an approach from. If you have another suggestion, please attach a link.

mbucc commented 5 years ago

this project needs travis ci

Done. :)