I am trying to create a VCS Root using Teamcity REST API. Following the REST Documentation, I am posting below XML to http://TeamcityServer/httpAuth/app/rest/vcs-roots

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<vcs-root name="TestVCS" vcsName="svn" modificationCheckInterval="5" href="/httpAuth/app/rest/vcs-roots/id:TestVCS">
    <project id="TestProject" name="&lt;Root project&gt;" href="/httpAuth/app/rest/projects/id:TestProject"/>
    <properties>
        <property name="externals-mode" value="externals-full"/>
        <property name="labelingMessage" value="Labeled automatically by TeamCity"/>
        <property name="labelingPatterns" value="trunk=&gt;tags"/>
        <property name="svn-config-directory" value="C:\Windows\system32\config\systemprofile\AppData\Roaming\Subversion"/>
        <property name="svn-use-default-config-directory" value="true"/>
        <property name="url" value="https://svn-uat.net/TestProject"/>
        <property name="user" value="testuser"/>
        <property name="password" value="testpwd"/>
        <property name="working-copy-format" value="1.6"/>
    </properties>
    <vcsRootInstances href="/httpAuth/app/rest/vcs-root-instances?locator=vcsRoot:(id:TestVCS)"/>
</vcs-root>

This creates VCS root but the password property remains empty. I tried setting password explicitly using http://TeamcityServer/httpAuth/app/rest/vcs-roots/VCSId/properties/password , but even this doesn't seem to set the password for the VCS root.

有帮助吗?

解决方案

So I found the answer on Jetbrains Developer Community. This is because Teamcity for security reasons uses "secure:svn-password" for SVN and "secure:passwd" for Perforce rather than simple password. So I changed my XML to something like:

<property name="secure:svn-password" value="testpwd"/>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top