It would add a lot of flexibility being able to specify global environment variables, that apply only to a specific environment, but to all templates.
Like any other global variable, it could be overriden by template-specific variables.
Hi, Thanks for the suggestion. Do you have an example for how you'd like to see it working ?
Sure, for example:
data_sources: [ 'defaults', 'file' ]
template_sources: [ 'file' ]
variable: 'default value'
variable: 'default value for development environment'
variable: 'local value for template.erb'
variable: 'default value for staging environment'
This is specially useful when we are sharing the same variable between multiple templates and different environments. If we need the same variable to be consistent in an environment, we currently have to define it for each template that uses it (and for each environment)
Right, I see. Let me have a think about this, and I'll see if I can add something like that for you.
Just committed b24073d , which I think will do what you're after. Take a look at the test fixtures:
And the tests themselves, which show the expected output : https://github.com/markround/tiller/blob/feature/per_env_global/features/file_globals.feature
It looks pretty much like what you were after. It was a very simple change, I just made the file datasource pick up a new global_values: block, and you can also use the defaults datasource to specify a default.
Is this OK for you ?
Yup, that would do the trick! Thank you so much for this fast response :)
Great :) OK, I'll add some notes to the documentation, tidy it up a bit and get a release out ASAP (probably tomorrow). I'll give due credit for the suggestion in the Changelog, would you like me to reference your GitHub ID/website/blog/whatever ?
You could use the handler if you want, but there is no need. I'm actually using Tiller at work for creating a hierarchical configuration for docker containers and I just was too lazy to learn ruby and change it myself. Thank you so much for your work!
Resolved by v0.7.7. An updated gem will be built and released shortly. Thanks again for the suggestion!