我希望定义一个标准管道,并希望在我所有具有通用步骤的作业中将其用作共享库。
最佳答案
是的,它的名字是 Template :
Use templates to define your logic once and then reuse it several times. Templates combine the content of multiple YAML files into a single pipeline. You can pass parameters into a template from your parent pipeline.
例如,作业重用:
第一个 yaml:
# File: templates/jobs.yml
jobs:
- job: Build
steps:
- script: npm install
- job: Test
steps:
- script: npm test
第二个yaml:
# File: azure-pipelines.yml
jobs:
- template: templates/jobs.yml # Template reference
关于azure - 我们在 Azure DevOps 中是否有标准管道选项来在其他管道(例如 jenkins 中)中共享库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57490324/