Closed OnkelTem closed 6 years ago
Since mount.bind
is a relative path on the host I haven't found a use case yet that required it to support variables yet. I've been trying to only add variables to fields as they are needed.
Do you have a use case that requires it to support variables?
Yes, sure. Imagine that git clone someurl <project>
command is wrapped into a docker container. So that you could run it with random destination.
Here comes two problems:
1) There is no way to pass <project>
directly, instead we should use an environment variable:
$ PROJECT=project dobi fetch-project
2) It's not gonna interpolate that:
mount=project-destination
bind: ./projects/${PROJECT}
path: /workdir
P.S. Note that docker-compose suffers from the same limitation. They don't have any documentation about what is allowed for interpolation and what is not. My trials show that it doesn't interpolate volume's local paths.
I've updated this issue to be a feature request. Would you be interested in adding it? The changes needs to be made here:
by adding another resolver.Resolve
. The resolved value would need to be passed to fs.ExpandUser()
before storing it on conf.Bind
.
and the docs are here: https://github.com/dnephin/dobi/blob/692a02f32162d8e59894c8c9a2f181b1b74ec714/docs/source/variables.rst
That's great!
Daniel, do you mean that I can update the docs?
I'm asking if you would be interested in making the code change, and also update the docs.
This is in 0.11
According to documentation variables interpolation isn't supported. I wonder why this is so?