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.
- Extract build output zip files
- Copy extracted files to file server
- Install DLLs into GAC
- 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.
SET EXTRACT_LOC=\fileserverDevDEPLOYABLE_APPS Build.Dev.20090807.2
echo Extracting build output zip…….
c:7z.exe x %BUILD_OUTPUT_ZIP% -o%EXTRACT_LOC%
echo Zip file extracted. Press any key to copy _shared folder
xcopy %EXTRACT_LOC%_SHARED %FILESERVER_PATH% _Shared /E
echo All files are pushed out. Press any key to install 3rd Party DLLs to %WEBSERVER%…
FOR %%a in (%EXTRACT_LOC%LibGAC3rdParty*.dll) DO %PSTOOL_PATH% %WEBSERVER% -u suser -p password %GACUTIL_PATH% -if %%a
echo Emmis DLLs are installed successfully on %WEBSERVER%. Now restarting IIS…
%PSTOOL_PATH% %WEBSERVER% iisreset
echo YOU ARE DONE!!! Thanks to Shailesh creating this nice tool!!
If you have any question or having a problem running the above script, please leave a comment here.