[From] https://stackoverflow.com/questions/36360097/iterating-a-groovy-list-in-jenkins-pipeline-dsl

// 定义一个List,并向里面加入一些元素
def componentList = [] def componentMapEntry1 = [:]
componentMapEntry1['componentName']="Dashboard_Core"
componentList << componentMapEntry1 def componentMapEntry2 = [:]
componentMapEntry2['componentName']="Dashboard_Equities"
componentList << componentMapEntry2 def cme3 = [:]
cme3["componentName"] = "home"
componentList << cme3
echo "size of list "+componentList.size()

// pipeline里打印size()
[Pipeline] echo
size of list
println componentList

// pipeline里直接打印list
[Pipeline] echo
[{componentName=Dashboard_Core}, {componentName=Dashboard_Equities}, {componentName=home}]
for (i = ; i <componentList.size(); i++) {
println componentList[i]
} // pipeline里遍历list
[Pipeline] echo
{componentName=Dashboard_Core}
[Pipeline] echo
{componentName=Dashboard_Equities}
[Pipeline] echo
{componentName=home}

[转] 在Jenkins Pipeline DSL中 遍历 groovy list的更多相关文章

  1. Jenkins Pipeline 参数详解

    Pipeline 是什么 Jenkins Pipeline 实际上是基于 Groovy 实现的 CI/CD 领域特定语言(DSL),主要分为两类,一类叫做 Declarative Pipeline,一 ...

  2. Kubernetes笔记(三):Gitlab+Jenkins Pipeline+Docker+k8s+Helm自动化部署实践(干货分享!)

    通过前面两篇文章,我们已经有了一个"嗷嗷待哺"的K8s集群环境,也对相关的概念与组件有了一个基本了解(前期对概念有个印象即可,因为只有实践了才能对其有深入理解,所谓"纸上 ...

  3. 在Jenkins的pipeline项目中运行jmeter测试-教程

    Jenkins 2.0的发布引入了一种新的项目类型 - Pipeline,以前只能通过插件获得.从Jenkins 2.0开始,Pipeline项目开箱即用. 与通常的“自由式”项目相比,管道构建具有几 ...

  4. jenkins pipeline中获取shell命令的标准输出或者状态

    //获取标准输出//第一种 result = sh returnStdout: true ,script: "<shell command>" result = res ...

  5. 在容器中运行 Jenkins pipeline 任务

    持续集成中的 pipeline 技术和 docker 都是当前正在发展的主流方向,当然把它们结合起来在 CI/CD 过程中发挥出更强大的威力也是大家共同的目标.本文将介绍如何在 Jenkins pip ...

  6. 【原】Jenkins pipeline中资料总结

    docker-compose 快速部署持续集成测试环境 Gitlab+Harbor+Jenkins pipeline 实现 tag run docker Images https://www.cnbl ...

  7. Jenkins pipeline:pipeline 使用之语法详解

    一.引言 Jenkins 2.0的到来,pipline进入了视野,jenkins2.0的核心特性. 也是最适合持续交付的feature. 简单的来说,就是把Jenkins1.0版本中,Project中 ...

  8. Jenkins pipeline:pipeline 语法详解

    jenkins  pipeline 总体介绍 pipeline 是一套运行于jenkins上的工作流框架,将原本独立运行于单个或者多个节点的任务连接起来,实现单个任务难以完成的复杂流程编排与可视化. ...

  9. Jenkins pipeline shared library

    Jenkinsfile https://jenkins.io/doc/book/pipeline/jenkinsfile/ Jenkins Pipeline is a suite of plugins ...

随机推荐

  1. 虚拟机上linux与windows之间复制粘贴

    参考:https://blog.csdn.net/qq_34501940/article/details/51222119

  2. mybatis 插入实体与数据库中的字段不一致的解决方案

    1.建立一个实体类 public class Student { private Integer id; private String name; private Double salary; pub ...

  3. Hibernate查询对象所有字段,单个字段 ,几个字段取值的问题

    HQL 是Hibernate Query Language的简写,即 hibernate 查询语言:HQL采用面向对象的查询方式.HQL查询提供了更加丰富的和灵活的查询特性,因此Hibernate将H ...

  4. SQL的Join语法

    对于SQL的Join,在学习起来可能是比较乱的.我们知道,SQL的Join语法有很多inner的,有outer的,有left的,有时候,对于Select出来的结果集是什么样子有点不是很清楚.Codin ...

  5. SpringMVC源码解读 - RequestMapping注解实现解读 - RequestCondition体系

    一般我们开发时,使用最多的还是@RequestMapping注解方式. @RequestMapping(value = "/", param = "role=guest& ...

  6. NetBeans找不到C/C++编译器

    如果您已经安装 NetBeans IDE 6.9,但其中不包括 C/C++ 插件 如果在选择“文件”>“新建项目”时,NetBeans IDE 未显示 "C/C++" 项目类 ...

  7. 【Head First Java 读书笔记】(七)继承

    继承与多态 了解继承 继承的关系意味着子类继承了父类的实例变量和方法.父类比较抽象,子类比较具体. 继承层次的设计 找出具有共同属性和行为的对象(用继承来防止子类中出现重复的程序代码) 设计代表共同状 ...

  8. Linux 下几个重要目录解释

    linux下把所有的东西都当作文件的,,一个分区想要使用就需要挂载到一个文件夹上,那这个文件夹就叫挂载点,像常用的把 设备/dev/cdrom挂载到/mnt,,,你想问的应该是linux的各目录的解释 ...

  9. 关于SoftReference的使用

    SoftReference一般可以用来创建缓存的,缓存我们经常使用,例如:我们在浏览器中浏览了一个网页后,点击跳转到新的网页,我们想回去看之前的网页,一般是点击回退按钮,那么这个时候之前的网页一般就是 ...

  10. Mysql主主复制+keepalived

    1>环境 Master1 10.0.0.201 Master2 10.0.0.202 2>Master1操作授权 mysql>grant replication slave on * ...