gpt4 book ai didi

jenkins - 我可以将声明性管道的整个阶段包装为 groovy 库函数吗?

转载 作者:行者123 更新时间:2023-12-03 17:59:17 24 4
gpt4 key购买 nike

我想添加类似的东西

myStage()

到 Jenkinsfile。 myStage()在共享库中定义并包含整个阶段。这可能吗?我读到我可以将单个步骤和整个管道放入 groovy 函数中,但是阶段也可能吗?

最佳答案

声明式管道是不可能的。

声明式管道的其他部分可能可以通过库进行扩展,例如 options ,但是 it was said那:

For example, anything that contains an actual step execution (so steps, post, when (in part because of when expression and in part because it'd be a pain in the ass), stage, and stages (because stage contains steps and stages contains stage) would not be supported.



https://issues.jenkins-ci.org/browse/JENKINS-49135 .

另外, entire pipelines in libraries正式支持自 Declarative Pipeline 1.2 .

关于jenkins - 我可以将声明性管道的整个阶段包装为 groovy 库函数吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47514396/

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