Externalizing Build Configuration

While PowerShell is great, I still do a lot of my build automation using plain old batch scripts when it comes to managing my SharePoint development workflow.  Because I do my development outside of my SharePoint environment (develop on my host OS but SharePoint is in my guest OS), it requires some nifty batch scripts to keep the flow tight as no plugins or tools support this development model (dunno why…).

One of the challenges is making it easy to externalize environmental configuration information on a developer-by-developer basis.

In the past, I’ve relied on having team members create environment variables, but I decided to try out an external configuration file.

It worked out great 😀

The following script reads a file and sets four variables:

And the file looks like this:

Now I can use the variables like so:

It even works when calling to psexec:

The best part is that each developer only has to create the text file and all of the environment specific information (like the target SharePoint server) are configured in one tiny file, allowing the automation scripts to be ready for any developer.

You may also like...