gpt4 book ai didi

linux - 基于 View 选项卡定义要在 Jenkins 管道中运行的阶段

转载 作者:太空宇宙 更新时间:2023-11-04 10:12:07 25 4
gpt4 key购买 nike

我有一个 Jenkinsfile,可以让我决定在哪个 GitHub 分支上构建“使用参数构建”构建步骤。该变量在 Jenkinsfile 中定义。

我需要的是一种方法来决定在哪个环境中构建,即 Dev、Staging、PreProd、Prod,其中根据作业所在的“ View ”选择环境。只有某些构建阶段会基于该环境运行'查看'

这可以通过 Jenkinsfile 实现吗?

最佳答案

View 可以包含项目,但从项目内部看,没有 View 的概念。

一种常见的方法是向您的项目添加一个参数来指定构建目标环境。有了它,您也许可以使用类似 View Job Filters Plugin 的东西重新创建您的 View 。 .

Filter by Job Parameterization

Use Regular Expressions to include or exclude parameterized jobs based on their build parameters. Match the parameter name, build value, or description. Alternately, you may opt to depend on the default configured value.

For the name, value, and description - a blank indicates you do not care about that field - it behaves as if you had assigned it the regular expression ".*".

This filter works with String, Boolean, File, Choice, and Validating String parameter types.

关于linux - 基于 View 选项卡定义要在 Jenkins 管道中运行的阶段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48426146/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com