用自定义参数触发Azure Devops管道

发布于 2025-02-11 09:31:00 字数 100 浏览 1 评论 0原文

我有一个基于某些运行时参数运行的Azure DevOps管道,该管道运行NPM。

是否有可能在同一管道中触发3个作业,每个运行时参数的作业中的每个作业?

谢谢

I have an Azure DevOps pipeline which runs npm run based on some runtime parameters.

Is there a possibility to trigger for example 3 jobs in the same pipeline, each of the job with different runtime parameters?

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温柔一刀 2025-02-18 09:31:00

是否有可能在同一管道中触发3个作业,每个运行时参数的作业?

是的。您可以定义对象类型参数,并使用每个表达式对值进行迭代。

这是一个示例:

parameters:
- name: tests
  type: object
  default: [test1,test2,test3] 



jobs:
- ${{ each test in parameters.tests }}:
  - job: 
    steps:
      - script: echo ${{ test }}

结果:

​-us/azure/devOps/pipelines/process/runtime-parameters?view = azure-devops& tabs& tabs = script#loop-through-parameters“ rel =“ nofollow noreferrer”>通过参数loop loop

Is there a possibility to trigger for example 3 jobs in the same pipeline, each of the job with different runtime parameters?

Yes. You can define the object type parameter and use each expression to iterate over the values.

Here is an example:

parameters:
- name: tests
  type: object
  default: [test1,test2,test3] 



jobs:
- ${{ each test in parameters.tests }}:
  - job: 
    steps:
      - script: echo ${{ test }}

Result:

enter image description here

For more detailed info, you can refer to this doc: Loop through parameters

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文