sqitchers / docker-sqitch

Docker Image packaging for Sqitch
MIT License
35 stars 39 forks source link

Figure out in which directory to mount as '/repo' #1

Closed pau4o closed 5 years ago

pau4o commented 5 years ago

By default we mount current working directory (as before). When inside GIT project we will mount it's top level directory. When environment variable SQITCH_FOLDER (analogous to sqitch configuration 'core.top_dir') is set then we use it's content as relative to GIT top level directory and mount it as '/repo'

theory commented 5 years ago

I don't want to assume that everyone uses Git. It might make sense to add support for a $SQITCH_ROOT variable, although when you use Sqitch itself, it always assumes that the current directory is the working directory --- that is, where it expects to find a sqitch.conf file.

So I guess I'm talking myself out of even that. What are you getting in this proposal that you get by running Sqitch itself locally?

pau4o commented 5 years ago

My intent was to be able to run sqitch commands from any folder inside GIT repository.

Useful part is that we can stay in every folder inside GIT project on host system and inside docker container we always will be in proper folder.

I already integrated proposed changes in our work-flow replacing usage of https://hub.docker.com/r/matteofigus/docker-sqitch/ (which is too big 397 MB compressed size) and find it useful (even I tend to stay in folder with sqitch.conf).

For users of other VCS there is no harm as default value is pwd.

Feel free to reject my PR if it still bothers you.

Once again - thank you for great work.

theory commented 5 years ago

It may be because I have yet to build a Docker image for distributing a Sqitch project that I don't really follow the use-case here, but Sqitch always wants to be in the directory with a sqitch.conf, and I'm not super clear on why one wouldn't just cd into the proper folder before execution. May well revisit once I have that experience, though. Thanks!