Closed mancvso closed 9 years ago
Hey @mancvso
You can pass a comma separated list and then use strings.Split inside your compose.yml
.
Like this:
{{ range $link := split .links "," }}
- {{ $link }}
{{ end }}
Take a look at rocker/template for the documentation.
Also, rocker-compose dev branch now supports loading variables from YAML and JSON files, so it's possible to load more sophisticated data structures. It will be merged soon.
I may be missing something but... :crying_cat_face:
function "split" not defined
Ah, it's in the new version that is not released yet :( I will release it soon, by now you can install from HEAD:
brew tap grammarly/tap
brew install grammarly/tap/rocker-compose --HEAD
Don't forget to uninstall the old version first.
Compiled from source
rocker-compose 0.1.2 - 7d9dac2 (master) 2015-10-26_15:09_GMT
go version go1.5.1 linux/amd64
Everything works as expected. Closing now.
Currently we are trying to "link" more than one instance of a specific service (like mongodb) to a container defined in a YAML file similar to this one
But we cannot manage to make rocker-compose recognize the array of objects (in this case, the links). Those containers are started separately from this composition.
Does rocker-compose supports the passing of arrays?