Page 1 of 1

Vault & NAnt - So what DOES trigger a login?

Posted: Tue Mar 18, 2008 3:25 pm
by tficken
Hi,

Let me apologize in advance if this is a basic question. I'm trying to determine if I'm being thick, or if I have some type of connection issue. I'm using NAnt with the goal of getting the latest code from Vault and then creating a new build. I've got:

<?xml version="1.0"?>
<project name="ATARI" default="clean">
<property name="devdir" value="c:/automated build/dev"/>
<property name="debug" value="true"/>

<target name="clean">
<attrib normal="true" verbose="true">
<fileset>
<include name="${devdir}"/>
</fileset>
</attrib>

<delete dir="${devdir}"/>
</target>

<target name="getlatest" depends="clean">
<!--Load the Vault NAnt tasks-->
<loadtasks path="c:/automated build/vault tasks/bin" verbose="true" />
<!--Set the login options: username, password, and server url-->
<vaultsetloginoptions user="tficken" password="password" URL="https://vaultserver" repository="software"/>
<!--Connect to Software repository-->
<vaultsetrepository repositoryName="software"/>
</target>

</project>
If I Ctrl+click on the URL in the file from VS, I go to that location. Ditto if I set the location to something like Yahoo on the web. When I run the above build with Nant, I get the following error when the VaultSetRepository task is included:
System.Exception: The connection to the server failed: server cannot be contacted or uses a protocol that is not supported by this client. Unable to connect to https://rspi-vault. No server was found at the specified URL. Please verify your network settings using the Options dialog under the Tools menu in the Vault GUI Client. Web Exception: The request failed with HTTP status 404: Not Found. -
--> System.Exception: Unable to connect to https://rspi-vault. No server was found at the specified URL. Please verify your network settings using the Options dialog under the Tools menu in the Vault GUI Client. Web Exception: The request failed with HTTP status 404: Not Found.
at VaultClientNetLib.VaultConnection.Login(String strURLBase, String strUserLogin, String strPassword)
at VaultClientOperationsLib.ClientInstance.Login(String urlbase, String username, String password)
at VaultClientIntegrationLib.ServerOperations.Login(AccessLevelType altCommand, Boolean bAllowAuto, Boolean bSaveSession)
--- End of inner exception stack trace ---
at VaultClientIntegrationLib.ServerOperations.Login(AccessLevelType altCommand, Boolean bAllowAuto, Boolean bSaveSession)
at VaultClientIntegrationLib.ServerOperations.Login()
at NAnt.Contrib.Tasks.SourceGearVault.VaultTask.CheckLoggedIn()
at NAnt.Contrib.Tasks.SourceGearVault.vaultsetrepository.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Target.Execute()
at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies)
at NAnt.Core.Project.Execute()
at NAnt.Core.Project.Run()
The help info specifically says that VaultSetLoginOptions DOESN'T trigger a login. So I suspect that my problem is that I cannot set a repository if I'm not logged into Vault. If that is the case, what DOES trigger a login to Vault??

Thanks in advance!

Tara

Posted: Wed Mar 19, 2008 8:32 am
by shannon
Your URL should be of the form https://VaultServer/VaultService. Also, if you set the repository in the vaultsetloginoptions task, then you shouldn't also call vaultsetrepository. There are some nant examples here: http://support.sourcegear.com/viewtopic.php?t=8019 (if you haven't already found those).

You set the login options in the beginning of your script. After that, the tasks will handle login (and repository setting, if you specified a repository) as needed.

thanks

Posted: Wed Mar 19, 2008 10:40 am
by tficken
Got it now! Thanks much!

Tara