Skip to main content

Posts

Showing posts with the label config

DevOps : Search and replace files with JSON dataset and template Engine

Today's code build & continuous deployment models are highly diverse thus leading to handwritten and complicated perl/awk/sed scripts. DevOps should come out of age old hand-crafted find and replace scripts with much modern template engines.               Of course template engines are available in wide variety. All enterprise configuration management (chef, puppet, ansible ) software are equipped with their own flavour of template engines and playbooks.  This article however concentrate on "Mustache" template  which is logicless template system and work on any text based data (Web pages, scripts, dataset, config files etc..)               The example below focusses on replacing dynamic text using a JSON dataset. Let's define terminologies Source :   Template Parent Directory with all files/directories +  dynamic variables in it Dataset :    JSON based self defining dataset to replace the above source(s) Params :    Extra parameters that are supplied (eg