我设置了一个 bonobo 服务器来存储我们的中央 git 存储库。此服务器只能通过 http 访问,而不是 ssh。
在 teamcity 中,我添加了我的 VCS Root :
- 类型:Git
- 获取网址:https://myserver/myrepo.git
- 默认分支:master
- 认证方式:密码
- 用户名:我的用户名
- 密码:我的密码
- git "C:\Program Files\Git\bin\git.exe" 的路径
如果我点击“测试连接”,我就成功了。
在我的构建配置中,我选择了带有结帐模式“自动在代理上”的 VCS,我必须使用它,这样我才能推送到 azure Web 应用程序 git 部署。
我在 teamcity 代理服务器上设置了“git config --global credential.helper cache”,以便它存储凭据。
当我运行我的构建配置时,构建就像这样
[12:06:11]Checking for changes
[12:06:11]Publishing internal artifacts
[12:06:11]Clearing temporary directory: D:\TeamCity\buildAgent2\temp\buildTmp
[12:06:11]Checkout directory: D:\TeamCity\buildAgent2\work\2eb5ccde57e744c6
[12:06:11]Updating sources: agent side checkout (running for 9s)
[12:06:11]Using vcs information from server. Reason: no revision information for buildtype SecureImmo and checkout directory D:\TeamCity\buildAgent2\work\2eb5ccde57e744c6 on agent
[12:06:11]Will perform clean checkout. Reason: Checkout directory was cleaned up with errors
[12:06:11]Cleaning D:\TeamCity\buildAgent2\work\2eb5ccde57e744c6
[12:06:11]Failed to delete empty directory: D:\TeamCity\buildAgent2\work\2eb5ccde57e744c6
[12:06:11]VCS Root: Bonobo (running for 9s)
[12:06:11]revision: e76753d88051cb2d3372714d4295c11513c208b8
[12:06:11]Cleaning D:\TeamCity\buildAgent2\work\2eb5ccde57e744c6
[12:06:11]Failed to delete empty directory: D:\TeamCity\buildAgent2\work\2eb5ccde57e744c6
[12:06:11]The .git directory is missing in 'D:\TeamCity\buildAgent2\work\2eb5ccde57e744c6'. Running 'git init'...
[12:06:12]Commit 'e76753d88051cb2d3372714d4295c11513c208b8' is not found in repository. Running 'git fetch'...
如果我没有在代理上自动设置,那么我无法将我的项目推送到 azure web 应用程序的 git。