Closed mikey179 closed 8 years ago
I've added an environment variable called g10k_cachedir
, which overwrites the default /tmp/ directory for all cache directories.
https://github.com/xorpaul/g10k/commit/38b7da514c7715df4ab1292984c0c5b3f494ef94
You can test it here: https://github.com/xorpaul/g10k/releases/tag/v0.1.1
Using
$ export g10k_cachedir=/tmp/foobar ; g10k -puppetfile -debug
...
2016/02/08 14:57:23 DEBUG Using as cachedir environment variable g10k_cachedir: /tmp/foobar/
...
I will add a parameter to the puppetfile mode that will do the same, but Docker mainly uses environment variables to solve stuff like this.
Tested this, changing the cache dir with the environment variable works nicely. Unfortunately, it doesn't solve the problem with the hard link inside the container. I tried to use a cache directory on the same volume as external_modules
, but even then I get this error. I suspect it has to do with the underlying file system stuff of Docker, and can't be solved directly in g10k. Of course, being able to change the cache dir is still a useful option.
I suspect the only way to make this error go away is not to hardlink when copying the modules from cache dir to target dir, but I don't know what the consequences for g10k would be.
Okay, I added a new parameter -docker
availabe for testing here https://github.com/xorpaul/g10k/releases/tag/v0.1.3 (source https://github.com/xorpaul/g10k/commit/7f00124261604bdc88973fe6a0fb898821b04220)
$ g10k -puppetfile -docker
This uses mv
instead of cp --link
which should work in your Docker environment.
This also purges the Forge cache directory after each run, which isn't important for a Docker environment, but it frees up disk space and is necessary that a following non puppetfile run without the -docker
parameter works.
Maybe the option shouldn't be called -docker
, as it must be used on OS X as well. Detected this while working on #11 - OS X' cp command doesn't know the --link
and --archive
options (see man).
Other than that it seems to work fine.
Okay, I renamed it to -usemove
When using
g10k -puppetfile
inside a Docker container the final copy from /tmp to module dir causes problems when both are on different devices, e.g. because the module dir is mounted into the Docker container. This could be solved when the local forge directory could be influenced via configuration or command line argument.For reference, here is the output of a
g10k -puppetfile
run in such a container: