Baur Build Configuration: Environment Variables

Since version 2.0 simplesurance/baur supports the use of environment variables in the configuration. Now building with baur is a lot more flexible!

Advantages:

  1. Security: Easy way to inject connection strings, passwords, and other sensitive information without configuration changes. These should never be stored in source control!
  2. Testing: When testing the build process, a different database and upload targets can be used to avoid mixing test data with production information.
  3. Resilience to change: Anything which may change can now be adjusted easily. This makes it easier to run the build process in CI and on a development machine.

The following snippet reads the postgres connection string from an environment variable:

postgresql_url = "{{ env POSTGRESQL_CONNECTION }}"

The documentation is available here, but I have to admit that it took me some attempts to find the correct syntax.

Angela Evans

Senior Software Engineer at Diligent in Christchurch, New Zealand