Getting Fortress repository using Nant

If you are having a problem using Fortress, post a message here.

Moderator: SourceGear

Post Reply
jlezon
Posts: 7
Joined: Wed Jun 25, 2008 7:06 am
Location: Peabody, MA USA

Getting Fortress repository using Nant

Post by jlezon » Wed Dec 03, 2008 10:35 am

I am green when it comes to automating builds with Cruise Control, Nant, and Fortress and need some assistance. I have configured Cruise Control to check for changes in Fortress and then call Nant to automate a build. The Cruise Control project completes successfully however, any new files or updated files are not being selected and included in the Nant build. I think I am close to getting this working but I believe my Nant target is not properly configured to pull new / updated files from the Fortress repository. Any assistance with this issue will be appreciated.

Environment Information:
Windows Server 2003 R2 SP2
Visual Studio 2005
.NET Framework 2.0
CruiseControl.Net 1.4.03524
Nant 0.85
Fortress 1.1.3.18336

CruiseControl.NET source control block:

Code: Select all

<sourcecontrol type="filtered">			
	<sourceControlProvider type="vault" autoGetSource="false" applyLabel="false">
		<executable>C:\Program Files\SourceGear\Fortress Client\vault.exe</executable>
		<username>UserName</username>
		<password>**********</password>
		<host>ServerName</host>
		<repository>Development</repository>
		<folder>$/</folder>
		<ssl>false</ssl>
		<historyArgs>-rowlimit 0</historyArgs>
	</sourceControlProvider>			
	<inclusionFilters>
		<pathFilter>
			<pattern>$/WebSiteName/**/*.*</pattern>
		</pathFilter>
		<pathFilter>
		        <pattern>$/CompanyName.*/**/*.*</pattern>
		</pathFilter>
	</inclusionFilters>
</sourcecontrol>
Nant Target:

Code: Select all


<property name="core.buildArea" value="D:\BuildArea"/>
<property name="core.source" value="${core.buildArea}\Source"/>
<loadtasks assembly="C:\DevelopmentTools\SourceGear\1.1.2.18185\bin\Nant.VaultTasks.dll"/>

<target name="get">
	<vaultsetloginoptions user="UserName" password="******" URL="http://ComputerName.CompanyName.na/VaultService/" repository="Development" />
	<vaultsetworkingfolder repositoryFolderPath="$/" diskPath="${core.source}" createDiskPath="true" />
		
	<vaultget>
	      <vaultfileset>
	        <include name="$/" />
	      </vaultfileset>
	      <getoptions Recursive="true" />
	    </vaultget>			
    </target>
Our Source repository is located on the C drive of our developer machines. I want to select the repository from Fortress and load it on the Development Server D drive in D:\BuildArea\Source and then build from that location. Again Cruise Control recognizes changes in Fortress but then when Nant builds new / updated files are not being moved.

Thanks,

Justin Lezon

shannon

Re: Getting Fortress repository using Nant

Post by shannon » Wed Dec 03, 2008 10:58 am

Before we get into the Nant part, is there a reason you don't want CC.Net to do the get automatically?

jlezon
Posts: 7
Joined: Wed Jun 25, 2008 7:06 am
Location: Peabody, MA USA

Re: Getting Fortress repository using Nant

Post by jlezon » Wed Dec 03, 2008 11:04 am

My reason is that I do not know how to configure it. I got this far with a large amount of frustration due to my lack of experience with CruiseControl/Nant/Fortress. I am willing to try anything suggested.

Thanks,

Justin Lezon

shannon

Re: Getting Fortress repository using Nant

Post by shannon » Wed Dec 03, 2008 11:47 am

That's fine. I just wanted to make sure before I suggested this.

Let's try having CC.Net do the get. Set the autoGetSource flag to true - this tells CC.Net to get the latest version of the source. Then add these two lines to your sourceControlProvider block:
<useWorkingDirectory>true</useWorkingDirectory>
<workingDirectory>D:/BuildArea/Source</workingDirectory>

The first line tells Fortress that you want this to be a working folder get, meaning it will store enough data to tell what is new so it can get only changed files. The second line tells Fortress where you want to put the files.

Comment out or remove the get in your Nant script.

Let me know if that works out better for you.

jlezon
Posts: 7
Joined: Wed Jun 25, 2008 7:06 am
Location: Peabody, MA USA

Re: Getting Fortress repository using Nant

Post by jlezon » Wed Dec 03, 2008 12:30 pm

You suggested fix solved the issue.

However, after reviewing the Nant script I realize the fix will only work for Automated builds. I tried to write my Nant script in way that would allow me to run the script through CruiseControl or through the command prompt calling it directly with Nant. When I execute this script through Nant it calls the get target I posted in my first message. That means I need to get the get target working as well. Any suggestions?

Thanks,

Justin Lezon

shannon

Re: Getting Fortress repository using Nant

Post by shannon » Wed Dec 03, 2008 1:39 pm

Try making the slashes in your disk path forward slashes.

Can you also confirm that the working folder is actually being set? (Run your script, then log into the gui client as the same user on the same machine.)

jlezon
Posts: 7
Joined: Wed Jun 25, 2008 7:06 am
Location: Peabody, MA USA

Re: Getting Fortress repository using Nant

Post by jlezon » Wed Dec 03, 2008 2:13 pm

That worked. Thank your for your assistance.

shannon

Re: Getting Fortress repository using Nant

Post by shannon » Wed Dec 03, 2008 2:21 pm

No trouble at all. Let us know if you run into anymore problems.

Post Reply