Sunday, December 5, 2010

Automated configuration tool (get me out of *.config hell!)

I have been living in config file hell for a while, its a case of no one really owning the the release engineer role/release process at my work. This has caused a lot of troubles when promoting builds (DEV -> QA -> STG -> PROD)  Out of this hell I have written a tool for making bulk changes to XML based configuration files.

The tool, I called it ConfigDriver.exe uses XPath to find and modify XML based files. Any XPath query that returns a single node will work.  It uses a "|" delimited file as the change source and can be configured two ways.

File layout definition:
1) To change a Single node value
File Name Path | XPath Query | Node Value

2) To change an attribute value
File Name Path | XPath Query | Attribute Name | Attribute Value

Below are some sample calls
..\..\sampleFile.xml|/ConfigDriver/SampleOne|Change one node value
..\..\sampleFile.xml|/ConfigDriver/SampleTwo/Attrib[@name='item1']|description|Change one specific attribute value
..\..\sampleFile.xml|/ConfigDriver/SampleThree[@name='SpecificNone']|Change one node value by name

Here is a link to the program ConfigDriver.exe



Post a Comment