vaultcheckin nant task only works when called alone
Posted: Wed Sep 19, 2007 10:17 am
My build script attempts to do the following tasks using Vault nant tasks
1. Remove all working folder associations (so that different branches can be checked out to the same physical path)
2. Checkout exclusively the source tree
3. Checkin the changes made by the build script, undoing unchanged files
4. Label Vault with the build number
The problem I am having is that when called as part of my overall build task, the nant checkin task does nothing. It does not report an error, it just performs no operations. What's odd is that when I call that task directly, it performs exactly as expected.
Here is my overall build task:
Here are the relevant Vault tasks:
When I call nant using the EnterpriseBuild task, I get the following output from the CommitChanges_Vault4 task:
If I open the Vault client app, I can see all the files still checked out to the build user, with the changes listing in the pending change set.
When I call nant using the CommitChanges_Vault4 task (after running the build, so all the files are still checked out to my build user) It outputs this:
1. Remove all working folder associations (so that different branches can be checked out to the same physical path)
2. Checkout exclusively the source tree
3. Checkin the changes made by the build script, undoing unchanged files
4. Label Vault with the build number
The problem I am having is that when called as part of my overall build task, the nant checkin task does nothing. It does not report an error, it just performs no operations. What's odd is that when I call that task directly, it performs exactly as expected.
Here is my overall build task:
Code: Select all
<target name="EnterpriseBuild" description="Base Checkbox Survey Server build">
<property name="install.dbsetuptablesfilename" value="${path.buildroot}\CheckboxWeb\install\installscripts\Checkbox_Tables.sql"/>
<property name="install.dbsetupsprocsfilename" value="${path.buildroot}\CheckboxWeb\install\installscripts\Checkbox_StoredProcedures.sql"/>
<property name="install.dbsetuptviewsfilename" value="${path.buildroot}\CheckboxWeb\install\installscripts\Checkbox_Views.sql"/>
<call target="IncrementBuildNumber"/>
<property name="path.destination" value="C:\Builds\Checkbox Survey Server\${version.new}" />
<mkdir dir="${path.destination}"/>
<call target="StartLog"/>
<call target="CleanBuildPath"/>
<call target="RemoveWorkingFolders_Vault4"/>
<call target="GetLatest_Vault4"/>
<call target="UpdateBuildNumber"/>
<call target="BuildDBScripts"/>
<call target="BuildDeveloperSolution"/>
<call target="CompileDeveloper"/>
<call target="CopyToDestination"/>
<call target="CommitBuildNumber"/>
<call target="CommitChanges_Vault4"/>
<call target="LabelVersion_Vault4"/>
<call target="EndLog"/>
</target>
Code: Select all
<target name="RemoveWorkingFolders_Vault4" description="Removes all existing working folder associations">
<echo>
Removing working folder associations from Vault 4.04 with these settings:
username: ${vault.user}
password: ${vault.pw}
host: ${vault.host}
repository: ${vault.repository}
path: ${vault.path}
destination:${path.buildroot}
</echo>
<!-- List the working folder associations in an XML file -->
<vaultsetloginoptions user="${vault.user}" password="${vault.pw}" URL="${vault.host}" repository="${vault.repository}" />
<vaultgetworkingfolderassignments append="false" identifier="v${version.new}" outputfile="${vault.workingfolderfile}" />
<!-- Read the xml file's working folder paths into a delimited string -->
<xmllist file="${vault.workingfolderfile}" property="vault.workingfolderlist" delim="," xpath="/root/vaultgetworkingfolderassignments/listworkingfolders/workingfolder/@reposfolder" />
<!-- Loop each repository path in the list and remove its working folder association -->
<foreach item="String" in="${vault.workingfolderlist}" delim=" ," property="vault.currentrepositorypath">
<vaultremoveworkingfolder repositoryFolderPath="${vault.currentrepositorypath}" />
<echo message="Removed working folder association from ${vault.currentrepositorypath}"/>
</foreach>
<echo message="Done!"/>
</target>
Code: Select all
<target name="GetLatest_Vault4" description="Gets the latest version of all files from Vault 4.04">
<echo>
Getting latest from Vault 4.04 with these settings:
username: ${vault.user}
password: ${vault.pw}
host: ${vault.host}
repository: ${vault.repository}
path: ${vault.path}
destination:${path.buildroot}
</echo>
<vaultsetloginoptions user="${vault.user}" password="${vault.pw}" URL="${vault.host}" repository="${vault.repository}" />
<vaultsetworkingfolder repositoryFolderPath="${vault.path}" diskPath="${path.buildroot}" createDiskPath="true" />
<vaultcheckout checkoutExclusive="true">
<vaultfileset>
<include name="${path.buildroot}" />
</vaultfileset>
</vaultcheckout>
<echo message="Done!"/>
</target>
Code: Select all
<target name="CommitChanges_Vault4" description="Commits build changes to Vault 4.04">
<echo>
Committing changes to Vault 4.04 with these settings:
username: ${vault.user}
password: ${vault.pw}
host: ${vault.host}
repository: ${vault.repository}
path: ${vault.path}
destination:${path.buildroot}
</echo>
<vaultsetloginoptions user="${vault.user}" password="${vault.pw}" URL="${vault.host}" repository="${vault.repository}" />
<vaultsetworkingfolder repositoryFolderPath="${vault.path}" diskPath="${path.buildroot}" createDiskPath="false" />
<vaultcheckin unchanged="UndoCheckout" localCopy="Leave">
<vaultfileset>
<include name="${path.buildroot}" />
</vaultfileset>
</vaultcheckin>
<echo message="Done!"/>
</target>
Code: Select all
<target name="LabelVersion_Vault4" description="Labels the build files in Vault 4.04">
<echo>
Labeling Vault 4.04 with these settings:
username: ${vault.user}
password: ${vault.pw}
host: ${vault.host}
repository: ${vault.repository}
path: ${vault.path}
destination:${path.buildroot}
</echo>
<vaultsetloginoptions user="${vault.user}" password="${vault.pw}" URL="${vault.host}" repository="${vault.repository}" />
<vaultlabel objectPath="${vault.path}" labelName="v${version.new}" />
<echo message="Done!"/>
</target>
Code: Select all
CommitChanges_Vault4:
[echo]
[echo] Committing changes to Vault 4.04 with these settings:
[echo] username: build
[echo] password: build
[echo] host: http://darwin/VaultService
[echo] repository: Main Repository
[echo] path: $/trunk/Checkbox/Src
[echo] destination:C:\Development\Checkbox\Src
[echo]
[echo] Done!
When I call nant using the CommitChanges_Vault4 task (after running the build, so all the files are still checked out to my build user) It outputs this:
Code: Select all
CommitChanges_Vault4:
[echo]
[echo] Committing changes to Vault 4.04 with these settings:
[echo] username: build
[echo] password: build
[echo] host: http://darwin/VaultService
[echo] repository: Main Repository
[echo] path: $/trunk/Checkbox/Src
[echo] destination:C:\Development\Checkbox\Src
[echo]
[vaultcheckin] Preparing data to begin transaction
[vaultcheckin] Beginning transaction
[vaultcheckin] Check in $/trunk/Checkbox/Src/ExceptionLogTool/AssemblyInfo.c
<snip>
[vaultcheckin] Undoing check out of file $/trunk/Checkbox/Src/Prezza.Framework.C
ommon/Tests/TestFixture.cs
[echo] Done!
BUILD SUCCEEDED