How to use groovy script on jenkins
1. Install groovy plugin
2. Add a step of groovy. (normal & systerm)
3. Execute groovy script
import jenkins.model.*
def q = Jenkins.instance.queue
q.items.findAll{ it.task.name.startsWith('ttt') }.each{ q.cancel(it.task) }
Above script is cancel all pending build in queue.
Additional info:
install groovy :
GVM (the GroovyenVironment Manager)
This tool makesinstalling Groovy on any Bash platform (Mac OSX, Linux, Cygwin, Solaris orFreeBSD) very easy.
Simply open a newterminal and enter:
$ curl -s get.gvmtool.net | bash
Follow theinstructions on-screen to complete installation.
Open a newterminal or type the command:
$ source "$HOME/.gvm/bin/gvm-init.sh"
Then install thelatest stable Groovy:
$ gvm install groovy
After installationis complete and you've made it your default version, test it with:
$ groovy -version
That's all thereis to it!
How to use groovy script on jenkins的更多相关文章
- SoapUI Pro Project Solution Collection –Easy develop Groovy Script to improve SoapUI ability
As you know the groovy script and java script language is the soapui supported .but unfortunately So ...
- Common tasks that you can perform with the Groovy Script test step
https://support.smartbear.com/readyapi/docs/soapui/steps/groovy.html Get test case object To obtain ...
- Access Java API in Groovy Script
$ cat Hello.java package test; public class Hello { public int myadd(int x, int y) { return 10 * x + ...
- Elasticsearch的Groovy Script自定义评分检索
需求:以索引中的boostapp列作为评分的基础分值,同时根据carpublishtime(数据的刷新时间字段)按时间进行衰减. 基于Groovy脚本实现. 1.query脚本方式: { " ...
- Groovy Script in SoapUI REST Testing
1. Run special step: testRunner.runTestStepByName("stepName/requestName") get it's respons ...
- [SoapUI] 通过Groovy Script获取当前运行的是哪套Environment
log.info testRunner.testCase.testSuite.project.getActiveEnvironment().getName()
- [Training Video - 5] [Groovy Script Test Step - Collections, Exceptions] Exception Handling in groovy
def x = new String[3] x[0] = "A" x[1] = "B" x[2] = "C" log.info"X ...
- [Training Video - 5] [Groovy Script Test Step - Collections, Exceptions] HashSet and Hashtable
Hashset: HashSet set = new HashSet() set.add("India") set.add("USA") set.add(&qu ...
- [Training Video - 5] [Groovy Script Test Step - Collections, Exceptions] Array and ArrayList
Array: def x = new String[5] x[0] = "India" x[1] = "USA" x[2] = "Korea" ...
随机推荐
- js框架设计1.1命名空间笔记
借到了司徒正美的写的js框架设计一书,司徒大神所著有些看不太懂,果然尚需循序渐进,稳扎js基础之中. 第一张开篇司徒阐述了种子模块的概念 种子模块亦为核心模块,框架最先执行模块,司徒见解应包含:对象扩 ...
- Unity3D LuaBundleLoader(基于cslua)
说明:异步加载lua的bundle,会优先加载cache目录下bundle(一般更新的资源都在cache下) using System; using UnityEngine; using System ...
- appium 处理动态控件
环境怎么搭建,参考:http://www.cnblogs.com/tobecrazy/p/4562199.html 知乎Android客户端登陆:http://www.cnblogs.com/tobe ...
- ffmpeg-20160822-bin.7z
ESC 退出 0 进度条开关 1 屏幕原始大小 2 屏幕1/2大小 3 屏幕1/3大小 4 屏幕1/4大小 5 屏幕横向放大 20 像素 6 屏幕横向缩小 20 像素 S 下一帧 [ -2秒 ] +2 ...
- error LNK2019:unresolved external symbol
error LNK2019:unresolved external symbol 这个错误是指程序不认识函数.具体的说就是.h文件中定义并没有实现,这就是库出现了问题. 遇到这个问题,第一步就要看是哪 ...
- C#设计模式之抽象工厂
抽象工厂模式:提供一个创建一系列相关或相互依赖对象的接口,而无须指定它们具体的类. 抽象工厂模式中的具体工厂不只是创建一种产品,它负责创建一族产品 当一个工厂等级结构可以创建出分属于不同产品等级结构的 ...
- PHP实现四种基本排序算法
前提:分别用冒泡排序法,快速排序法,选择排序法,插入排序法将下面数组中的值按照从小到大的顺序进行排序. $arr(1,43,54,62,21,66,32,78,36,76,39); 1. 冒泡排序 思 ...
- C#回顾 - 8.利用反射动态创建对象
拿微信消息返回的示例数据实验 var data = "<xml><ToUserName><![CDATA[toUser]]></ToUserName ...
- 【C#】MVC项目中搭建WebSocket服务器
前言 因为项目需要,前端页面中需要不断向后台请求获取一个及一个以上的状态值.最初的方案是为每个状态值请求都建立一个定时器循环定时发起Ajax请求,结果显而 易见.在HTTP1.1协议中,同一客户端浏览 ...
- 基于Libevent的HTTP Server
简单的Http Server 使用Libevent内置的http相关接口,可以很容易的构建一个Http Server,一个简单的Http Server如下: #include <event2/e ...