A Heroku Buildpack to make Config Vars available during Slug compilation.
Create a .compile-time-env
file in the root of your App/repository.
Add Config Var names you want to export (one per line):
$ cat .compile-time-env
SOME_ENV_VAR
# lines starting with # are considered comments, and will be skipped
ANOTHER_VAR
Add this Buildpack as the first Buildpack in your App. Or, at least before other Buildpacks that need the Config Vars.
$ heroku buildpacks:add --index=1 stevenharman/compile-time-env --app=<YOUR-APP-NAME>
On the next deploy the Config Vars specified in the .compile-time-env
file will be available in the Slug compilation phase.
This work is licensed under MIT License.
Copyright (c) 2022 Steven Harman