gpt4 book ai didi

continuous-integration - 使用 Teamcity REST API 创建 vcs root

转载 作者:行者123 更新时间:2023-12-04 08:41:56 25 4
gpt4 key购买 nike

我正在尝试使用 Teamcity REST API 创建一个 VCS Root。关注 REST Documentation ,我将在 XML 下方发布到 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>

这将创建 VCS 根,但密码属性仍为空。我尝试使用 http://TeamcityServer/httpAuth/app/rest/vcs-roots/VCSId/properties/password 显式设置密码,但即使这样似乎也没有为 VCS 根设置密码。

最佳答案

所以我在 Jetbrains Developer Community 上找到了答案.这是因为出于安全原因,Teamcity 对 SVN 使用“secure:svn-password”,对 Perforce 使用“secure:passwd”,而不是简单的密码。所以我将我的 XML 更改为以下内容:

<property name="secure:svn-password" value="testpwd"/>

关于continuous-integration - 使用 Teamcity REST API 创建 vcs root,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23508329/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com