这是我第一次使用azure管道,我开始创建azure-pipeline.yml,但得到/azure-pipelines.yml(第16行,第1行):意外值'stages'
对齐了所有内容trigger:
- master
pr:
- master
pool:
vmImage: 'ubuntu-latest'
stages: # this line throws an error and i can't figure out why
- stage: Docker Tag and Push to Registry
jobs:
- job: Build and push to Azure Container Registry
steps:
- template: az-pipeline-templates/docker-build-tag.yml # Template reference
- stage: Deploy to US East
dependsOn: Docker Tag and Push to Registry # this stage runs after Docker Tag and Push to Registry
- job: Deploy to Azure Kubernetes Service
steps:
- template: az-pipeline-templates/deploy-to-aks.yml # Template reference
运行此操作将导致:
/azure-pipelines.yml(第16行,第1行):意外值“阶段”
答案 0 :(得分:0)
/azure-pipelines.yml(第16行,第1行):意外值“阶段”
此错误消息是由您指定的pool
引起的。您不应该在pool
之外指定stages
。
正确的格式应为:
trigger:
- master
pr:
- master
stages: # this line throws an error and i can't figure out why
- stage: Docker Tag and Push to Registry
jobs:
- job: Build and push to Azure Container Registry
pool:
vmImage: 'ubuntu-latest'
steps:
- template: az-pipeline-templates/docker-build-tag.yml # Template reference
- stage: Deploy to US East
dependsOn: Docker Tag and Push to Registry # this stage runs after Docker Tag and Push to Registry
- job: Deploy to Azure Kubernetes Service
pool:
vmImage: 'ubuntu-latest'
steps:
- template: az-pipeline-templates/deploy-to-aks.yml # Template reference