【发布时间】:2022-01-13 08:48:56
【问题描述】:
我有一系列流水线阶段,每个阶段只有一个作业。
每个阶段只有一份工作的最佳做法是什么? 下面我有我的示例 yml 设置:
trigger:
- main
resources:
- repo: self
stages:
# Test
##########################
- stage: Run_Tests
displayName: Run Tests
jobs:
- job: Run_Tests
displayName: Run Tests
pool:
vmImage: 'ubuntu-18.04'
steps:
# Testing Steps ...
# Build
##########################
- stage: Build
displayName: Build
jobs:
- job: Build
displayName: Build
pool:
vmImage: 'ubuntu-18.04'
steps:
# Build Steps ...
# Deploy
##########################
- stage: Deploy
displayName: Deploy
jobs:
- deployment: VMDeploy
displayName: Deploy
# Deploy Steps ...
我在整个文件中多次出现以下内容。
jobs:
-jobs:
这对我来说似乎是不必要的和混乱的。
我只是迂腐,还是有更好的方法来做到这一点?
【问题讨论】:
标签: azure azure-devops azure-pipelines azure-pipelines-release-pipeline azure-pipelines-yaml