栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

Jenkins在不同的代理上并行构建

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Jenkins在不同的代理上并行构建

从本文档中可以这样进行:

// Creation of the stage_listdef stage_list = ["Windows", "Linux"]// Creation of a map of stagesdef stepsForParallel = stage_list.collectEntries {    ["echoing ${it}" : transformIntoStage(it)]}// Run the stages in parallelparallel stepsForParallel// Creation of the stagedef transformIntoStage(inputString) {    return {        stage (inputString) { steps {     echo "TEST "+inputString }        }    }}

您可以在此处找到有关并行Jenkins声明式管道的更多信息。


编辑

为什么它一起工作

steps
script
,但没有他们?

根据本文档,我认为

parallel
与列表一起使用是
方法(在Declarative Pipeline 1.2之前),该方法要求在Declarative Pipeline中使用scripted
Pipeline。

似乎新方法

parallel
(来自Declarative Pipeline 1.2)不能与列表一起使用。因此,要执行此操作,必须使用 旧的
scripted Pipeline方法,因此,您需要封装自己的命令
pipelinestage_list
script
而该命令本身必须由封装
steps

您可以在此处找到有关脚本化管道和声明性管道的更多信息。



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/392155.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号