Build Azure deployment package in NAnt
I'm looking into migrating our system to Windows Azure. Currently we have an automated process that builds everything and packages it up into msi's for us using Team City and NAnt.
Is there any way to build the packages needed for deployment - I don't n开发者_如何学Ceed it to deploy, just create the package.
Thanks
Stu
There is: with MSBuild
msbuild AzureProject.ccproj /target:publish /p:Configuration=Release;TargetProfile=ReleaseProfile
will create an Azure package using the "Release" configuration and "ReleaseProfile" Azure profile.
Note, if your Azure project is in a solution folder (say "folder") you'll need e.g.
msbuild folder\AzureProject.ccproj /target:publish /p:Configuration=Release;TargetProfile=ReleaseProfile
Yes, it is straight forward to add some commands to your NANT file to package your application.
See this page for examples and a reference:
http://msdn.microsoft.com/en-us/library/windowsazure/gg432988.aspx
Here's what I use:
<echo message="Publishing Azure Package"/>
<exec program="${MSBuildPath}" workingdir="${BuildDirectory}" commandline="Products\SportsCommanderV3\SportsCommanderCloudService\SportsCommanderCloudService.ccproj /t:CorePublish /p:Configuration=Release /p:OutDir=${ReleaseDirectory}\${BuildLabel}\Azure\"/>
The OurDir part used to publish the package over to a release directory on our server, but as of the Azure 1.5 SDK that seemed to stop working, so now I add this:
<copy todir="${ReleaseDirectory}\${BuildLabel}\Azure\Publish">
<fileset basedir="${BuildDirectory}\Products\SportsCommanderV3\SportsCommanderCloudService\bin\Release\app.publish">
<include name="**/*"/>
</fileset>
</copy>
精彩评论