0
votes

I am trying to find a method to add a link to the email that is sent out after a build succeeds or fails. If the build fails, it would only show text stating "Build Not Published".

For example, the output of a successful build looks like this:

BUILD SUCCESSFUL
Project: MyProject.MyBuild
Date of build: 2015-04-21 05:00:00
Running Time: 00:21:50
Integration Request: Build (ForceBuild) Triggered from DailyBuild
Publish Path: //Server/Share/MyProject/PublishPath
Warnings: (###) Modifications since last build (#)

etc. From my config xml file for publishing, the destination path is passed in as an argument, the value is: $(SOURCE_REL_DIR). I looked through the ccnet.exe.config file, but it was not obvious how I can inject data here. I then looked at the header.xsl file and while I can inject text here, I am not certain how to pass in the custom value $(SOURCE_REL_DIR). Some values seem to read variables with @date, @buildtime

EDIT: I just realized that $(SOURCE_REL_DIR) is just a parent directory. I pass this to a powershell script that does the following:

  1. Determines the day of the week.
  2. Creates a new sub-folder named 'Bldyyyymmdd_hhmmss.

The full path looks like this: //Server/share/PublishPath/DayOfWeek/BldyyyyMMdd_hhmmss. So not only do I need to find a way to pass a value from ccnet to the header.xml but I also need to set a value from my publish powershell script.

1

1 Answers

0
votes

To pass a value from ccnet to the header use the merge feature in ccnet merge task. This will put the value into the ccnet buildlog and make it accessible from the xsl files like header.xsl. So you need an xml file to merge in. I'm sure you can generate a simple xml file with the value in it. Nant has ways to do this with xmlpoke. Or you could simply write a text file that is valid xml.

For example

<?xml version="1.0" encoding="utf-8" ?> 
<my_values>
 <publish_path value=""/>
</my_values>