在MacOS上安装GoCD代理
-
从以下地址下载适用于MacOS的GoCD代理安装程序下载页面.
-
在您选择的目录中解压安装程序。它会创建一个名为
go-agent-${version}
. -
将目录标记为未被MacOS隔离,以便允许启动GoCD代理:
# Assuming, for example, that the directory is "go-agent-20.5.0". $ cd go-agent-20.5.0 $ xattr -d -r com.apple.quarantine . xattr: [Errno 13] Permission denied: './jre/Contents/Home/lib/server/classes.jsa' xattr: [Errno 13] Permission denied: './jre/Contents/Home/legal/jdk.dynalink/dynalink.md' ... # These "Permission denied" warnings can be ignored.
管理GoCD代理进程
必须使用以下参数之一运行GoCD代理脚本:
脚本 | 描述 |
---|---|
./bin/go-agent console |
GoCD代理将在前台启动 |
./bin/go-agent start |
GoCD代理将作为后台守护程序启动 |
./bin/go-agent stop |
GoCD代理将停止 |
./bin/go-agent restart |
GoCD代理将重新启动 |
配置GoCD代理
安装GoCD代理后,必须首先使用您的GoCD服务器的主机名(或IP地址)配置代理,为此:
- 打开
./wrapper-config/wrapper-properties.conf
使用您喜欢的文本编辑器。 - 按照文件中的说明配置GoCD服务器URL
- 保存文件并退出编辑器。
- 在该目录下手动运行
service go-agent [start|restart]
以启动或重新启动代理。
在服务器上注册您的代理
出于安全原因,所有新安装的GoCD代理都需要在GoCD服务器上启用,然后才能分配工作给他们。这可以防止未经授权的人访问您的源代码。要启用新安装的GoCD代理,请执行以下操作:
- 打开GoCD服务器仪表板
- 按照指示在这里在列表中找到您刚刚安装的代理,并将代理添加到您的云中。GoCD服务器现在将为此代理安排工作。