[转] 在Jenkins Pipeline DSL中 遍历 groovy list
[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的更多相关文章
- Jenkins Pipeline 参数详解
Pipeline 是什么 Jenkins Pipeline 实际上是基于 Groovy 实现的 CI/CD 领域特定语言(DSL),主要分为两类,一类叫做 Declarative Pipeline,一 ...
- Kubernetes笔记(三):Gitlab+Jenkins Pipeline+Docker+k8s+Helm自动化部署实践(干货分享!)
通过前面两篇文章,我们已经有了一个"嗷嗷待哺"的K8s集群环境,也对相关的概念与组件有了一个基本了解(前期对概念有个印象即可,因为只有实践了才能对其有深入理解,所谓"纸上 ...
- 在Jenkins的pipeline项目中运行jmeter测试-教程
Jenkins 2.0的发布引入了一种新的项目类型 - Pipeline,以前只能通过插件获得.从Jenkins 2.0开始,Pipeline项目开箱即用. 与通常的“自由式”项目相比,管道构建具有几 ...
- jenkins pipeline中获取shell命令的标准输出或者状态
//获取标准输出//第一种 result = sh returnStdout: true ,script: "<shell command>" result = res ...
- 在容器中运行 Jenkins pipeline 任务
持续集成中的 pipeline 技术和 docker 都是当前正在发展的主流方向,当然把它们结合起来在 CI/CD 过程中发挥出更强大的威力也是大家共同的目标.本文将介绍如何在 Jenkins pip ...
- 【原】Jenkins pipeline中资料总结
docker-compose 快速部署持续集成测试环境 Gitlab+Harbor+Jenkins pipeline 实现 tag run docker Images https://www.cnbl ...
- Jenkins pipeline:pipeline 使用之语法详解
一.引言 Jenkins 2.0的到来,pipline进入了视野,jenkins2.0的核心特性. 也是最适合持续交付的feature. 简单的来说,就是把Jenkins1.0版本中,Project中 ...
- Jenkins pipeline:pipeline 语法详解
jenkins pipeline 总体介绍 pipeline 是一套运行于jenkins上的工作流框架,将原本独立运行于单个或者多个节点的任务连接起来,实现单个任务难以完成的复杂流程编排与可视化. ...
- Jenkins pipeline shared library
Jenkinsfile https://jenkins.io/doc/book/pipeline/jenkinsfile/ Jenkins Pipeline is a suite of plugins ...
随机推荐
- combotree 满足条件的节点不可选中
combotree: $("#Parent").treegrid("unselect");
- CentOS7.4配置SSH登录密码与密钥身份验证踩坑
简单记录,自用CentOS7.4虚拟机与ALiYunVPS,在配置ssh登录身份验证时碰到的问题. 阿里云VPS:因为在重置磁盘时选择了密钥对的身份验证方式,因此VPS中的CentOS7.4中的 /e ...
- STL中 map 和 multimap
1. 所在头文件<map>. 命名空间std, 声明如下: namespace std{ template <class Key,class T, class Compare = l ...
- Linux Basic学习笔记01
介绍课程: 中级: 初级:系统基础 中级:系统管理.服务安全及服务管理.Shell脚本: 高级: MySQL数据库: cache & storage 集群: Cluster lb: 4laye ...
- SQL序列键
当需要更新表中的数据或像表中插入数据时,在很多情况下需要产生唯一的整数序列键 一:更新列的值为唯一值 原数据如下图: 可以定义一个CTE,返回orerid列的值以及row_number()的计算结果. ...
- 公众号js-sdk简
后台代码 jssdk.PHP——因sae的不可写环境,故需要将accesstoken和JsApiTicket存入数据库. 数据库字段:id(int 3),accesstoken(string 255) ...
- windows10个性化设置
任务栏DIY 日期显示样式 字体
- 设计模式21:State 状态模式(行为型模式)
State 状态模式(行为型模式) 动机(Motivation) 在软件构建过程中,某些对象的状态如果改变,其行为也会随之而发生变化,比如文档处于只读状态,其支持的行为和读写状态的行为就可能完全不同. ...
- Spring.NET 整合Nhibernate
因为最近无意中学了AOP ,所以想一探究竟,看看.net里这个Spring.Net 到底是怎么回事,请有需要的童鞋往下,不需要的请alt+w.因为是先配置的 Nhibernate 所以就从这个开始.开 ...
- Anroid ActionBar 学习资源
Android ActionBar完全解析,使用官方推荐的最佳导航栏(上) http://blog.csdn.net/yuzhiboyi/article/details/32709833 Androi ...