Tiller 0.7.7 and file globals

Updated:

Note : This page may contain outdated information and/or broken links; some of the formatting may be mangled due to the many different code-bases this site has been through in over 20 years; my opinions may have changed etc. etc.

Thanks to a nice suggestion by kydorn in issue #18, the file datasource supports a global_values: block, so you can now create defaults per environment (and use the defaults datasource to provide a default for all environments). This is available in Tiller 0.7.7, which was just released.

This means if you have a common value that you want available to all templates (but may be different in each environment), you don’t have to repeat the definition for every template. In conjunction with the defaults datasource, it lets you do things like :

  • Use the defaults datasource to specify default values for all environments
  • Use global_values: for defaults specific to each environment
  • Optionally over-write them with local config: values on templates

There’s an example now in the README.md which demonstrates this :

data_sources: [ 'defaults','file','environment' ]
template_sources: [ 'file' ]

defaults:
  global:
    per_env: 'This is the default across all environments'

environments:

  development:
    global_values:
      per_env: 'This has been overwritten for the development environment'

    test.erb:
      target: test.txt
      config:
        per_env: 'This has again been overwritten by the local value just for this template'

  production:

    # This will get the value from the defaults module, as we don't specify a
    # per-environment or any per-template value overwriting it.
    test.erb:
      target: test.txt

Hopefully that will cut down the size of some config files, and also introduce some more flexibility to your Tiller setup. Thanks again, Kydorn, for the suggestion!

As always, please feel free to send any other ideas/suggestions/bugs my way - either through the GitHub issue tracker, email, or now through the new Gitter.im chatroom.