Giter Site home page Giter Site logo

Comments (4)

mahmoudimus avatar mahmoudimus commented on June 11, 2024

chef

Sent from my iPhone

On Apr 18, 2013, at 1:23 PM, Marshall Jones [email protected] wrote:

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?


Reply to this email directly or view it on GitHub.

from balanced-dashboard.

kleinsch avatar kleinsch commented on June 11, 2024

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.

from balanced-dashboard.

mjallday avatar mjallday commented on June 11, 2024

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.

from balanced-dashboard.

mjallday avatar mjallday commented on June 11, 2024

Completed by @kleinsch

from balanced-dashboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.