azure - 我们在 Azure DevOps 中是否有标准管道选项来在其他管道(例如 jenkins 中)中共享库?

标签 azure azure-devops jenkins-pipeline shared-libraries

我希望定义一个标准管道,并希望在我所有具有通用步骤的作业中将其用作共享库。

最佳答案

是的,它的名字是 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/

相关文章:

azure - 恢复意外删除的注册代理

Jenkins 2 多分支管道 - 如何使用角色策略插件限制分支的可见性/执行?

c# - 如何获取具有子目录级别(n 级)的 Blob 容器中的所有 Blob?

c# - 仅将特定 VM 用于 TFS 构建

reactjs - 如何在天蓝色网站上的 react 应用程序中替换%PUBLIC_URL%

Jenkins 管道总是失败

Jenkins 描述 setter 不起作用

azure - 更改 Azure 虚拟机规模集的 Windows 注册表

c# - Bot 框架中的状态

javascript - Azure 阻止从用户代理 Mozilla/5.0 到应用服务的 POST 请求