This article is a work in progress, or documents a feature that is not yet released to all users. This article is unlisted. Only those with the link can access it.
Table of Contents
This Heroku Labs feature adds experimental support for having an app’s config vars be present in the environment during slug compilation.
Features added through Heroku Labs are experimental and subject to change.
user-env-compile has been deprecated and replaced by the ENV_DIR argument to buildpack compile scripts. Buildpacks maintained by Heroku have been updated to use this new argument by default to export the app’s the environment as needed during builds. Maintainers of 3rd party buildpacks in use by apps with
user-env-compile enabled have been notified to make updates for this change. Apps with user-env-compile currently enabled are unaffected, but strongly encouraged to disable this feature.
Making an app’s config vars present during the build allows for build-time optimizations to run in an environment that more closely resembles the runtime environment. This also allows config vars to be used to configure the build.
For example, because Rails 3.1 couples configuration with initialization, the Rails 3.1
assets:precompile task performs much more reliably in the presence of the runtime config.
Changing config vars will not cause an app’s slug to be recompiled. This could lead to unexpected inconsistency if a slug was compiled with a different set of config vars than those it is run against. Pushing new code will cause the slug to be recompiled against the current set of config vars.
$ heroku labs:enable user-env-compile -a myapp -----> Enabling user-env-compile for myapp... done WARNING: This feature is experimental and may change or be removed without notice.
$ heroku labs:disable user-env-compile -a myapp -----> Disabling user-env-compile for myapp... done