我创建了一个管道,如下所示:
trigger:
branches:
include:
- pre-prod
pool:
name: default
stages:
- stage: build
displayName: 'Build stage'
jobs:
- job: Build
displayName: 'Build'
steps:
- script: echo Build starting
- script: |
docker-compose -f docker-compose.yml build
displayName: 'Build Docker images'
在我的 ubuntu 服务器上安装并注册了 azure 代理。 通过运行 run.sh,它可以正确连接到服务器并开始按预期处理作业。
查看日志,有一个名为初始化作业的阶段,它显然正在尝试下载 CmdLine 任务并抛出错误:
##[warning]Failed to download task 'CmdLine'. Error Unable to read data from the transport connection: Connection reset by peer.
##[warning]Inner Exception: Connection reset by peer
##[warning]Back off 21.485 seconds before retry.
##[warning]Failed to download task 'CmdLine'. Error Unable to read data from the transport connection: Connection reset by peer.
##[warning]Inner Exception: Connection reset by peer
##[warning]Back off 27.578 seconds before retry.
##[warning]Failed to download task 'CmdLine'. Error Unable to read data from the transport connection: Connection reset by peer.
##[warning]Inner Exception: Connection reset by peer
##[error]Unable to read data from the transport connection: Connection reset by peer.
我还尝试设置 DNS,因为 ubuntu 机器位于受限制的国家/地区,但没有成功。
注意:由于我对此完全是初学者,因此请不要将此问题投票为不喜欢,这样它就不会被删除。
此外,如果您认为有任何其他方法可能有帮助,请随时分享。
根据管道执行运行文档,在管道执行初始化作业任务之前,会分析管道中出现的任务定义,然后将它们下载到构建代理的缓存目录。
script
任务是 CmdLine
任务的别名。
“无法从传输连接读取数据”错误消息意味着您的自托管代理无法与目标进行通信。您提到您的 ubuntu 服务器位于受限制的国家/地区,因此很可能它在目的地被阻止。