加入TeamCity编译节点

准备

首先确定自己是否可以访问已经搭建好的TeamCity的服务网站.

进入网站的"Agent"页面

点击Install Build Agents

配置

解压缩后,

BUILD_46654     
conf            
launcher        
plugins
bin         
contrib         
lib         
service.properties

以conf下的buildAgent.dist.properties文件作为模板, 编写一个buildagent.properties文件

cp conf/buildAgent.dist.properties conf/buildAgent.properties

参考这里修改conf/buildAgent.properties文件.
主要修改如下的几点:

  • serverUrl 修改为TeamCity的网址
  • name 改成一个特定的名字

authorizationToken可以先不用管

配置代理(可选步骤)

有些时候, 需要通过代理服务器来打通TeamCity服务和其他服务(比如bug服务器). 代理服务器的配置方法不难, 可以参考这里
如果Agent也需要通过代理访问, 则需要补充如下的配置:

## The URL or the IP address of the proxy host
teamcity.http.proxyHost=123.45.678.9
 
## The optional proxy port, leave blank to use the default port
teamcity.http.proxyPort=1234
 
 
## If the proxy requires authentication, specify the login
teamcity.http.proxyLogin=login
 
## If the proxy requires authentication, specify the password
teamcity.http.proxyPassword=password

运行

bash-3.2$ bin/agent.sh start
Starting TeamCity build agent...
Java executable is found in '/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home'.
Starting TeamCity Build Agent Launcher...
Agent home directory is /Users/jianglei/Downloads/buildAgent
Current Java runtime version is 1.8
Lock file: /Users/jianglei/Downloads/buildAgent/logs/buildAgent.properties.lock
Using no lock
Done [10112], see log at /Users/jianglei/Downloads/buildAgent/logs/teamcity-agent.log

登录TeamCity网站, 会看到还未认证的Agent信息

WechatIMG3.jpeg

点击Unauthorized, 输入comments设置agent所在的pool, 就可以了

可能遇到的问题

  • 如果TeamCity服务不是https的, 可能需要使用配置agent和服务端使用rpc-xml协议
WechatIMG4.jpeg

需要在服务端修改一下配置. 增加上图的配置

  • agent的初始状态往往是disconnected, 从log上可以看出来是Agent还需要从服务端下载插件并升级(upgrade). 一般等待10几分钟(取决于网速)就恢复正常了.
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,881评论 18 139
  • Spring Boot 参考指南 介绍 转载自:https://www.gitbook.com/book/qbgb...
    毛宇鹏阅读 46,941评论 6 342
  • 上一篇《WEB请求处理一:浏览器请求发起处理》,我们讲述了浏览器端请求发起过程,通过DNS域名解析服务器IP,并建...
    七寸知架构阅读 81,169评论 21 356
  • Ubuntu的发音 Ubuntu,源于非洲祖鲁人和科萨人的语言,发作 oo-boon-too 的音。了解发音是有意...
    萤火虫de梦阅读 99,529评论 9 467
  • 万维钢解读 关于本书作者 这本书的作者是加拿大学者森舸澜教授,加拿大著名的汉学家,斯坦福大学宗教学博士,主攻中国古...
    小裁缝sun阅读 1,119评论 0 1