一Docker方式
1 获得镜像
docker pull jetbrains/teamcity-agent
2 启动镜像
其他参数是为了让agent能操作宿主机.并执行一些shell
docker run -d -it -e SERVER_URL=”这里填写teamcity server 的http地址” -e AGENT_NAME=“自定义agent的名称” -v /var/run/docker.sock:/var/run/docker.sock -v /opt/buildagent/work:/opt/buildagent/work -v /opt/buildagent/temp:/opt/buildagent/temp -v /opt/buildagent/tools:/opt/buildagent/tools -v /opt/buildagent/plugins:/opt/buildagent/plugins -v /opt/buildagent/system:/opt/buildagent/system –restart always –name Linux_Agent jetbrains/teamcity-agent
二 安装文件
先安装Java
1 下载zip包
2 解压与配置
unzip -d /teamcityagent/ buildAgentFull.zip
进入到conf文件夹后
cp buildAgent.dist.properties buildAgent.properties
vi buildAgent.properties
更改serverurl与name
3 保存退出
回到bin目录下
启动 sh agent.sh start