无法 运行 git 从 Team City 命令行构建步骤获取
Cannot run git fetch from Team City command line build step
我在 Team City (9.0.2 build 32195) 构建配置中有一个简单的命令行构建步骤,它只调用:
git fetch
但是当我 运行 构建配置时它只是挂起。 运行:
git log
工作正常。知道为什么 git fetch
在 git log
工作时挂起吗?
编辑:挂起问题似乎是由 TC 在 运行ning git fetch
时等待凭据引起的。因此,解决方案是以某种方式为用户 运行 存储 git 的凭据。
您可以在此处查看 git credential helper 是否可以缓解此问题:它会缓存密码并允许任何需要身份验证的 git 命令获取这样的密码。
参见“Managing Remotes / Caching your GitHub password in Git Caching your GitHub password in Git”(因为 TeamCity 服务器使用 jgit,而不是直接 git)
不,TeamCity 可能不支持凭据助手,因为 noted in this thread。
As a workaround you can clone repository via SSH and use default private key authentication method for example. In this case TeamCity will know nothing about your SSH key.
Or you can upload an SSH key into TeamCity and use it. In this case it is stored under TeamCity data dir, but not in the settings.
我在 Team City (9.0.2 build 32195) 构建配置中有一个简单的命令行构建步骤,它只调用:
git fetch
但是当我 运行 构建配置时它只是挂起。 运行:
git log
工作正常。知道为什么 git fetch
在 git log
工作时挂起吗?
编辑:挂起问题似乎是由 TC 在 运行ning git fetch
时等待凭据引起的。因此,解决方案是以某种方式为用户 运行 存储 git 的凭据。
您可以在此处查看 git credential helper 是否可以缓解此问题:它会缓存密码并允许任何需要身份验证的 git 命令获取这样的密码。
参见“Managing Remotes / Caching your GitHub password in Git Caching your GitHub password in Git”(因为 TeamCity 服务器使用 jgit,而不是直接 git)
不,TeamCity 可能不支持凭据助手,因为 noted in this thread。
As a workaround you can clone repository via SSH and use default private key authentication method for example. In this case TeamCity will know nothing about your SSH key.
Or you can upload an SSH key into TeamCity and use it. In this case it is stored under TeamCity data dir, but not in the settings.