[转] 在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 ...
随机推荐
- oracle sql 数结构表id降序
UPDATE BAS_ORGANIZATION_TYPE T1SET T1.PARENTID=(select rn from (SELECT id,rownum rn FROM BAS_ORGANIZ ...
- c语言的函数可以这样写,你见过吗?
c语言的函数可以这样写,你见过吗?真的可以编译通过的.
- jstack调试core文件
摘自:https://stackoverflow.com/questions/37331266/jstack-throws-exception-interrogating-a-core // 错误示例 ...
- Ubuntu14.04下 安装xhprof
1.下载xhprof包: wget http://pecl.php.net/get/xhprof-0.9.4.tgz 2.解压 进入扩展目录 .tgz cd /home/justphp/xhprof- ...
- 解决Emoji存储MySQL报错问题
在解决之前,得先说明一下为什么会出现报错,Emoji表情占用4个字节,但是MySQL数据库UTF-8编码最多只能存储3个字节,就会导致存储不进去 如何解决Emoji存储问题 mysql 的 utf8编 ...
- CodeForces 339B Xenia and Ringroad(水题模拟)
题意:给定 n 个地方,然后再给 m 个任务,每个任务必须在规定的地方完成,并且必须按顺序完成,问你最少时间. 析:没什么可说的,就是模拟,记录当前的位置,然后去找和下一个位置相差多长时间,然后更新当 ...
- unity 小地图的制作
利用 Transform.InverseTransformDirection 变换位置从世界坐标到自身坐标. 以第一人称控制器为坐标原点(忽视y轴),x轴z轴转为屏幕坐标. 若物体在地图范围外,可以 ...
- CodeForces 146E Lucky Subsequence(组合数+DP)
题目描述 Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers w ...
- CentOS 7.2安装zabbix 3.0 LTS
1.zabbix简介 zabbix(音同 zæbix)是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案. zabbix能监视各种网络参数,保证服务器系统的安全运营:并提供 ...
- ibatis 参数之 String
<select id="query_cust_name" resultClass="_custForm" parameterClass="Str ...