views:

38

answers:

1

I have a NAnt script that does a build and deployment of an ASP.Net application.
This lives on a remote machine that many people log into to perform builds.
(this is not automated for various reasons that are irrelevant)

Upon success or failure of the Nant script, I have an email being sent out to a team distribution list, stating that the build was successful or failed. I would like to be able to list the name of the user who logged into the remote machine to run the build script in the text of the email.

Is this possible in NAnt? I am using the standard NAnt <mail> task to do the email.

+3  A: 

Check environment::get-user-name() function. It gets the user name of the person who started the current thread (nant process).

<mail 
  ...
  subject="Build run by ${environment::get-user-name()}" 
  ...
</mail>
Martin Vobr
This worked perfectly, thank you!
funkymushroom