使用YAML文件的Azure DevOps构建管道无法工作

5
我已经为我的项目创建了一个build-pipeline.yml文件,这样我的应用程序就可以在Azure DevOps中自动构建。
首先,我使用DevOps UI创建了一个管道,它运作得非常好。
然后,我复制了所有在UI中创建的工作的yml内容。
接下来,我使用这个yml文件创建了一个新的Pipeline,并运行了这个Pipeline,但一开始就遇到了一些问题:

##[warning]There was a failure in sending the provision message: Unexpected response code from remote provider InternalServerError
,##[warning]There was a failure in sending the provision message: Unexpected response code from remote provider InternalServerError
,##[warning]There was a failure in sending the provision message: Unexpected response code from remote provider InternalServerError
,##[error]Provisioning request delayed or failed to send 3 time(s). This is over the limit of 3 time(s).

Pool: Azure Pipelines
Started: Today at 10:07
Duration: <1s

Job preparation parameters
1 queue time variable used
system.debug : false


Report build status
<1s
Set build status for commit e720d4.




我的yaml文件看起来就像这样:


pool:
  name: Azure Pipelines
steps:
- task: Docker@0
  displayName: 'build image'
  inputs:
    azureSubscription: 'TOOL'
    azureContainerRegistry: '{"loginServer":"abc.azurecr.io", "id" : "/subscriptions/a03e9b30-9b04-4e89-b366-117b3d6bf17e/resourceGroups/abcrg/providers/Microsoft.ContainerRegistry/registries/abcacr"}'

- task: Docker@0
  displayName: 'push image'
  inputs:
    azureSubscription: 'RCTOOL'
    azureContainerRegistry: '{"loginServer":"abctoolacr.azurecr.io", "id" : "/subscriptions/a03e9b30-9b04-4ed5-b3898-117b3d6bf17e/resourceGroups/abc-acr-rg/providers/Microsoft.ContainerRegistry/registries/abctoolacr"}'
    action: 'Push an image'

- task: HelmInstaller@0
  displayName: 'Install Helm '

- task: HelmDeploy@0
  displayName: 'Package Helm chart'
  inputs:
    azureSubscription: 'RCTOOL'
    azureResourceGroup: 'abc-rctool-k8s-rg'
    kubernetesCluster: 'abc-rctool-k8s'
    command: package
    chartPath: config/helm/eqcockpit

- task: PublishPipelineArtifact@1

我已经使用谷歌搜索过,但是没有找到任何有用的解决方案。也许你可以帮助我。


嗨,进展如何?你考虑在你的YAML中使用vmImage了吗?下面的答案能帮助你避免错误吗? - Mengdi Liang
你好,下面的解决方案是否解决了你的问题?如果解决了,请标记为答案。如果没有,请告诉我们任何新信息以帮助进一步解决。 - Bevan
1个回答

12

看起来你的pool需要更新。从这个列表中选择:托管代理池 示例。

pool:
  vmImage: vs2017-win2016

谢谢您。对我有用 :) - KMR
这对我没用。我使用参数来选择池,像这样:pool: name: {{ parameters['myPool'] }}使用自托管代理没有问题。但在“Azure管道”中失败了。 - sdhd
你需要指定实际的池名称,例如“vs2017-win2016”。 “Azure Pipelines”不起作用。 - Bevan
它对我有效,谢谢。 - Yojan Morales

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接