Skip to content

Instantly share code, notes, and snippets.

@davidroberts63
Created April 9, 2013 21:32
Show Gist options
  • Save davidroberts63/5349599 to your computer and use it in GitHub Desktop.
Save davidroberts63/5349599 to your computer and use it in GitHub Desktop.
Sample Nant build file for use with MSBuild to package a Web Application. Some detail were found on Octopus Deploy around the OctoPack tool
<!-- This is from a Nant File with the following properties defined
msbuild.target = Debug | Release
scratch.path = Path\for\some\temporary\folder\for\build\to\go\to
publish.path = Path\where\you\want\the\resulting\zip\or\package\to\end\up
Be sure the OutDir ends with a slash (escaped in this case) otherwise msbuild complains.
OutputPath must NOT have a trailing slash.
WebUI = This is just what I have in the sample, change it to whatever you want for the web ui stuff to go to. This is where your configs and Views will get put, then the bins under that.
-->
<msbuild project="THE-WEB-PROJECT-FOLDER\THE-WEB-PROJECT.csproj">
<property name="Configuration" value="${msbuild.target}" readonly="true" />
<property name="Platform" value="Any CPU" readonly="true" />
<property name="WebProjectOutputDir" value="..\${scratch.path}\WebUI" />
<property name="OutDir" value="..\${scratch.path}\WebUI\bin\\" />
<property name="OutputPath" value="..\${scratch.path}\WebUI\bin" />
<property name="Targets" value="ResolveReferences;_CopyWebApplication" />
</msbuild>
<zip zipfile="${publish.path}\THE-WEB-PROJECT.zip">
<fileset basedir="${scratch.path}\WebUI">
<include name="**/*" />
</fileset>
</zip>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment