I am very much new to the Continous Integration. Could anyone please let me know whether we could build a website using MSbuild?
You can build a Web Site project using the AspNetCompiler MSBuild task.
http://msdn.microsoft.com/en-us/library/ms164291.aspx
Your MSBuild file might look something like this:
<Project
xmlns = "http://schemas.microsoft.com/developer/msbuild/2003"
DefaultTargets = "PrecompileWeb">
<Target Name = "PrecompileWeb">
<AspNetCompiler
VirtualPath = "DeployTemp"
PhysicalPath = "C:\ccnet\myProject\WebSite"
TargetPath = "C:\ccnet\myProject\PreCompiled"
Force = "true"
Debug = "true"
Updateable = "true"/>
</Target>
</Project>
And then within your ccnet.config, you would add something like the following in the tasks block for your project:
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
<workingDirectory>C:\ccnet\myProject\</workingDirectory>
<projectFile>C:\ccnet\myProject\myproject.msbuild</projectFile>
<logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
</msbuild>
If you have an SLN file for the Web Site, then you can use the following command:
msbuild YourSolutionFile.sln
Yes, you can - even with a "website".
What you need to do is add the "Web Deployment Project" and set it up so it will grab all the files from the website, compile them, and using something like WiX, you can create an installer for the files to be able to easily deploy your web site and all its files needed to a customer's computer.
Marc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With