Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NAnt Web Application Deployment

Good day.

I'm trying to deploy a web application using NAnt. It is current zipped using the NAnt ZIP task.

I can try calling MSDeploy from NAnt but I don't think MSDeploy was written for such deployments.

I can also try using NAnt task.

Does anybody have suggestions as to what approach can save me the most time?

like image 241
user85479 Avatar asked Dec 06 '25 06:12

user85479


1 Answers

Using the aspnet compiler is the simplest way and gets you access to all cl arguments which is not available on nant tasks. Not sure why it's so.

Here's what I do

<property name="aspnetcomplier" value="C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe" />
  <target name="deploy">
    <mkdir dir="${output.dir}" />
    <exec program="${aspnetcomplier}">
      <arg value="-v" />
      <arg value="/trunk" />
      <arg value="-p" />
      <arg value="${source.dir}\Root" />
      <arg value="-f" />
      <arg value="${output.dir}" />
    </exec>
  </target

Nothing complicated.Works like a charm.
P.S. Dont forget to do a iisreset /stop and /start

  <target name="stop.iis" >
    <servicecontroller action="Stop" service="w3svc" timeout="10000" verbose="true" />
  </target>

  <target name="start.iis" >
    <servicecontroller action="Start" service="w3svc" timeout="10000" verbose="true" />
  </target>
like image 127
Cherian Avatar answered Dec 09 '25 20:12

Cherian