我创建一个 Azure-Pipelines 文件,其开头如下:
pool:
vmImage: 'Ubuntu-16.04'
trigger:
- master
variables:
buildConfiguration: 'Release'
buildPlatform: 'any cpu'
version: '0.2.0'
azureSubscription: 'Azure.Nupaya'
azureAppType: 'Web App on Windows'
webAppName: 'api'
stages:
- stage: 'Prepare'
displayName: 'Prepare'
jobs:
- job: 'Setup'
steps:
- task: DotNetCoreInstaller@0
displayName: 'Install'
inputs:
packageType: 'sdk'
version: '2.2.105'
当我运行它时,我收到错误:
Unexpected value 'stages'
Yaml 文件不支持阶段吗?
我检查了Schema在 Microsoft 文档中...
我错过了什么?
最佳答案
在使用 Azure DevOps 进行一些操作和测试后,您似乎在 job 属性下定义了池,以便允许我们为不同的作业定义不同的代理池.
所以对于你的例子来说它是:
trigger:
- master
variables:
buildConfiguration: 'Release'
buildPlatform: 'any cpu'
version: '0.2.0'
azureSubscription: 'Azure.Nupaya'
azureAppType: 'Web App on Windows'
webAppName: 'api'
stages:
- stage: 'Prepare'
displayName: 'Prepare'
jobs:
- job: 'Setup'
pool:
vmImage: 'Ubuntu-16.04'
steps:
- task: DotNetCoreInstaller@0
displayName: 'Install'
inputs:
packageType: 'sdk'
version: '2.2.105'
关于asp.net-core - 使用 Azure DevOps Pipeline 中的阶段 : Unexpected value 'stages' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55622844/