操作方法:Teamcity + GitHub
有人成功配置 Teamcity 以从 GitHub 进行监控、提取和构建吗?
我似乎不知道如何在哪里以及如何配置 Teamcity 的 SSH 密钥。 我将 Teamcity 作为系统服务在系统帐户下运行。 那么 Teamcity 将其 SSH 配置存储在哪里?
编辑
为了使其正常工作,我需要停止代理在系统帐户下运行。
Has anybody successfully configured Teamcity to monitor, extract, and build from GitHub?
I can't seem to figure how where and how to configure the SSH keys for Teamcity. I have Teamcity running as a system service, under a system account. So where does Teamcity stash its SSH configuration?
EDIT
To get this to work, I needed to stop the agent from running under a system account.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
好的...我已经开始在我的 Windows 服务器上工作了。 以下是我配置 TeamCity 4.5 Professional 所采取的步骤:
.BuildServer\plugins
; 编辑构建配置> 编辑 VCS 根配置屏幕,我选择“Git (JetBrains)”Ok... I got this to start working on my Windows server. Here are the steps I took to configure TeamCity 4.5 Professional:
.BuildServer\plugins
我获得了“默认私钥”来与 Windows 上以 SYSTEM 用户身份运行的代理一起使用。 对我来说,答案是将身份文件放在
C:\Windows\SysWOW64\config\systemprofile\.ssh\id_rsa
而不是
C:\Windows\System32\config\systemprofile\ .ssh\id_rsa
I got "Default Private Key" to work with agents running as the SYSTEM user on Windows. For me, the answer was having the identity file at
C:\Windows\SysWOW64\config\systemprofile\.ssh\id_rsa
instead of at
C:\Windows\System32\config\systemprofile\.ssh\id_rsa
您的问题特定于 SSH,但使用 HTTP over TLS 肯定更容易、更快捷,因为 GitHub 和 TeamCity 现在都支持 HTTP 身份验证。 此外,GitHub 还支持具有有限权限的个人 api 令牌,您可以配置这些权限根据您的喜好,或者根据您的喜好创建一个新用户。
请参阅下图,了解我们的 TeamCity 设置。
Your question is specific to SSH, but it is certainly easier and quicker to use HTTP over TLS, as GitHub and TeamCity both now support HTTP authentication. Furthermore, GitHub also supports personal api tokens with limited permissions, that you may configure to your liking, or create a new user if you prefer.
See image below of our TeamCity settings.
从 TeamCity 8.1 开始,官方支持 SSH 密钥管理,请阅读此文档: https://confluence.jetbrains.com/display/TCD9/SSH+Keys+Management
Since TeamCity 8.1, there is an official support for SSH key management, please read this docs: https://confluence.jetbrains.com/display/TCD9/SSH+Keys+Management
对于私钥,用户名必须为空。
for private key, username must be blank.
(这是对一个老问题的最新答案)
我使用 github/gitlab 和 teamcity 7 进行了基于 ssh 的构建,如下所示:
登录到 teamcity 计算机并使用 puttygen/ssh-keygen 生成 rsa 密钥对并保存openssh key 在某个合理的地方。
(问题 - 使用 puttygen?确保私钥采用 openssh 格式 - puttygen > conversions > export openssh key)
我建议您将私钥保存在
现在在 teamcity 中设置“默认私钥” - 创建一个文件
并在其中放置此:
登录到您的 gitlab/guthub 帐户并粘贴 openssh 公钥作为您的 teamcity 私钥。
您现在应该能够在 teamcity 中创建 git vcs 根目录,该根目录可以使用默认私钥来提取源代码。
(This is a up to date answer to an old question)
I got ssh based builds working with github/gitlab and teamcity 7 like this:
Log onto the teamcity machine and use puttygen/ssh-keygen to generate a rsa key pair and save the openssh key somewhere sensible.
(Gotcha - Using puttygen? Make sure the private key is in openssh format - puttygen > conversions > export openssh key)
I suggest you save the private key in
Now setup "default private key" in teamcity - create a file
And in it place this:
Login to your gitlab/guthub account and paste in the openssh public key for your teamcity private key.
You should now be able to create a git vcs root in teamcity that can use the default private key to pull your source.
您可能需要像这个这样的第三方插件
You may need a third party plugin like this
我不知道为什么,但选择
默认私钥
对我来说失败了。然后我选择
自定义私钥
,如下屏幕截图所示:用户名
字段必须为空。Passphrase
字段是您的私钥的密码(假设您已经在 git 中添加了该私钥的公钥。)
希望没有人像我一样被卡住!
I don't know why but choosing
Default Private Key
failed to me.Then I choose to
Custom Private Key
as screen shot below:The
Username
field has to be empty.The
Passphrase
field is the password of the your private key(Assume you have added the public key of this private key in git already.)
Hope no one got stuck like me !