Security Zen is great for managing security, but what about analyzing and deploying the rest of your metadata? If you are familiar with the Force.com Migration Tool, there is a simple addition you can make that provides great insight into the details of your deployments.
Force.com Migration Tool has some pre-requisites such as Java and Ant and then you have to install the Force.com Migration tool itself. This process can be a little painful, but you only have to do it once and I promise it is worth the effort. Details can be found here.
For each environment, add a "retrieve" command in your build.xml file along with an appropriately named folder. For example, for a DEV environment, you can add a command like the following that retrieves data into a "DEV_Compare" folder:
<target name="getDEVCompare">
<delete dir="DEV_Compare" />
<mkdir dir="DEV_Compare" />
<sf:retrieve
username="${dev.username}"
password="${dev.password}"
serverurl="${dev.serverurl}"
retrieveTarget="DEV_Compare"
unpackaged="DeploySource/package.xml"
/>
</target>
Note that the variables "${dev.XXXXXXX}" need to be defined in your build.properties file.
There also needs to be a package.xml file located in the DeploySource folder that defines what metadata will be compared/deployed. Instructions for the building the package.xml file can be found here.
Repeat setting up a retrieve command for each environment that stores data into an appropriately named folder.
You can use any diff tool that has a command line interface and can perform folder comparisons. I like KDiff3 because it does a nice three-way folder comparison.
Steps 1 and 2 are standard Force.com Migration tool, and step 3 is your favorite comparison tool, but now comes a little magic...
Create a text file with the extension .bat such as "Compare_DEV_STG_PRD.bat" and store it in the same directory as your build.xml file.
The contents of this bat file will have commands to retrieve the same metadata from each environment and automatically launch the comparison tool. For example:
cmd /c ant getDEVCompare
cmd /c ant getSTGCompare
cmd /c ant getPRDCompare
"C:\Program Files\KDiff3\kdiff3.exe" ".\DEV_Compare" ".\STG_Compare" ".\PRD_Compare" --cs "UnfoldSubdirs=1" --cs "ShowLineNumbers=1" --cs "ShowIdenticalFiles=0"
What does this do?
The payoff? Whenever you want to compare/deploy metadata between environments, you can just populate your package.xml file and then double click the bat file. You quickly get a detailed comparison showing which files have changes AND the details of the changes within these files.
Do it once and I guarantee you will use it before every deploy!
This website uses cookies. By continuing to use this site, you accept our use of cookies.