Automate Deployment Process

I have been deploying TFS build to our Dev and QA Test environment since one month. I was tired doing copy paste and installing that same damn DLLs into GAC every day. I was searching for good automated deployment script. I have ended up creating one .bat file that made my life easy.

I was doing following task to deployment build.

  1. Extract build output zip files
  2. Copy extracted files to file server
  3. Install DLLs into GAC
  4. Restart IIS

I want the script that does above tasks for me. I used 7-zip open source utility to extract my zip file and PsExec that lets you to execute the process like restart IIS,install DLLs on to remote server. It was pretty use to create the script than I thought it.

Here is the sample of my script that might help you.

RemoteDeployment.bat

cls

cd c:

@echo off

SET BUILD_OUTPUT_ZIP=\fileserverBuild_DropsBuild.Dev.20090807.2.zip

SET EXTRACT_LOC=\fileserverDevDEPLOYABLE_APPS Build.Dev.20090807.2

SET FILESERVER_PATH=\fileserverDev

SET WEBSERVER=\1.1.1.1

SET CMSSERVER=\1.1.1.1

SET GACUTIL_PATH=%WEBSERVER%c$gacutilgacutil.exe

SET PSTOOL_PATH=C:PsToolspsexec

echo ===================================================

echo Extracting build output zip…….

echo ===================================================

c:7z.exe x %BUILD_OUTPUT_ZIP% -o%EXTRACT_LOC%

echo ===================================================

echo Zip file extracted. Press any key to copy _shared folder

echo ===================================================

pause

xcopy %EXTRACT_LOC%_SHARED %FILESERVER_PATH% _Shared /E

echo ===================================================

echo All files are pushed out. Press any key to install 3rd Party DLLs to %WEBSERVER%…

echo ===================================================

pause

FOR %%a in (%EXTRACT_LOC%LibGAC3rdParty*.dll) DO %PSTOOL_PATH% %WEBSERVER% -u suser -p password %GACUTIL_PATH% -if %%a

echo

echo Emmis DLLs are installed successfully on %WEBSERVER%. Now restarting IIS…

%PSTOOL_PATH% %WEBSERVER% iisreset

echo =========================================================

echo YOU ARE DONE!!! Thanks to Shailesh creating this nice tool!!

echo =========================================================

pause

If you have any question or having a problem running the above script, please leave a comment here.

Posted in Microsoft Technology Tagged with: ,
4 comments on “Automate Deployment Process
  1. Chris says:

    It is nice to find a site about my interest. My first visit to your site is been a big help. Thank you for the efforts you been putting on making your site such an interesting and informative place to browse through. I’ll be visiting your site again to gather some more valuable information. You truly did a good job.

  2. Car Hire says:

    thanks for posting this.

  3. Thank you for the link! Unfortunately the 4th quadrant lights up before going into a full red ring, and gives me an E 74 error.

  4. aspirateur sans sac says:

    This is the first time i am reading your post and admire that you posted article which gives users lot of information regarding particular topic. Thanks for this share

Ads