rafecolton / docker-builder

Docker builder builds Docker images from a friendly config file.
MIT License
80 stars 11 forks source link

panic when parsing `git:` tag from non git directory #37

Closed rafecolton closed 10 years ago

rafecolton commented 10 years ago

If we try to run builder from somewhere else, bad things happen:

What should we do instead? Since we're shelling out to git, we should probably use the Bobfile's directory as top instead of $PWD

rafecolton commented 10 years ago

In fact, since this is going to be used in a multi-threaded application, we probably shouldn't be using $PWD anywhere in the code

meatballhat commented 10 years ago

I say go full paranoid mode. Chdir to a known, controlled location every time a location-sensitive operation needs to happen. Is that what you meant by avoiding $PWD?

rafecolton commented 10 years ago

@meatballhat not quite, but along those same lines, yes. I mean taking it one step further and not relying on $PWD for anything. Instead, I intend to make all location-sensitive operations relative to either the builder's workdir or relative to the Bobfile for a given repo. I guess using $PWD in this context feels a little like using a singleton in an environment in which there should be multiple instances.

rafecolton commented 10 years ago

Turns out this was simpler than I anticipated: https://github.com/modcloth/docker-builder/pull/39