You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the past (for a non-grunt build system) I've had the HTML file be handlebars templated and modified the context variable that gets passed into that template based on an environment variable. Some Googling came across grunt-env and grunt-preprocess that seem like they could handle this.
On simpler projects, I've just had different HTML files for each environment, but that gets hairy as the number of environments grows and your HTML file gets more complicated. You end up with a lot of duplicate code, so probably not advisable.
the issue with chef is it would need to know how to construct the file. since it's static html it needs to be injected into the file at build time. a build command that pulls them from a file (which can be stored in a chef recipe) would work.
having a settings.ini file which is used sounds good and then chef could overwrite this in our CI environment as part of the build/deploy process. bonus points if it can read from a file specified by BALANCED_ENV which selectively overrides the default settings which means less duplication.
the other benefit of pulling in from a static file is it will make it easier for people to replicate the build process locally.
What is the best way to replace configuration variables into the html files as part of the build process so we can switch analytics accounts etc?
The text was updated successfully, but these errors were encountered: